Defect detection method based on visible light image of building facade
By preprocessing and de-interference processing the visible light images of building facades, balanced training sample data is generated, which solves the problem of low model accuracy in defect detection and achieves efficient and accurate defect identification.
Patent Information
- Application Number
- CN202511223839.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-12-09
AI Technical Summary
Existing technologies struggle to achieve efficient and accurate detection of defects on building facades, especially since the balance of defect data is difficult to guarantee, leading to a decrease in the recognition accuracy of deep learning models.
By preprocessing visible light images of building facades, counting the number of each defect type, and generating balanced training sample data, noise is added using a diffusion model to generate new data samples. Simultaneously, interference removal processing is performed and a mask is applied before inputting the data into a deep learning model for training.
This improved the model's post-training accuracy, reduced the false positive rate, and ensured that the model could reliably and stably identify defects under complex conditions.
Smart Images

Figure CN121095656A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of building facade defect identification technology, and particularly relates to a defect detection method based on visible light images of building facades. Background Technology
[0002] In today's industrial sector, the quality inspection of building facades is a crucial step. With the continuous emergence of various large-scale buildings in cities, ensuring the structural integrity and appearance quality of building facades is of paramount importance for guaranteeing the safety and service life of buildings. However, current traditional methods for detecting facade defects have many limitations and cannot meet the demands of modern industry for efficient and accurate detection. With the acceleration of the intelligentization process of industrial manufacturing, surface defect detection technology based on computer vision has become one of the core research directions in the field of intelligent manufacturing. However, in the process of using deep learning models for image defect recognition, large-scale datasets are required to achieve good training results. However, the applicant found that in the actual data collection process, the balance of various defect data is difficult to guarantee. The lack of sample size for defect categories often makes it difficult for the model to accurately extract its key features, thus reducing the accuracy of recognition. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a defect detection method based on visible light images of building facades. After preprocessing the visible light images, the number of each defect type is counted, and defect-free visible light images are generated as new data samples containing defects. This balances the number of various defects in the training sample data, thereby significantly improving the accuracy of the trained model. At the same time, the visible light images are first processed to remove interference and the interference areas are masked to help the subsequent model reduce the false positive rate.
[0004] The objective of this invention is achieved through the following technical solution: A defect detection method based on visible light images of building facades includes the following steps: Step S1: Acquire visible light images of the building facade; Step S2: Preprocess the collected dataset and count the number of defects of each type; Step S3: Based on the number of each type of defect counted in Step S2, determine the types and quantities of defects that need to be expanded, take some defect-free data samples, and generate new data samples containing the corresponding number of defects, so as to balance the number of each type of defect in the new dataset. Step S4: Perform interference calibration on all visible light images and obtain the corresponding label files; Step S5: Input the label file obtained in step S4 and its corresponding original visible light image file into the deep learning image segmentation model so that it can learn the features of interference on the visible light image and locate the interference area. Separate the interference area from the original image through the image segmentation algorithm to obtain the segmented interference mask image with the interference area occluded. Step S6: Next, annotate the segmentation interference mask images obtained in step S5 with various defects, generate label information, and obtain the label file corresponding to each segmentation interference mask image. Step S7: Input the label file obtained in step S6 and its corresponding original visible light image file into the deep learning model to start the training and recognition process simultaneously. In this implementation method, after preprocessing the visible light image, the number of each type of defect is counted, and the defect-free visible light image is generated as a new data sample containing defects, so as to balance the number of various defects in the training sample data, thereby greatly improving the accuracy of the trained model. At the same time, the visible light image is first processed to remove interference and the interference area is masked to facilitate the subsequent model to reduce the misjudgment rate.
[0005] In one embodiment, in step S1, a drone equipped with sensors flies to the exterior of the building and collects visible light images of the wall along a preset route.
[0006] In one embodiment, step S1 further includes: maintaining a consistent distance from the wall during each data acquisition process.
[0007] In one embodiment, step S2 involves preprocessing the collected dataset, including: Filter the dataset to remove invalid or erroneous data and fill in missing values.
[0008] In one implementation, step S2 involves counting the number of defects of each type, including: The defect types are divided into three categories: hollow defects, crack defects, and detachment defects. The specific number of each of the three defect types in the preprocessed dataset is counted.
[0009] In one implementation, in step S3, based on the required types of defects and the corresponding number of defects, different types of diffusion models are used to gradually add noise to the defect-free data samples until the data becomes completely Gaussian noise. Then, the reverse reasoning process is used to generate new data samples containing the corresponding number of defects.
[0010] In one implementation, the diffusion model is formulated as follows: ; in, For the new data sample generated in step t; Let the parameter be a parameter that gradually decreases in the range [0, 1]. < ; This is the data sample for step t-1; The Gaussian noise is labeled and follows a standard normal distribution with a mean of 0 and a variance of 1. For the data from the previous step The scaling factor; For noise The scaling factor.
[0011] In one implementation, in step S5, the DeepLabV3 network is used for interference removal, and the SLIC superpixel segmentation algorithm is introduced to perform superpixel segmentation on the image to obtain the dominant category label of the superpixel region, forming a new SLIC label map, which is then input into the deep learning model along with the original visible light image file, and finally outputs a deep learning model with pixel-level semantic segmentation capability.
[0012] In one implementation, in step S7, the label file obtained in step S6 and its corresponding original visible light image file are input together into the YOLOv11 deep learning model.
[0013] The beneficial effects of this invention are as follows: This invention provides a defect detection method based on visible light images of building facades. After preprocessing the acquired visible light images of building facades, the number of each defect type is counted. Based on the required expansion of defect types and numbers, defect-free visible light images are used to generate new data samples containing corresponding defects. This balances the number of various defects in the training sample data, thereby significantly improving the accuracy of the trained model. Simultaneously, the visible light images are first processed to remove interference and then masked at the interference points before deep learning. This helps the subsequent model reduce the false positive rate, thus ensuring the accuracy of model training while reducing the number of training samples required for the deep learning model. Attached Figure Description
[0014] The invention will now be described in more detail with reference to embodiments and the accompanying drawings. Figure 1 A flowchart of the present invention is shown; Figure 2 A schematic diagram of the segmentation interference mask image of the present invention is shown; Figure 3 This diagram illustrates the disease identification and prediction results of the present invention. In the accompanying drawings, the same parts use the same reference numerals. The drawings are not to scale. Detailed Implementation
[0015] The invention will now be further described with reference to the accompanying drawings.
[0016] This invention provides a defect detection method based on visible light images of building facades, such as... Figure 1 As shown, it includes the following steps: Step S1: Collect visible light images of the building facade. The drone, equipped with sensors, flies to the building facade and collects visible light images of the wall sequentially according to the preset flight program and positioning system. During the collection process, the distance between the drone and the wall is kept consistent each time the image is collected. Step S2: Filter and preprocess the collected dataset to remove invalid or erroneous data and fill in missing values. This avoids problems such as incomplete or inconsistent visible light images caused by factors such as light, angle, weather, and drone stability during the acquisition process. Then, classify the defects into three types: hollow defects, crack defects, and detachment defects. Count the specific number of the three types of defects in the preprocessed dataset. Step S3: Based on the number of defects of each type counted in Step S2, expand the defect types with fewer defects to match the number of defect types with more defects, so as to balance the number of defects of each type. That is, take some defect-free data samples, use different types of diffusion models to gradually add noise to the defect-free data samples, and then use the model's reverse reasoning process to generate new, high-quality, and diverse defect image samples, so that the number of defect samples of each category tends to be balanced, providing more balanced data support for subsequent defect analysis and model training, thereby improving the model's ability to identify various defects and its generalization performance. The core formula of the diffusion model is as follows: ; in, For the new data sample generated in step t; Let the parameter be a parameter that gradually decreases in the range [0, 1]. < ; This is the data sample for step t-1; The Gaussian noise is labeled and follows a standard normal distribution with a mean of 0 and a variance of 1. For the data from the previous step The scaling factor; For noise The scaling factor; Step S4: Based on the dataset processed in step S3, perform interference calibration on all visible light images and obtain corresponding label files. The Labelme annotation software can be used for interference calibration to mark and locate various interference factors in detail, and obtain and save the calibrated JSON file. Step S5: Combine the JSON file obtained in Step S4 with its corresponding original visible light image file, and input them into the deep learning image segmentation model. The model uses the annotation information in the JSON file to learn the features of interference in the visible light image, accurately locates the interference region, and separates it from the original image using an image segmentation algorithm. Finally, the model outputs an image with a segmentation mask, such as... Figure 2 As shown, the interference area is effectively masked, thus providing clear and accurate image data for subsequent defect analysis; In this step, the DeepLabV3 network is used for interference removal, and the SLIC superpixel segmentation algorithm is introduced to perform superpixel segmentation on the image to obtain the dominant category label of the superpixel region, forming a new SLIC label map, which is then input into the deep learning model along with the original visible light image file. Finally, a deep learning model with pixel-level semantic segmentation capability is output, which makes it stable and reliable when facing complex and ever-changing real-world situations. Step S6: Next, annotate the segmentation interference mask image obtained in step S5 with various defects, generate label information and obtain the label file corresponding to each segmentation interference mask image. In this step, Labelme annotation software can also be used to annotate the segmentation interference mask image obtained in step S5 with various defects. Step S7: Input the label file obtained in Step S6 and its corresponding original visible light image file into the deep learning model, and start the training and recognition process simultaneously. The model performs joint analysis on the image and label data, learns the feature patterns of the image through the algorithm, and accurately identifies the features of various defects. The model continuously optimizes parameters during training to improve recognition accuracy, and finally outputs detection results containing the location and type of defects, such as... Figure 3 As shown; In this step, the label file obtained in step S6 and its corresponding original visible light image file are input into the YOLOv11 deep learning model. By utilizing its powerful feature extraction capabilities and efficient convolutional neural network architecture, the model performs deep learning and analysis on the potential defect features in the image, enabling it to accurately identify and locate various defects. It can also flexibly adapt to multiple deep learning architectures and support multi-model integration strategies, thereby achieving more accurate and efficient defect detection.
[0017] It should be noted that surface defect detection technology based on computer vision has become one of the core research directions in the field of intelligent manufacturing. However, the applicant found that in the process of using deep learning models for image defect recognition, it is necessary to rely on large-scale datasets to achieve good training results. However, in the actual data acquisition stage, it is difficult to ensure the balance of various defect data. The shortage of sample sizes for defect categories often makes it difficult for the model to accurately extract its key features, thus reducing the accuracy of recognition. If traditional data augmentation methods such as image rotation and scaling are used, the applicant found that there is a significant deviation between the generated samples and the actual defect distribution, which makes it difficult to effectively enhance the model's ability to recognize complex defects. In this embodiment, after preprocessing the acquired visible light images of the building facade, the number of each defect type is counted. Based on the required expansion of defect types and numbers, defect-free visible light images are used to generate new data samples containing the corresponding defects. A diffusion model is used to add noise forward and recover the original data backward (in the forward process, the model gradually adds noise to the original data until the data becomes entirely Gaussian noise; the backward process is the reverse of the forward process to recover the original data from the noise). This ensures that the generated samples closely approximate the actual defect distribution, balancing the number of various defects in the training sample data, thereby significantly improving the accuracy of the trained model. Simultaneously, the visible light images are first processed to remove interference and then masked at the interference points before deep learning, which helps the subsequent model reduce the false positive rate. This ensures the accuracy of model training while reducing the number of training samples required for the deep learning model. Figure 2 As shown, the image displays the segmentation interference mask images after processing four visible light images of the building facade (a), (b), (c), and (d) in step S5. Figure 3 This corresponds to the trained deep learning model. Figure 2 The final output includes the detection results of the defect location and type, which can accurately display the location and type of defects in the visible light image.
[0018] In the description of this invention, it should be understood that the terms "upper", "lower", "bottom", "top", "front", "rear", "inner", "outer", "left", "right", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0019] While the invention has been described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the invention. Therefore, it should be understood that many modifications can be made to the exemplary embodiments, and other arrangements can be designed without departing from the spirit and scope of the invention as defined by the appended claims. It should be understood that different dependent claims and features described herein can be combined in ways different from those described in the original claims. It is also understood that features described in conjunction with individual embodiments can be used in other described embodiments.
Claims
1. A defect detection method based on visible light images of building facades, characterized in that, Includes the following steps: Step S1: Acquire visible light images of the building facade; Step S2: Preprocess the collected dataset and count the number of defects of each type; Step S3: Based on the number of each type of defect counted in Step S2, determine the types and quantities of defects that need to be expanded, take some defect-free data samples, and generate new data samples containing the corresponding number of defects, so as to balance the number of each type of defect in the new dataset. Step S4: Perform interference calibration on all visible light images and obtain the corresponding label files; Step S5: Input the label file obtained in step S4 and its corresponding original visible light image file into the deep learning image segmentation model so that it can learn the features of interference on the visible light image and locate the interference area. Separate the interference area from the original image through the image segmentation algorithm to obtain the segmented interference mask image with the interference area occluded. Step S6: Next, annotate the segmentation interference mask images obtained in step S5 with various defects, generate label information, and obtain the label file corresponding to each segmentation interference mask image. Step S7: Input the label file obtained in step S6 and its corresponding original visible light image file into the deep learning model to start the training and recognition process simultaneously.
2. The defect detection method based on visible light images of building facades according to claim 1, characterized in that, In step S1, a drone equipped with sensors flies to the exterior of the building and collects visible light images of the wall along a preset route.
3. The defect detection method based on visible light images of building facades according to claim 1, characterized in that, Step S1 also includes: maintaining a consistent distance from the wall during each data acquisition process.
4. The defect detection method based on visible light images of building facades according to claim 1, characterized in that, In step S2, the collected dataset is preprocessed, including: Filter the dataset to remove invalid or erroneous data and fill in missing values.
5. A defect detection method based on visible light images of building facades according to claim 1 or 4, characterized in that, In step S2, the number of defects of each type is counted, including: The defect types are divided into three categories: hollow defects, crack defects, and detachment defects. The specific number of each of the three defect types in the preprocessed dataset is counted.
6. The defect detection method based on visible light images of building facades according to claim 5, characterized in that, In step S3, based on the required types and quantities of defects to be expanded, noise is gradually added to the defect-free data samples using different types of diffusion models until the data becomes completely Gaussian noise. Then, the inference process is reversed to generate new data samples containing the corresponding number of defects.
7. The defect detection method based on visible light images of building facades according to claim 6, characterized in that, The formula for the diffusion model is as follows: ; in, For the new data sample generated in step t; Let [the parameter] be a parameter that gradually decreases in the range [0, 1]. < ; This is the data sample for step t-1; The Gaussian noise is labeled and follows a standard normal distribution with a mean of 0 and a variance of 1. For the data from the previous step The scaling factor; For noise The scaling factor.
8. A defect detection method based on visible light images of building facades according to claim 7, characterized in that, In step S5, the DeepLabV3 network is used for noise reduction, and the SLIC superpixel segmentation algorithm is introduced to perform superpixel segmentation on the image to obtain the dominant category label of the superpixel region, forming a new SLIC label map. This map is then input into the deep learning model along with the original visible light image file, and finally outputs a deep learning model with pixel-level semantic segmentation capabilities.
9. A defect detection method based on visible light images of building facades according to claim 8, characterized in that, In step S7, the label file obtained in step S6 and its corresponding original visible light image file are input into the YOLOv11 deep learning model.