Building engineering crack detection method and system based on image recognition
By constructing a compact feature vector and a spatially optimized indexing mechanism, the problems of storage pressure and low real-time detection efficiency in building crack detection are solved, achieving efficient storage and fast retrieval, and improving detection efficiency and accuracy.
Patent Information
- Application Number
- CN202511615557.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-02-13
AI Technical Summary
Existing building crack detection technologies suffer from high storage pressure and low real-time detection efficiency. In particular, in the monitoring of large-scale building complexes, image feature deviations caused by changes in lighting conditions and shooting angles affect the efficiency of accurate matching.
By constructing compact feature vectors and a spatially optimized feature indexing mechanism, and employing multi-scale decomposition, feature dimensionality reduction, quantization encoding, and approximate nearest neighbor search, combined with a multi-level index hierarchy, we achieve efficient storage and fast retrieval, and dynamically adjust the tolerance threshold to adapt to changes in illumination and angle.
It achieves efficient storage and fast retrieval, improves the success rate of feature matching and detection efficiency, meets the requirements of real-time detection, and provides millisecond-level query response speed and accurate crack detection results.
Smart Images

Figure CN121527006A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of building engineering safety monitoring technology, specifically to the application of computer vision and image recognition technology in building structure crack detection, and particularly to a building engineering crack detection method and system based on image recognition. Background Technology
[0002] Building safety monitoring is a crucial aspect of ensuring the safe use of buildings, and crack detection is a key indicator for assessing the structural health of buildings. With the development of computer vision and image processing technologies, automatic crack detection based on image recognition has become a research hotspot in the field of building safety monitoring.
[0003] Currently, building crack detection technologies mainly include traditional manual inspection methods and computer vision-based automated detection methods. Traditional manual inspection methods rely on professionals to periodically check and measure cracks using tools such as calipers; this method is highly subjective and inefficient. In contrast, computer vision-based methods automatically detect cracks through image processing algorithms, improving both efficiency and accuracy.
[0004] Existing image recognition-based crack detection technologies primarily employ image segmentation, edge detection, and deep learning methods for crack feature extraction and identification. These technologies preprocess acquired building surface images, extract crack features, and finally apply classification or detection algorithms to determine the location and severity of cracks. A typical implementation involves constructing a comprehensive crack image database and using a precise matching feature retrieval mechanism to compare and analyze newly acquired images.
[0005] However, existing technologies face two main problems: First, the amount of image data of cracks on building surfaces is enormous, and traditional precise matching indexing mechanisms require storing complete feature information, resulting in high storage pressure. Second, in practical applications, due to changes in factors such as lighting conditions and shooting angles, the image features of the same crack collected at different times or under different conditions deviate, leading to low efficiency in precise matching and making it difficult to meet the requirements of real-time detection. These problems severely restrict the application effect of image recognition-based crack detection technology in the monitoring of large-scale building complexes. Summary of the Invention
[0006] The purpose of this application is to provide a method and system for detecting cracks in building engineering based on image recognition, so as to solve the technical problems of high storage pressure and low real-time detection efficiency in the prior art.
[0007] To achieve the above objectives, this application provides the following technical solution: In a first aspect, embodiments of this application propose a method for detecting cracks in building engineering based on image recognition, comprising: The original image data of the building surface is acquired by the acquisition device, and the original image data is preprocessed sequentially to obtain a standardized building surface image. The standardized building surface image is decomposed into multiple scales, and edge features, texture features, and directional features are extracted from each scale image and integrated to obtain a multi-dimensional feature descriptor set. The importance of each dimension of the feature in the multidimensional feature descriptor set is evaluated. Based on the importance evaluation results, feature dimensionality reduction, feature quantization encoding, and feature vector compression are performed sequentially to obtain a compact feature vector. Based on the compact feature vector, the feature space is partitioned, a feature index structure is constructed, and the feature index structure is optimized, compressed, and constructed in a multi-level hierarchy to obtain the feature index mechanism. Acquire newly collected building surface images and extract corresponding compact feature vectors as query feature vectors. Dynamically adjust the tolerance threshold for feature matching based on the current detection environment and image quality. Perform approximate nearest neighbor search on the query feature vector using the feature indexing mechanism and the tolerance threshold. Perform multi-level filtering and verification on the retrieval results and sort them according to feature similarity to obtain a crack matching result set. Based on the crack matching result set, crack area is located and crack type is classified. The geometric parameters of the crack are measured and the severity of the crack is assessed. The location, type, geometric parameters and severity of the crack are integrated to obtain a crack status report. Based on the crack status report, a time-series analysis of historical crack data is performed to monitor crack development trends. A multi-level early warning mechanism is designed based on the crack status report and the crack development trends, and maintenance suggestions are provided to obtain a real-time monitoring and early warning system.
[0008] Secondly, embodiments of this application also provide an image recognition-based building crack detection system, comprising: The image acquisition module is used to acquire raw image data of the building surface through the acquisition device, and to preprocess the raw image data in sequence to obtain a standardized building surface image. The feature extraction module is used to perform multi-scale decomposition on the standardized building surface image, extract edge features, texture features and directional features on each scale image respectively, and integrate them to obtain a multi-dimensional feature descriptor set; The feature compression module is used to evaluate the importance of each dimension of the features in the multidimensional feature descriptor set, and based on the importance evaluation results, perform feature dimensionality reduction, feature quantization encoding and feature vector compression in sequence to obtain a compact feature vector. An index construction module is used to partition the feature space based on the compact feature vector, construct a feature index structure, and optimize, compress, and construct a multi-level hierarchy of the feature index structure to obtain a feature index mechanism. The crack matching module is used to acquire newly collected building surface images and extract the corresponding compact feature vectors as query feature vectors. Based on the current detection environment and image quality, the tolerance threshold for feature matching is dynamically adjusted. The feature indexing mechanism and the tolerance threshold are used to perform an approximate nearest neighbor search on the query feature vectors. The search results are filtered and verified at multiple levels and sorted according to feature similarity to obtain a crack matching result set. The crack analysis module is used to locate crack regions and classify crack types based on the crack matching result set, measure the geometric parameters of cracks and assess crack severity, and integrate the location, type, geometric parameters and severity of cracks to obtain a crack status report. The monitoring and early warning module is used to perform time-series analysis of historical crack data based on the crack status report to monitor crack development trends. Based on the crack status report and the crack development trend, a multi-level early warning mechanism is designed and maintenance suggestions are provided to obtain a real-time monitoring and early warning system.
[0009] Compared with the prior art, the beneficial effects of the embodiments of this application are as follows: This application's embodiments achieve efficient storage and retrieval of feature data by constructing compact feature vectors and a space-optimized feature indexing mechanism, saving storage space compared to traditional exact matching indexes; by designing a tolerance matching algorithm, it solves the feature deviation problem caused by factors such as changes in lighting and differences in shooting angles, improving the retrieval success rate; through a multi-level index hierarchy structure, it achieves millisecond-level query response speed, meeting the requirements of real-time detection. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0011] Figure 1 This is a flowchart illustrating the method for detecting cracks in building engineering as described in this application; Figure 2 This is a schematic diagram of the building crack detection system of this application. Detailed Implementation
[0012] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application.
[0013] Example 1 like Figure 1 As shown, this embodiment provides a method for detecting cracks in building engineering based on image recognition, including: S1. Acquire raw image data of the building surface through acquisition equipment, and preprocess the raw image data sequentially to obtain a standardized building surface image; S2. Perform multi-scale decomposition on the standardized building surface image, extract edge features, texture features and directional features from each scale image and integrate them to obtain a multi-dimensional feature descriptor set; S3. The importance of each dimension of the feature in the multidimensional feature descriptor set is evaluated. Based on the importance evaluation results, feature dimensionality reduction, feature quantization encoding and feature vector compression are performed in sequence to obtain a compact feature vector. S4. Based on the compact feature vector, the feature space is partitioned, a feature index structure is constructed, and the feature index structure is optimized, compressed, and constructed in a multi-level hierarchy to obtain the feature index mechanism. S5. Acquire newly collected building surface images and extract the corresponding compact feature vectors as query feature vectors. Dynamically adjust the tolerance threshold for feature matching based on the current detection environment and image quality. Perform approximate nearest neighbor search on the query feature vectors using the feature indexing mechanism and the tolerance threshold. Perform multi-level screening and verification on the retrieval results and sort them according to feature similarity to obtain a crack matching result set. S6. Based on the crack matching result set, locate the crack area and classify the crack type, measure the geometric parameters of the crack and assess the crack severity, integrate the location, type, geometric parameters and crack severity of the crack to obtain a crack status report. S7. Based on the crack status report, perform time-series analysis of historical crack data to monitor crack development trends. Design a multi-level early warning mechanism and provide maintenance suggestions based on the crack status report and crack development trends to obtain a real-time monitoring and early warning system.
[0014] Specifically, in the image acquisition and preprocessing stage, raw image data of the building surface is first acquired using acquisition equipment. This raw image data is then preprocessed sequentially to obtain a standardized image of the building surface. In practice, a high-resolution camera or an image sensor mounted on a drone is used to acquire images of the building surface, ensuring an image resolution of at least 1080P to guarantee the clear identification of crack details. Considering the complex environmental conditions in practical applications, the raw images are often affected by various factors, including changes in lighting, shooting angle deviations, and environmental noise. These interference factors can severely affect the accuracy of subsequent feature extraction and crack identification. Therefore, the preprocessing process is particularly important, and this process includes multiple steps such as noise reduction, contrast enhancement, geometric correction, and standardization. Noise reduction employs a bilateral edge-preserving filtering algorithm, effectively removing noise while retaining the sharp features of crack edges. Contrast enhancement utilizes adaptive histogram equalization, adjusting contrast for different local areas of the image, particularly suitable for uneven lighting on building surfaces. Geometric correction calculates the perspective transformation matrix by detecting reference points or lines, correcting tilted images to frontal views. Standardization uniformly adjusts the image size and brightness distribution, ensuring consistent format and quality across images acquired under different conditions. This series of preprocessing operations outputs high-quality, standardized building surface images, providing a reliable data foundation for subsequent feature extraction.
[0015] In the feature extraction stage, the standardized building surface image is decomposed into multiple scales. Edge features, texture features, and directional features are extracted from each scale and integrated to obtain a multi-dimensional feature descriptor set. This process fully considers the diverse characteristics of building cracks. Building cracks exhibit significant differences in morphology, scale, and direction, and features of a single scale or type are insufficient to comprehensively characterize the image properties of cracks. Therefore, the system employs a multi-scale feature extraction strategy, applying pyramid transform or wavelet transform to decompose the standardized image into multiple scales, generating image layers of different resolutions. Pyramid transform constructs an image pyramid through progressive downsampling, with each layer representing a different observation scale; wavelet transform decomposes the frequency components of the image through wavelet basis functions at different scales, providing information in both the time and frequency domains. Through multi-scale decomposition, various scale features, from minute cracks to severe cracks, can be captured. At various image scales, the system extracts three complementary features: edge features are extracted using edge detection operators such as Canny or Sobel, which accurately locate crack edges by calculating image gradients and performing non-maximum suppression; texture features are extracted using Local Binary Pattern (LBP) or Gray-Level Co-occurrence Matrix (GLCM) algorithms. LBP describes local texture patterns by encoding the gray-level relationships of pixel neighborhoods, while GLCM extracts texture parameters such as contrast, correlation, energy, and entropy by statistically analyzing the spatial distribution of pixel pairs; directional features are extracted using Gabor filters or Histogram of Oriented Gradients (HOG). Gabor filters are direction-selective, capable of extracting image structures in specific directions, while HOG describes shape features by statistically analyzing the gradient direction distribution of local regions. These three types of features characterize the image properties of cracks from different perspectives: edge features reflect the contour information of cracks, texture features reflect the pattern characteristics of crack regions, and directional features reflect the extension direction and orientation of cracks. Through methods such as feature concatenation, weighted fusion, or feature selection, these multi-type features extracted at multiple scales are integrated into a unified multi-dimensional feature descriptor set, forming a comprehensive and robust crack image representation.
[0016] In the feature compression stage, the importance of each dimension of the multidimensional feature descriptor set is evaluated. Based on the importance evaluation results, feature dimensionality reduction, feature quantization encoding, and feature vector compression are performed sequentially to obtain compact feature vectors. This stage is a key step in solving the storage pressure of large-scale crack databases. After multi-scale and multi-type feature extraction, the feature descriptor dimension corresponding to each image may reach hundreds or even thousands of dimensions, which not only occupies a large amount of storage space but also seriously affects the efficiency of feature retrieval. Therefore, the system first uses methods such as information gain or principal component analysis to evaluate the importance of each dimension of features and identify key features that contribute highly to crack identification. The information gain method evaluates importance by calculating the contribution of each feature to the classification result; the greater the information gain of a feature, the stronger its ability to distinguish cracks. The principal component analysis method evaluates importance by calculating the variance contribution rate of features; features with a high variance contribution rate contain more effective information. Based on the importance evaluation, the system uses dimensionality reduction algorithms such as principal component analysis (PCA), linear discriminant analysis (LDA), or t-SNE to map the high-dimensional feature space to a low-dimensional space. PCA projects the original features into a new orthogonal coordinate system through linear transformation. The new coordinate axes are arranged in descending order of variance contribution rate. By selecting the top k principal components, the feature dimensionality can be significantly reduced while retaining most of the information (e.g., 95% of the variance). LDA maximizes inter-class distance and minimizes intra-class distance while reducing dimensionality, making it more suitable for supervised classification tasks. t-SNE preserves the local structure of the data and is suitable for visualization and nonlinear dimensionality reduction. Dimensionality reduction not only reduces storage and computational overhead but also eliminates redundancy and correlation between features. Based on dimensionality reduction, the features are quantized and encoded, converting continuous-valued features into discrete codes. The quantization process divides the feature values into a finite number of discrete intervals (quantization levels), with each interval represented by a representative value; this process is similar to analog-to-digital conversion. Quantization encoding not only further compresses the feature representation but also introduces a certain degree of fault tolerance, ensuring that minor changes in features due to factors such as lighting and angle do not affect the encoding results in practical applications. Based on quantization encoding, the system uses hash encoding or binary encoding methods for final compression. Hash encoding maps high-dimensional features to low-dimensional hash codes using specially designed hash functions. Locality-Sensitive Hashing (LSH) ensures that similar features are mapped to the same or adjacent hash buckets. Binary encoding converts features into binary bit strings, where each bit represents a certain attribute of the feature, allowing for comparison using efficient bitwise operations. Through this series of compression operations, the original hundreds-dimensional floating-point features are compressed into compact feature vectors of tens to hundreds of bits, reducing storage space and laying the foundation for efficient feature retrieval.
[0017] In the index construction phase, the feature space is partitioned based on the compact feature vectors, a feature index structure is constructed, and the feature index structure is optimized, compressed, and constructed in a multi-level hierarchy to obtain the feature index mechanism. Traditional linear scanning retrieval methods are extremely inefficient in large-scale databases and cannot meet the requirements of real-time detection. To achieve fast retrieval, a strategy combining spatial partitioning and index structure is adopted. First, the system uses spatial partitioning algorithms such as KD-trees or ball trees to divide the feature space into multiple sub-regions. KD-trees divide the space into nested hyperrectangular regions by recursively selecting coordinate axes and partitioning along the median of those axes; ball trees divide the space by constructing nested hyperspheres, each containing a set of adjacent data points. The core idea of these spatial partitioning algorithms is to utilize the principle of locality of reference in space, enabling the rapid elimination of a large number of irrelevant candidate samples during retrieval, and searching only within sub-regions that may contain matching results. Based on spatial partitioning, the system uses algorithms such as Locality Sensitive Hash (LSH) or Fast Approximate Nearest Neighbor Search (FLANN) to construct a feature index structure that supports approximate matching. LSH (Local Nearest Neighbor) is an indexing technology specifically designed for near nearest neighbor search. Its core idea is to use a special hash function that ensures similar feature vectors are mapped to the same hash bucket with a high probability, while dissimilar feature vectors are mapped to different hash buckets. By constructing multiple sets of hash tables, LSH can significantly improve retrieval speed while maintaining high recall. Unlike exact matching, LSH supports tolerance matching, meaning that even if the query features deviate from the features in the database (e.g., due to changes in lighting or angle), they can still be successfully retrieved. This characteristic is particularly important for building crack detection. After constructing the initial index structure, further optimization and compression are performed to reduce storage space usage. Optimization includes several aspects: analyzing the distribution of hash buckets and adjusting hash function parameters to achieve a more balanced data distribution, avoiding overload in some hash buckets while others are idle; compressing redundant information in the index, such as using bitmaps and run-length encoding to compress hash bucket storage; and optimizing the memory layout of the index structure to improve cache hit rate. Based on these optimizations, the system constructs a multi-level index hierarchy to achieve progressive retrieval from coarse-grained to fine-grained. The multi-level index is similar to the table of contents of a book. The top-level index provides coarse-grained classification, while the bottom-level index provides fine-grained localization. In crack detection, the top-level index performs coarse classification based on the general type and location of the cracks, the middle-level index performs medium-grained partitioning based on the clustering results of feature vectors, and the bottom-level index is a detailed feature hash table. A progressive strategy is adopted during retrieval: first, relevant categories are quickly located at the top level, then the search is refined layer by layer to specific candidate sample sets, and finally, precise matching verification is performed. To support dynamic database updates, the system is designed with an incremental index update mechanism. Traditional batch updates require rebuilding the entire index structure, which is time-consuming and affects system availability.The incremental update mechanism, through the design of a dynamic insertion algorithm, allows new crack feature samples to be directly inserted into the existing index structure, requiring only local adjustments to the relevant hash buckets and index nodes. Specifically, it includes: reserving a certain amount of expansion space for each hash bucket to support dynamic insertion; periodically splitting and reorganizing overloaded hash buckets; and maintaining index version information to support concurrent read and write operations. These techniques construct a space-optimized feature indexing mechanism, achieving millisecond-level query response speeds.
[0018] In the crack matching stage, newly acquired building surface images are obtained, and corresponding compact feature vectors are extracted as query feature vectors. The tolerance threshold for feature matching is dynamically adjusted based on the current detection environment and image quality. An approximate nearest neighbor search is performed on the query feature vector using the feature indexing mechanism and the tolerance threshold. The search results are then subjected to multi-level filtering and verification, and sorted according to feature similarity to obtain a crack matching result set. This stage is crucial for comparing the image to be detected with a historical crack database. First, the newly acquired building surface images undergo the same processing flow as historical samples, including noise reduction, contrast enhancement, geometric correction, standardization, multi-scale feature extraction, feature dimensionality reduction, quantization encoding, and vector compression, generating query feature vectors. Consistency in the processing flow is essential for ensuring feature comparability; any difference in processing steps can lead to feature deviations and affect matching accuracy. Before performing the search, the tolerance threshold for feature matching is dynamically calculated based on the current detection environment parameters and image quality indicators. The tolerance threshold is a key parameter controlling the precision and recall of approximate matching. Under ideal conditions (sufficient lighting, correct shooting angle, and clear image), a smaller tolerance threshold can be used to improve matching precision; however, under complex conditions (uneven lighting, tilted shooting angle, and blurred image), a larger tolerance threshold is needed to ensure recall. Dynamic calculation is based on multiple factors: detection environment parameters include light intensity, weather conditions, and shooting distance; image quality indicators include image sharpness, contrast, and signal-to-noise ratio. By establishing a mapping relationship between the tolerance threshold and these parameters, the tolerance threshold can be adaptively adjusted to achieve optimal retrieval performance in different application scenarios. After determining the tolerance threshold, an approximate nearest neighbor search is performed using the constructed feature index mechanism. The search process consists of multiple stages: first, the relevant index partitions are quickly located in the top-level index based on the coarse classification of the query features; then, the candidate range is further narrowed in the middle-level index; finally, in the bottom-level LSH hash table, the hash value of the query feature vector is calculated, and all candidate samples in the corresponding hash bucket and its neighboring buckets (the neighboring range is determined by the tolerance threshold) are retrieved. Thanks to the use of compact feature vectors and an optimized index structure, the entire search process can be completed in milliseconds, even with a database containing millions of crack samples. Initial matching results may contain a certain proportion of mismatches; the system improves accuracy through multi-level filtering and verification. The first level of filtering is a coarse distance filter, calculating the Hamming or Euclidean distance between the query feature vector and the candidate sample feature vectors, and discarding samples whose distance exceeds a tolerance threshold. The second level of filtering is geometric consistency verification; for suspected matches, key points in the original image are extracted and geometrically transformed for verification to confirm whether the spatial relationships of the cracks are consistent. The third level of filtering is visual verification; for highly similar candidate samples, local region comparisons of the original images can be performed to confirm whether the visual features of the cracks match.Multi-level screening employs a coarse-to-fine strategy, ensuring both accuracy and controlled computational cost. The verified matching results are sorted based on feature similarity, which can be calculated in several ways: for binary feature vectors, the reciprocal of the Hamming distance or Jaccard similarity is used; for floating-point feature vectors, cosine similarity or normalized Euclidean distance is used. Matching samples with higher similarity are ranked higher, indicating a closer resemblance to the crack in the query image. The final output crack matching result set is arranged from highest to lowest similarity, and each matching result contains complete information such as the matching sample's feature vector, original image, crack location, and crack type.
[0019] In the status assessment phase, crack regions are located and crack types are classified based on the crack matching result set. The geometric parameters of the cracks are measured, and the severity of the cracks is assessed. The location, type, geometric parameters, and severity of the cracks are integrated to obtain a crack status report. This phase transforms the matching results into a meaningful detection report. Crack region localization involves precise pixel-level segmentation guided by the matching results. First, the approximate location information provided by the matching results is used to locate the region of interest in the newly acquired image. Then, a refined image segmentation algorithm is applied within this region. Commonly used segmentation methods include threshold-based segmentation, region-growing-based segmentation, and active contour model-based segmentation. For cracks in complex backgrounds, deep learning-based semantic segmentation methods can also be combined for precise segmentation. The segmentation results undergo morphological processing, such as opening operations to remove noise and closing operations to fill holes, resulting in continuous and smooth crack boundaries. The final output pixel-level boundaries are represented as coordinate sequences or binary masks. Based on the pixel-level boundaries, crack types are classified according to their morphological characteristics. Building cracks can be classified into various types based on their morphology: linear cracks, network cracks, radial cracks, and crazing, etc. Different types of cracks typically correspond to different causes and degrees of damage. The classification process extracts morphological features of cracks, such as aspect ratio, curvature, number of branches, and connectivity, and automatically identifies crack types using classification rules or models. Based on type classification, the system measures the geometric parameters of the cracks, including length, width, and area. The measurement process first extracts the crack skeleton line based on pixel-level boundaries, then calculates the geometric parameters: crack length is obtained by summing the lengths of all segments on the skeleton line; crack width is obtained by calculating the distance between boundaries perpendicular to the skeleton line, typically calculating the average and maximum width; crack area is obtained by counting the number of pixels within the boundary. Since the measurement results in the image are in pixel units, the system converts them to physical units through a calibration process. This conversion depends on the image resolution and shooting distance. Calibration can be performed by placing markers of known size in the image, or by calculating the ratio between pixels and actual sizes using camera calibration parameters and shooting distance. Based on the geometric parameters and location information, the system assesses the severity of the cracks and classifies them into risk levels. The assessment process comprehensively considers multiple factors: the larger the geometric parameters of the crack, the higher its severity generally is; the location of the crack is also important, with cracks located on load-bearing structures posing a greater risk than those in non-load-bearing areas; the type of crack also affects severity, for example, through cracks are more dangerous than surface cracks. A comprehensive assessment is conducted using rule-based systems, fuzzy logic, or machine learning methods to classify risk levels into low, medium, high, and critical risk levels. Finally, the location information, type labels, geometric parameter data, and risk level of the cracks are integrated to generate a structured crack status report. The report includes complete detection results and visualizations, providing authoritative technical support for building safety management.
[0020] In the monitoring and early warning phase, time-series analysis of historical crack data based on the crack status report is performed to monitor crack development trends. A multi-level early warning mechanism is designed based on the crack status report and crack development trends, and maintenance suggestions are provided, resulting in a real-time monitoring and early warning system. This phase extends single-detection to continuous monitoring, achieving dynamic tracking of crack status. All historical records related to the currently monitored crack are extracted from the historical crack status report database and organized into a time-series crack dataset in chronological order of detection. The time-series dataset records the complete evolution of the crack from its initial discovery to the most recent detection, including changes in parameters such as length, width, and area over time. Based on the time-series dataset, time series analysis methods are used to calculate the rate of change and trend of crack geometric parameters. Analysis methods include trend analysis, rate of change calculation, periodic analysis, and predictive models, which can identify whether the crack is stable, slowly growing, or rapidly deteriorating, and predict possible future values of crack parameters, providing forward-looking support for decision-making. Based on the current status and development trend, the system designs a multi-level early warning mechanism including primary, intermediate, and advanced early warning levels. Basic warnings target low-risk cracks with a tendency to worsen, recommending increased monitoring frequency; intermediate warnings target moderately risky or rapidly developing cracks, recommending professional inspection and assessment and preparation of repair plans; advanced warnings target high-risk or rapidly deteriorating cracks, requiring immediate temporary reinforcement measures. When the crack status meets the triggering conditions of the warning rules, the system automatically generates warning information and sends it to relevant personnel through multiple channels, while simultaneously generating targeted maintenance recommendations based on the crack type, location, and severity. The system establishes a real-time monitoring process, continuously updating crack status data through regular automatic detection and on-demand manual detection, providing a visual monitoring dashboard to display the status of all monitored cracks in real time, supporting multi-user collaborative work, and completing a full closed loop for the building engineering crack detection system.
[0021] As one implementation method, based on the original image data, a bilateral filtering algorithm is used for noise reduction, which removes noise while preserving image edge information to obtain a denoised image. Based on the denoised image, an adaptive histogram equalization algorithm is used to improve image contrast and enhance the distinction between cracks and background to obtain a contrast-enhanced image. Based on the contrast-enhanced image, geometric correction is performed to eliminate perspective distortion to obtain a geometrically corrected image. Based on the geometrically corrected image, size and brightness normalization processing is performed to obtain the standardized building surface image.
[0022] Specifically, firstly, based on the original image data, a bilateral filtering algorithm is used for noise reduction, preserving image edge information while removing noise, resulting in a denoised image. In practical applications, the acquisition of building surface images often faces complex environmental conditions, and the original image is inevitably contaminated by various noises. These noises come from a wide range of sources, including electronic noise from the camera sensor itself, optical noise caused by fluctuations in ambient light, and channel noise during wireless transmission. The presence of noise can blur crack edges, interfere with feature extraction, and may even lead to the misidentification of noise points as cracks or the submergence of real cracks in noise. Therefore, noise reduction is the primary task of preprocessing. However, there is an inherent contradiction between noise reduction and edge preservation: traditional smoothing filtering methods such as mean filtering and Gaussian filtering blur edges while removing noise; while edge-preserving filters such as median filtering can preserve edges well, their effect on removing Gaussian noise is limited. The bilateral filtering algorithm cleverly solves this contradiction. It is a nonlinear filtering method that considers the similarity between the spatial domain and the value domain. Specifically, when calculating the output pixel value, the bilateral filter considers not only the spatial distance between neighboring pixels (similar to traditional Gaussian filtering) but also the difference in grayscale values between neighboring pixels and the center pixel. Pixels with closer spatial distances have higher weights—this is the effect of the spatial domain; pixels with similar grayscale values have higher weights—this is the effect of the value domain. In smooth regions, the grayscale values of neighboring pixels are similar to those of the center pixel, and the bilateral filter performs a smoothing effect similar to Gaussian filtering, effectively removing noise. In edge regions, the grayscale values of pixels on both sides of the edge differ greatly. Even if they are close in space, the large difference in value domain results in low weights, thus preserving the edge. For crack detection, the crack edge is the most important feature. Bilateral filtering can effectively remove environmental factors and equipment noise interference while preserving the sharp features of the crack edge, providing a high-quality image foundation for subsequent edge detection and feature extraction. In practical implementation, the effect of bilateral filtering is affected by two parameters: the spatial domain standard deviation and the value domain standard deviation. These two parameters are adaptively adjusted according to the noise level and texture complexity of the image to achieve the best noise reduction effect.
[0023] After noise reduction, an adaptive histogram equalization algorithm is used to improve image contrast based on the denoised image, enhancing the distinction between cracks and the background, resulting in a contrast-enhanced image. Contrast is a key factor affecting crack visibility; insufficient contrast makes it difficult to distinguish cracks from the background, especially under uneven lighting or when materials are similar in color. The actual shooting environment for building surfaces is complex and variable, with lighting conditions often being less than ideal: outdoor shooting, direct sunlight can cause overexposure in highlight areas and underexposure in shadow areas; indoor shooting may involve uneven artificial lighting with obvious bright-dark zones; and shooting on cloudy days or at dusk results in insufficient overall illumination and low image contrast. Traditional histogram equalization methods enhance contrast by redistributing the image's grayscale histogram, ensuring a uniform distribution of grayscale values across the entire possible range. However, global histogram equalization has significant drawbacks: using the same transformation function across the entire image fails to adapt to local image characteristics; in images with uneven lighting, global equalization may lead to over-enhancing bright areas and under-enhancing dark areas, or vice versa; for areas with already high contrast, global equalization may result in over-enhancing, producing an unnatural visual effect. Contrast Limited Adaptive Histogram Equalization (CLAHE) overcomes these shortcomings by dividing the image into multiple small local regions (called patches), performing histogram equalization on each patch separately, and then smoothly connecting the boundaries of the patches through bilinear interpolation, avoiding block artifacts. This localized processing strategy allows CLAHE to employ different enhancement strategies for different regions of the image, making it particularly suitable for uneven lighting on building surfaces. Furthermore, CLAHE introduces a contrast limiting mechanism to prevent over-enhancement by limiting the maximum height of the histogram. In practical applications, for dark cracks on light backgrounds (such as cracks on concrete surfaces), CLAHE can enhance the contrast of dark areas, making the cracks clearer; for light cracks on dark backgrounds (such as cracks formed by paint peeling), CLAHE can enhance the details of bright areas, making the crack features stand out. Through adaptive contrast enhancement, the distinction between cracks and the background is effectively improved, creating favorable conditions for subsequent crack detection.
[0024] After contrast enhancement, geometric correction is performed on the contrast-enhanced image to eliminate perspective distortion, resulting in a geometrically corrected image. Geometric correction addresses the problem of distorted object shapes in images, primarily stemming from deviations in the shooting angle. Ideally, the camera's optical axis should be perpendicular to the building surface, resulting in an orthogonal projection of the surface and accurately reflecting the object's shape and size. However, in practical applications, especially for high-rise buildings or inaccessible locations, achieving perfectly perpendicular shooting is often impractical. When using drones, due to flight limitations, the camera typically shoots from a certain angle (either overhead or under); handheld shooting makes precise angle control even more difficult. Deviations in the shooting angle cause perspective distortion: parallel lines no longer converge at a point in the image, rectangular planes are distorted into trapezoids, and the actual dimensions of objects are warped. For crack detection, perspective distortion leads to inaccurate measurements of crack length and width, distorted crack morphology, and may even misclassify straight cracks as curved ones. The purpose of geometric correction is to convert perspective projection into orthogonal projection through mathematical transformation, restoring the object's true shape. The core of geometric correction is calculating the perspective transformation matrix. Common methods include reference-mark-based methods and image feature-based methods. Reference-mark-based methods place markers (such as rectangular calibration plates) of known geometric shape and size on the building surface, detect the positions of these markers in the image, and calculate the perspective transformation matrix based on the actual coordinates of the markers and the image coordinates. Image feature-based methods utilize the building's own geometric features, such as window frames and tile joints. These features are typically straight lines or rectangles in three-dimensional space and can serve as references for correction. Straight-line features are detected in the image, and the perspective transformation matrix is calculated using the parallelism and orthogonality constraints of the lines. The perspective transformation is a 3×3 matrix with 8 degrees of freedom, theoretically requiring at least 4 pairs of corresponding points to solve. After calculating the transformation matrix, it is applied to each pixel in the image to obtain the corrected image. Geometric correction not only restores the true shape of the crack but also provides the prerequisite for accurately measuring the crack's geometric parameters, ensuring that subsequent measurements of parameters such as length and width accurately reflect the crack's physical state.
[0025] Finally, based on the geometrically corrected image, size and brightness normalization are performed to obtain the normalized building surface image. Normalization is the final step in preprocessing, aiming to unify the format and quality of images acquired under different conditions, ensuring consistency and stability in subsequent processing. Size normalization addresses the issue of image resolution differences. In practical applications, due to the use of different acquisition devices, shooting distances, or image transmission methods, the resolution of acquired images may vary. High-resolution images contain more detailed information but require more storage space and computing resources; low-resolution images, while faster to process, may lose important detailed features. Feature extraction algorithms often have specific requirements for the size of the input image; for example, convolutional neural networks require images of a fixed size. Size normalization adjusts all images to a preset standard size through image scaling, such as 1024×1024 pixels or 512×512 pixels. The scaling process uses high-quality resampling methods such as bilinear interpolation or bicubic interpolation to preserve image details as much as possible and avoid jagged edges or blurring. For images larger than the standard size, downsampling is performed to reduce their size; for images smaller than the standard size, upsampling is performed to enlarge them; for images with aspect ratios inconsistent with the standard ratio, padding or cropping strategies can be used. Brightness normalization addresses the issue of overall brightness and contrast differences in an image. Although adaptive contrast enhancement has already been performed, the overall brightness distribution of different images may still vary significantly. Brightness normalization, through normalization, remaps the image's grayscale values to a uniform range. Common methods include linear normalization and non-linear normalization. Linear normalization maps the minimum grayscale value to 0, the maximum grayscale value to 255 (for 8-bit images), and intermediate values to a linear relationship; non-linear normalization performs non-linear mapping based on the image's histogram distribution, such as gamma correction, which can adjust the overall brightness bias of the image. Brightness normalization ensures that images captured under different conditions have similar grayscale distribution characteristics, eliminating the influence of differences in illumination intensity, and enabling feature extraction algorithms to operate stably. By standardizing both size and brightness, images that have undergone noise reduction, contrast enhancement, and geometric correction are transformed into standardized building surface images with uniform format and stable quality, providing reliable data input for subsequent multi-scale feature extraction and crack identification.
[0026] As one implementation method, based on the standardized building surface image, multi-scale decomposition is performed using pyramid transform or wavelet transform to obtain image representations at different scales; based on the image representations at different scales, edge detection operators are applied to extract possible crack edge features to obtain an edge feature map; based on the image representations at different scales, local binary mode or gray-level co-occurrence matrix algorithm is applied to extract texture features to obtain a texture feature representation; based on the image representations at different scales, Gabor filter or histogram of oriented gradients is used to extract the directional features of cracks to obtain a directional feature representation; based on the edge feature map, the texture feature representation, and the directional feature representation, multi-scale fusion and integration are performed to obtain the multi-dimensional feature descriptor set.
[0027] Specifically, firstly, based on the standardized building surface image, multi-scale decomposition is performed using pyramid transform or wavelet transform to obtain image representations at different scales. Multi-scale decomposition is a key technique for handling the scale diversity of building cracks. The width of building cracks ranges extremely widely, from micro-cracks of 0.1 mm to severe cracks of several centimeters, spanning more than two orders of magnitude; the length ranges even further, from local cracks of a few centimeters to long-distance cracks that penetrate the entire wall surface. In a fixed-resolution image, a micro-crack may occupy only a few pixels, while a severe crack may occupy tens of pixels. Single-scale feature extraction is difficult to handle cracks of different widths: algorithm parameters designed for micro-cracks may not be effective in detecting wide cracks, and vice versa. Multi-scale decomposition generates image representations at different resolutions, ensuring that cracks of different widths are fully represented at a certain scale. Pyramid transform is a classic multi-scale decomposition method that constructs an image pyramid structure through progressive downsampling. Gaussian pyramids are the most commonly used pyramid type, where each layer of the image is obtained by applying Gaussian filtering (smoothing) and downsampling (scaling down) to the image of the previous layer. Each layer of a Gaussian pyramid represents a different observation scale. The bottom layer (the original image) provides the highest spatial resolution, suitable for detecting minute cracks; the top layer provides the lowest spatial resolution but the largest field of view, suitable for detecting the overall direction of large-scale cracks. The Laplacian pyramid is another important type of pyramid, obtained by calculating the difference between adjacent layers of the Gaussian pyramid, highlighting the image's detail information at different scales. For building crack detection, the system typically constructs a 3-5 layer image pyramid, with each layer having half the resolution of the previous layer. Wavelet transform is another powerful multi-scale decomposition tool, decomposing the image's frequency components using wavelet basis functions at different scales. Unlike Fourier transform, which only provides frequency domain information, wavelet transform provides information in both the time (spatial) and frequency domains, enabling the analysis of local image characteristics at different scales. Commonly used wavelets include the Haar wavelet, Daubechies wavelet, and Symlet wavelet. Wavelet transform decomposes an image into low-frequency components (approximate components) and high-frequency components (detail components). The low-frequency components reflect the overall structure of the image, while the high-frequency components reflect the image's edges and texture details. Multi-level wavelet decomposition can obtain approximate and detail components at different scales, which correspond to crack features at different scales. In practical applications, an appropriate decomposition method and number of decomposition levels are selected based on the expected scale range of the crack and the image resolution to ensure that multi-scale decomposition can cover all possible crack scales.
[0028] Based on multi-scale decomposition, edge detection operators are applied to extract possible crack edge features according to the image representation at different scales, resulting in an edge feature map. An edge is a location in an image where the grayscale value changes significantly, corresponding to abrupt changes in the object's contour or surface properties. The most prominent feature of architectural cracks in images is their edge characteristics: cracks show a clear difference in grayscale value from intact surfaces, typically appearing as dark lines or bands that contrast strongly with the surrounding light background. Edge detection operators identify edge locations by calculating the image's grayscale gradient. The Canny edge detection operator is one of the most commonly used edge detection methods. It extracts edges through the following steps: first, a Gaussian filter is used to smooth the image to reduce noise; then, the magnitude and direction of the image gradient are calculated, with locations of large gradient magnitudes corresponding to edges with drastic grayscale changes; next, non-maximum suppression is performed, retaining local maxima along the gradient direction while suppressing other points, thus refining the edges; finally, a dual-threshold method and edge-connection technique are used to classify edges into strong edges, weak edges, and non-edges based on two thresholds, retaining strong edges and also preserving weak edges connected to strong edges, forming continuous edges. The Canny operator can detect strong edges in an image and improve edge continuity through hysteresis thresholding and edge connectivity mechanisms, making it very suitable for extracting the main contour of cracks. The Sobel operator is another classic edge detection operator. It uses two 3×3 convolutional kernels to calculate the gradients in the horizontal and vertical directions respectively, and then combines them to obtain the gradient magnitude and direction. The Sobel operator is computationally simple and efficient, and has a certain smoothing effect on noise, but the detected edges are relatively coarse, and its localization accuracy is not as good as the Canny operator. In a multi-scale framework, edge detection operators are applied to images at different scales. At high-resolution layers (bottom pyramid or original wavelet components), edge detection can extract the precise contours of subtle cracks; at low-resolution layers (top pyramid or low-frequency wavelet components), edge detection can extract the overall direction of the main crack and filter out interference from detailed textures. By extracting and integrating edge features at multiple scales, a complete edge feature map can be formed, containing all edge information from subtle cracks to the main crack. The edge feature map is an important basis for subsequent crack localization and classification, providing a foundation for accurately extracting crack contours and measuring crack geometric parameters.
[0029] In addition to edge features, based on the image representations at different scales, texture features are extracted using Local Binary Pattern (LBP) or Gray-Level Co-occurrence Matrix (GLCM) algorithms to obtain texture feature representations. Texture is the spatial distribution pattern of gray values in an image, reflecting the material and structural characteristics of an object's surface. Cracked areas on building surfaces differ significantly in texture from intact areas: intact building surfaces typically exhibit regular, uniform texture patterns, such as the arrangement of bricks in a brick wall, a regular array of ceramic tiles, and the uniform texture of concrete; while cracked areas disrupt this regularity, exhibiting irregular, directional texture patterns, with features such as the direction, branching, and intersection of cracks reflected in the texture. Texture features can capture these subtle pattern differences, enhancing the robustness of crack detection, especially playing a crucial role in crack recognition against complex backgrounds. Local Binary Pattern (LBP) is a classic texture description method that generates binary codes by comparing the gray values of the central pixel with those of its neighboring pixels. The basic LBP operator selects a 3×3 neighborhood, using the gray value of the center pixel as a threshold. Positions in the neighborhood with gray values greater than or equal to the center pixel are encoded as 1, and positions with gray values less than the center pixel are encoded as 0, resulting in an 8-bit binary number. This binary number reflects the local gray-level distribution pattern and is robust to changes in illumination. Extended forms of LBP include circular LBP, rotation-invariant LBP, and uniform LBP, adaptable to different application requirements. Circular LBP samples neighborhood points on a circle of arbitrary radius, improving scale adaptability; rotation-invariant LBP uses cyclic shifting to find the smallest binary number as a feature, eliminating the influence of rotation; uniform LBP only considers patterns where the number of 0-1 transitions in the binary pattern does not exceed 2, effectively reducing feature dimensionality. For crack detection, the LBP operator is applied to extract local texture patterns in the crack and background regions. Due to the irregularity of gray-level distribution in the crack region, a different LBP pattern distribution will be generated compared to the background region. Gray-Level Co-occurrence Matrix (GLCM) is another important texture analysis tool. It describes texture by statistically analyzing the frequency of occurrence of pixel pairs with specific spatial relationships in an image. A GLCM is a two-dimensional matrix where rows and columns correspond to gray levels in the image. Matrix element (i, j) records the number of times a pixel with gray level i appears simultaneously with a pixel with gray level j at a certain direction and distance. By calculating GLCMs at different directions (e.g., 0°, 45°, 90°, 135°) and distances, various texture feature parameters can be extracted, including contrast (reflecting image sharpness and texture depth), correlation (reflecting the similarity of GLCM elements along row or column directions), energy (reflecting the uniformity of gray level distribution and texture coarseness), and entropy (reflecting the randomness and complexity of image texture). In a multi-scale framework, LBP and GLCM algorithms are applied to images at various scales to extract texture features.Texture features at different scales reflect the texture patterns of cracks at different observation granularities: fine-scale texture features capture subtle texture changes at the crack edges, while coarse-scale texture features reflect the overall texture characteristics of the crack region. By integrating multi-scale texture features, the texture features of cracks can be comprehensively described, providing strong support for distinguishing cracks from other texture patterns (such as decorative textures, material joints, etc.).
[0030] Furthermore, based on the image representations at different scales, Gabor filters or histograms of oriented gradients are used to extract the directional features of the cracks, resulting in directional feature representations. Directionality is one of the important characteristics of building cracks; cracks typically extend along a dominant direction, forming linear or curved structures. Cracks of different causes have different directional characteristics: cracks caused by building settlement are usually vertical or oblique; cracks caused by temperature stress may be horizontal; and network cracks formed by the combined effects of multiple factors contain crack branches in multiple directions. Directional features can effectively distinguish different types of cracks and differentiate them from other linear structures (such as brick joints, decorative lines, etc.). A Gabor filter is a filter with direction selectivity and frequency selectivity, and its shape is similar to the receptive field of a simple cell in the human visual system. A Gabor filter is the product of a Gaussian function and a sine function; by adjusting the parameters, the direction, frequency, bandwidth, and other characteristics of the filter can be controlled. Gabor filters have a strong response to image structures with specific directions and frequencies, while their response to structures with other directions and frequencies is weaker. In crack detection, the system constructs a set of Gabor filters in different directions (e.g., 0°, 30°, 60°, 90°, 120°, 150°) to cover all possible crack directions. Applying these filters to an image, each filter outputs a response image; the amplitude of the response image reflects the structural strength of the original image in that direction. By analyzing the distribution of Gabor responses in each direction, directional features such as the dominant direction and directional concentration of the crack can be extracted. For linear cracks in a single direction, a strong response will be generated on the Gabor filter in that specific direction; for mesh-like cracks, strong responses will be generated on filters in multiple directions. Histogram of Oriented Gradients (HOG) is another method for describing directional features, describing shape and structural characteristics by statistically analyzing the gradient direction distribution in local regions of the image. The HOG calculation process includes: first, calculating the gradient magnitude and direction of the image; then, dividing the image into multiple small cells, calculating the histogram of the gradient direction within each cell, quantizing the gradient direction into several directional channels (e.g., 9 channels, each covering 20°), and weighting each directional channel according to the gradient magnitude; next, grouping several adjacent cells into a block, and normalizing the gradient histogram of each cell within the block to eliminate the influence of illumination changes; finally, concatenating the normalized histograms of all blocks to form the HOG feature vector. HOG features can effectively capture the shape and direction information of cracks and have good robustness to illumination changes and small-scale geometric transformations. Within a multi-scale framework, Gabor filters and the HOG algorithm are applied to images at various scales to extract directional features.Directional features at different scales reflect the directional characteristics of cracks at different observation granularities: fine-scale directional features capture subtle changes in the local orientation of cracks, while coarse-scale directional features reflect the overall extension direction of cracks. By integrating multi-scale directional features, the directional characteristics of cracks can be comprehensively described, providing an important basis for crack type classification and causal analysis.
[0031] Finally, based on the edge feature map, texture feature representation, and directional feature representation, multi-scale fusion and integration are performed to obtain the multi-dimensional feature descriptor set. Feature fusion is the process of organically integrating the various types and scales of features extracted earlier, with the aim of constructing a comprehensive feature representation with low redundancy and strong discriminative power. Edge features, texture features, and directional features characterize the image properties of cracks from different perspectives, exhibiting both complementarity and a certain degree of redundancy. Edge features reflect the contour information of cracks, providing precise localization but being sensitive to noise; texture features reflect the pattern characteristics of crack regions, offering strong robustness but less precise spatial localization; directional features reflect the extension direction and orientation of cracks, providing strong discriminative power for crack types. Multi-scale features provide crack information at different granularities: fine-scale features provide rich detail information, suitable for precise localization; coarse-scale features provide overall structural information, suitable for identifying large-scale crack patterns. Feature fusion employs various strategies. Concatenation fusion is the simplest method, connecting the various feature vectors end-to-end to form a long vector. While simple to implement, this method may result in excessively high feature dimensionality. Weighted fusion assigns different weights based on the importance of each feature, combining the weighted features. The weights can be set using prior knowledge or automatically determined through learning methods. Feature selection chooses the most discriminative subset from all candidate features, ranking them using feature evaluation methods (such as information gain, chi-square test, correlation analysis, etc.) and selecting the top-ranked features.
[0032] As one implementation method, based on the features of each dimension in the multidimensional feature descriptor set, information gain or principal component analysis is used to evaluate their importance, resulting in a feature importance score. According to the feature importance score, principal component analysis is used to map the multidimensional feature descriptor set from a high-dimensional feature space to a low-dimensional space, minimizing the feature dimension while retaining key identification information, resulting in a dimensionality-reduced feature representation. Based on the dimensionality-reduced feature representation, quantization encoding is performed, converting continuous-value features into discrete codes, resulting in a quantized feature code. Based on the quantized feature code, hash encoding or binary encoding is used for further compression, resulting in a compressed feature representation. Based on the compressed feature representation, integration is performed to obtain the compact feature vector.
[0033] Specifically, firstly, based on the features in each dimension of the multidimensional feature descriptor set, information gain or principal component analysis methods are used to assess their importance, resulting in a feature importance score. Feature importance assessment is the first step in feature compression and a prerequisite for ensuring that key information is not lost during the compression process. In the multidimensional feature descriptor set, different dimensions of features contribute differently to crack identification: some feature dimensions contain rich discriminative information and have a decisive impact on the identification results; others contain less effective information, or may even be redundant or noise-dominated. Indiscriminately compressing all features may lead to the loss of key information; however, if key features can be identified and protected during the compression process, identification performance can be maintained while significantly reducing feature dimensions. Information gain is a commonly used feature importance assessment method, derived from information theory and decision tree theory. Information gain measures the degree to which a feature reduces classification uncertainty. The specific calculation process is as follows: First, calculate the initial entropy of the dataset. Entropy reflects the uncertainty of the classification result; the higher the entropy, the more chaotic the classification. Then, for each feature, calculate the conditional entropy under that feature condition, which is the weighted average of the entropies of the subsets after dividing the dataset according to the feature's value. Finally, subtract the conditional entropy from the initial entropy to obtain the information gain of the feature. A higher information gain indicates a greater effect of the feature on reducing classification uncertainty, meaning a stronger ability to distinguish cracks. For building crack detection, features that can effectively distinguish cracks from the background and differentiate between different types of cracks will have higher information gain values. By calculating the information gain of all feature dimensions, the system can rank features by importance and identify key features that contribute significantly to crack identification. Principal component analysis (PCA) evaluates feature importance from another perspective by calculating the variance contribution rate of a feature to measure the amount of information it contains. Features with high variance mean that the feature varies widely across different samples and provides more discriminative information; features with low variance mean that the feature does not vary much across different samples and provides limited discriminative information. Principal component analysis (PCA) transforms the original feature space into a new orthogonal coordinate system by calculating the eigenvalues and eigenvectors of the feature covariance matrix. The new coordinate axes (principal components) are arranged in descending order of variance contribution rate. The first principal component corresponds to the largest eigenvalue and contains the largest variance in the data; the second principal component corresponds to the second largest eigenvalue and contains the largest variance in the direction orthogonal to the first principal component; and so on. By analyzing the variance contribution rate of each principal component, the contribution of each original feature to the principal components can be determined, thereby assessing the importance of the original features. Features with high variance contribution rates are the main drivers of data variation and contain more effective information. In practical applications, information gain and PCA can be used together to evaluate feature importance from both supervised and unsupervised learning perspectives.For labeled data (where it's known whether it's a crack, the crack type, etc.), information gain directly reflects the classification ability of a feature. For unlabeled data or situations requiring unsupervised analysis, principal component analysis can reveal the data's inherent structure. These evaluation methods calculate an importance score for each feature dimension. This score provides a scientific basis for subsequent feature dimensionality reduction, ensuring that important features are prioritized during the reduction process and avoiding the loss of crucial information due to blind dimensionality reduction.
[0034] Based on the feature importance assessment, and according to the feature importance score, principal component analysis (PCA) is used to map the multidimensional feature descriptor set from a high-dimensional feature space to a low-dimensional space. This minimizes the feature dimensionality while preserving key identification information, resulting in a dimensionality-reduced feature representation. Dimensionality reduction is the core step in feature compression, aiming to reduce the feature dimensionality to a manageable range while preserving as much original feature information as possible. PCA is the most commonly used linear dimensionality reduction method, and its mathematical principles are based on linear algebra and statistics. The calculation process of principal component analysis includes the following steps: First, the original feature data is centered by subtracting the mean of each feature dimension, so that the center of the data is located at the origin. Then, the covariance matrix of the centered data is calculated. The covariance matrix reflects the correlation between different feature dimensions; the diagonal elements are the variances of each feature dimension, and the off-diagonal elements are the covariances between different feature dimensions. Next, eigenvalue decomposition or singular value decomposition is performed on the covariance matrix to obtain eigenvalues and corresponding eigenvectors. The magnitude of the eigenvalue reflects the variance contribution rate of the corresponding principal component, and the eigenvectors define the direction of the principal component. Then, the eigenvectors are sorted from largest to smallest eigenvalue, and the top k eigenvectors are selected to form a projection matrix. Finally, the original feature data is projected onto the subspace spanned by these k eigenvectors to obtain the dimensionality-reduced feature representation. The dimensionality-reduced feature dimension is k, which is much smaller than the original feature dimension. However, since the k principal components with the largest variance contribution rates are selected, these k features can retain most of the information in the original data. In practical applications, the choice of k is a trade-off: too small a k may lead to significant information loss, affecting recognition performance; too large a k may result in insignificant dimensionality reduction while still incurring substantial storage and computational costs. Common k-value selection strategies include: setting a cumulative variance contribution rate threshold (e.g., 95% or 99%), and selecting the minimum k value that makes the cumulative variance contribution rate reach that threshold; plotting a variance contribution rate curve (crush plot), and selecting the k value corresponding to the obvious inflection point of the curve; evaluating recognition performance under different k values through methods such as cross-validation, and selecting the k value with optimal performance. For building crack detection, the original feature dimension may be as high as hundreds or even thousands of dimensions. Dimensionality reduction through principal component analysis can typically compress the feature dimension to tens of dimensions (e.g., 30-50 dimensions) while retaining more than 95% of the original information. The dimensionality-reduced feature representation not only significantly reduces storage and computational costs but also eliminates redundancy and correlation between features. Highly correlated feature dimensions may exist in the original features; these redundant features not only increase the feature dimension but may also lead to overfitting problems in subsequent machine learning processes. Principal component analysis (PCA) transforms the original feature space into an orthogonal principal component space through linear transformation. The principal components are independent of each other, eliminating linear correlations between features. Furthermore, dimensionality reduction also has a denoising effect: principal components with small variance contributions often correspond to noise components in the data; discarding these principal components can improve the signal-to-noise ratio of the features to some extent.The dimensionality-reduced feature representation lays the foundation for subsequent quantization encoding and hash compression, enabling feature compression to be performed in a lower-dimensional space and further improving compression efficiency.
[0035] After dimensionality reduction, quantization encoding is performed based on the reduced feature representation, converting continuous-value features into discrete codes to obtain quantized feature codes. Quantization encoding is another important step in feature compression, converting floating-point continuous-value features into integer discrete codes, thereby further reducing storage space and supporting efficient feature comparison. The features obtained after dimensionality reduction by principal component analysis are still continuous values (floating-point numbers), each typically requiring 4 bytes (single-precision floating-point) or 8 bytes (double-precision floating-point) to store. Quantization encoding maps continuous feature values to a finite number of discrete quantization levels, each represented by an integer, thus reducing storage requirements to 1-2 bytes or even less. The basic principle of quantization encoding is similar to the analog-to-digital conversion (ADC) process: continuous analog signals are discretized into digital signals. The quantization process includes two steps: dividing the quantization interval and determining the quantization value. The simplest quantization method is uniform quantization, which evenly divides the range of feature values into several intervals, each interval corresponding to a quantization level. For example, if a feature's value range is [0, 1], using 8-bit uniform quantization, [0, 1] is divided into 256 intervals, each with a width of 1 / 256. The interval numbers 0-255 are the quantized encoded values. All feature values falling within the i-th interval are mapped to code i. Uniform quantization is simple to implement and computationally efficient, but it doesn't consider the actual distribution characteristics of feature values. In real-world data, feature values are often distributed unevenly, with high sample density in some intervals and low sample density in others. For intervals with high sample density, uniform quantization may lead to large quantization errors; for intervals with low sample density, allocating too many quantization levels is wasteful. Non-uniform quantization, by adaptively dividing quantization intervals according to the distribution characteristics of feature values, can achieve smaller quantization errors with the same number of quantization levels. Commonly used non-uniform quantization methods include k-means clustering-based quantization and probability distribution-based quantization. K-means quantization treats feature values as one-dimensional data points and divides them into k clusters using the k-means clustering algorithm. The center value of each cluster serves as the quantized representative value for that cluster, and the cluster number is used as the quantization code. This method can adaptively allocate more quantization levels to regions with high sample density, reducing quantization error. Probability distribution-based quantization divides quantization intervals according to the probability density function of the feature values, ensuring that the number of samples in each interval is approximately equal (equal probability quantization) or that the expected value of the quantization error is minimized (optimal quantization). In building crack detection, the principal component feature values after dimensionality reduction usually follow an approximately Gaussian distribution. Using non-uniform quantization can better preserve the discriminative power of the features. Quantization encoding not only reduces storage space but also introduces a certain degree of fault tolerance. In practical applications, due to factors such as changes in illumination, shooting angle deviations, and camera noise, the feature values of the same crack may exhibit slight variations in images acquired at different times or under different conditions.If high-precision floating-point features are used, these minute changes can lead to incomplete matching of feature values, affecting retrieval results. Quantization encoding, however, maps feature values within a certain range to the same code. This "rounding" effect provides natural fault tolerance: as long as the change in feature value does not exceed the width of the quantization interval, the quantized code remains unchanged. This fault tolerance is particularly important for long-term monitoring of building cracks, enabling accurate identification of historical cracks even under changing environmental conditions. Quantized features are more suitable for rapid comparison and index construction. Integer encoding comparisons are faster than floating-point comparisons and are more suitable for fast indexing techniques such as hashing, providing a technical foundation for subsequent feature hash compression and approximate nearest neighbor search.
[0036] Based on quantization encoding, further compression is performed using hash encoding or binary encoding methods according to the quantized feature encoding to obtain the compressed feature representation. Hash encoding and binary encoding are the final step in feature compression and are also key technologies for achieving extreme compression. These encoding methods can compress feature representations to their limits, providing technical support for the storage and real-time retrieval of large-scale crack databases. The core idea of hash encoding is to map high-dimensional features to low-dimensional hash codes through hash functions. The design of hash functions follows the principle of locality sensitivity: similar inputs are mapped to the same or similar hash codes, while dissimilar inputs are mapped to different hash codes. For building crack detection, feature vectors representing the same or similar cracks should be mapped to the same hash bucket, while feature vectors representing different cracks should be mapped to different hash buckets. Commonly used hash encoding methods include Locality Sensitive Hashing (LSH) and Learned Hashing. Locality Sensitive Hashing uses methods such as random projection or random hyperplane to construct a family of hash functions. Each hash function divides the feature space into two half-spaces, generating a hash bit (0 or 1) based on which half-space the feature vector falls into. By combining multiple hash functions, multi-bit hash codes can be generated. The theoretical guarantee of LSH is that the closer the feature vectors are, the higher the probability of generating the same hash code. For Euclidean distance, random projection LSH can be used; for cosine similarity, random hyperplane LSH can be used; and for Hamming distance, bit sampling LSH can be used. Learned hashing learns the optimal hash function through machine learning methods, maximizing the preservation of the similarity relationship of the original features. Supervised hashing methods use labeled data (such as crack type labels) to train the hash function, making the hash codes of samples of the same class similar and the hash codes of samples of different classes highly different; unsupervised hashing methods learn the hash function by preserving the inherent structure of the data (such as neighborhood relationships, manifold structure, etc.). Commonly used learned hashing methods include spectral hashing, iterative quantization, and kernel-supervised hashing. Hash encoding can compress tens of dimensions of quantized features into tens to hundreds of bits of binary hash code, further reducing storage space to the byte level. Binary encoding is another compression method that directly converts features into binary bit strings. The simplest binary encoding is symbolic encoding, where for each feature dimension, if the feature value is greater than a certain threshold (such as 0 or the mean), it is encoded as 1; otherwise, it is encoded as 0. This encoding method is simple to implement but suffers from significant information loss. Improved binary encoding methods include multi-bit encoding and structured encoding. Multi-bit encoding allocates multiple binary bits to each feature dimension, preserving more feature information by converting the quantized code into a binary representation. For example, an 8-level quantized feature requires 3 binary bits for representation (2... 3=8). Structured coding considers the correlation between features and designs coding schemes using structured methods such as coding trees and coding graphs, so that similar features have similar codes (e.g., small Hamming distance). Regardless of whether hash coding or binary coding is used, the compressed feature representation has the following advantages: First, storage space is significantly reduced. A multi-dimensional floating-point feature vector (requiring hundreds to thousands of bytes) can be compressed into tens to hundreds of bits of binary code (requiring digits to tens of bytes), reducing storage space by more than 90%. Second, it supports efficient bitwise comparison. The similarity between binary codes can be quickly calculated using Hamming distance, which only requires XOR and popcount operations. Modern CPUs have hardware support for these operations, making them extremely fast. Finally, binary codes are naturally suitable for hash indexing and can be directly used as keys in hash tables, supporting constant-time lookup operations. These advantages make compressed feature representation an ideal choice for building large-scale, efficient fracture databases.
[0037] Finally, based on the compressed feature representations, integration is performed to obtain the compact feature vector. Feature integration is the final step in the feature compression process. Its function is to uniformly organize and standardize the various compressed features obtained in the preceding steps, forming a standardized compact feature vector format. In practical systems, multiple compression methods may be used simultaneously: hash encoding may be used for some feature dimensions, while binary encoding may be used for others; or different types of original features (such as edge features, texture features, and directional features) may be compressed separately. Feature integration requires organizing these compressed features from different sources and in different formats into a unified data structure. The integration process includes operations such as feature concatenation, format standardization, and metadata appending. Feature concatenation involves concatenating different compressed features into a long vector in a fixed order. For example, the hash code of the edge feature is placed first, followed by the binary code of the texture feature, and finally the quantized code of the directional feature. Format standardization ensures that all compact feature vectors have the same length and data type, facilitating unified storage and processing. For example, all compressed features can be uniformly represented as a fixed-length byte array, with insufficient space padded with 0s. Metadata appending adds auxiliary information to the feature vectors, such as the feature version number (used to track updates to the feature extraction algorithm), the feature extraction time, and the corresponding image ID. This metadata helps with feature management and traceability. The integrated compact feature vectors have a fixed length and format, facilitating unified management and efficient retrieval. In the database, all crack sample compact feature vectors have the same data structure and can be stored in contiguous memory space or database tables, supporting batch read / write and parallel processing. While retaining key identification information, the compact feature vectors compress the original high-dimensional floating-point features (typically hundreds to thousands of dimensions, 4-8 bytes per dimension, totaling thousands of bytes) into low-dimensional binary or integer features (typically tens to hundreds of bits, totaling digits to tens of bytes), reducing storage space by 70%-90% or more. This compact representation is the core of building a spatially optimized feature indexing mechanism, providing technical support for the efficient management and real-time retrieval of large-scale building crack databases. Through feature compression, millions or even tens of millions of crack records can be managed with limited storage resources, and feature retrieval can be completed in milliseconds, meeting the needs of real-time building crack monitoring.
[0038] As one implementation method, based on the compact feature vector, the feature space is divided into multiple sub-regions using a KD-tree or ball tree spatial partitioning algorithm to obtain feature space partitions. Based on the feature space partitions, a feature index structure supporting approximate matching is constructed using a locality-sensitive hashing algorithm to improve the retrieval efficiency of a large-scale feature database, resulting in an initial feature index structure. Based on the initial feature index structure, optimization and compression are performed to reduce storage space usage, resulting in an optimized feature index structure. According to the optimized feature index structure, a multi-level index hierarchy structure is constructed to achieve progressive retrieval from coarse-grained to fine-grained, resulting in a hierarchical feature index structure. According to the hierarchical feature index structure, an incremental index update mechanism is designed to support the dynamic addition of new crack feature samples, resulting in a spatially optimized feature index mechanism.
[0039] Specifically, firstly, based on the compact feature vectors, the feature space is divided into multiple sub-regions using a KD-tree or ball tree spatial partitioning algorithm, resulting in feature space partitioning. Spatial partitioning is a fundamental strategy for building efficient indexes. Its core idea is to utilize the "divide and conquer" principle: dividing the entire feature space into multiple non-overlapping or partially overlapping sub-regions, each containing only a subset of feature vectors. During retrieval, the system first quickly determines which sub-regions the query feature vector might be located in, and then performs a detailed search only within these candidate sub-regions, thus avoiding a scan of the entire database. The KD-tree (K-Dimensional Tree) is one of the most classic spatial partitioning data structures, recursively dividing the k-dimensional space into nested hyperrectangular regions through binary search. The construction process of a KD-tree is as follows: First, select a coordinate axis (usually the axis with the largest variance or a cyclic selection of axes), calculate the median of all data points on that axis, and divide the space in two along the hyperplane containing the median. The median point becomes the current node, points smaller than the median are assigned to the left subtree, and points larger than the median are assigned to the right subtree. Then, recursively perform the same partitioning process on the left and right subtrees until the number of data points in each leaf node does not exceed a set threshold (e.g., 10-50). After construction, each internal node of the KD-tree stores a partitioning hyperplane (defined by the coordinate axis and the partition value), and each leaf node stores a set of actual feature vectors. During retrieval, starting from the root node, the value of the query vector on the partitioning axis of the current node determines whether to enter the left or right subtree, recursively descending until a leaf node is reached, and then a linear search is performed within the leaf node. KD-trees perform well in low-dimensional spaces (k<20), achieving a retrieval time complexity of O(log n). However, KD-trees suffer from the "curse of dimensionality" in high-dimensional spaces: as the dimension increases, the efficiency of spatial partitioning decreases, potentially degenerating into a linear search in the worst case. This is because in high-dimensional spaces, the distances between data points tend to be uniform, making it difficult to effectively separate data using a simple hyperplane. Ball trees are an alternative spatial partitioning structure designed to overcome the limitations of KD-trees in high-dimensional spaces. They partition space by constructing nested hyperspheres. The construction process of a ball tree is as follows: First, calculate the centroid (center point) and radius (distance from the farthest point to the centroid) of all data points, and enclose all data points with a hypersphere. Then, select two relatively far apart data points as centers, and divide all data points into two groups according to their distance to these two centers, constructing a sub-sphere for each group. This partitioning process is recursively executed until the number of data points contained in each leaf sphere does not exceed a threshold. Each node of the ball tree stores a hypersphere (center and radius), and the leaf nodes store the actual feature vectors. During retrieval, starting from the root node, the distance from the query point to the center of each sub-sphere is calculated. Based on the distance and radius, it is determined which sub-spheres the query point may fall into, and the process is recursively entered into the candidate sub-spheres for searching.Spherical trees partition space using spherical boundaries rather than hyperplanes, allowing for tighter data point enclosure in high-dimensional space and reducing wasted space. Therefore, their performance in high-dimensional space is superior to KD trees. In building crack detection, the compact feature vectors after dimensionality reduction and compression typically have dimensions between tens and hundreds, falling into the mid-to-high dimensional range. The system selects an appropriate spatial partitioning algorithm based on the actual dimensionality of the feature vectors and the data distribution characteristics: for features with lower dimensions (e.g., below 30 dimensions), KD trees are preferred; for features with higher dimensions (e.g., above 30 dimensions), spherical trees are preferred. After spatial partitioning, the feature space is organized into a tree structure, providing spatial index support for fast retrieval.
[0040] Based on the spatial partitioning, and using the aforementioned feature space partitioning, a feature index structure supporting approximate matching is constructed using the Locality-Sensitive Hashing (LSH) algorithm. This improves the retrieval efficiency of large-scale feature databases, resulting in the initial feature index structure. LSH is an indexing technique specifically designed for approximate nearest neighbor search, fundamentally different from traditional exact indexes (such as KD-trees and ball trees). Traditional indexes pursue exact matching, i.e., finding the k vectors with the smallest distance to the query vector; while LSH supports approximate matching, i.e., finding the k vectors with a high probability that are closest to the query vector. This approximation results in a significant improvement in retrieval speed and better adaptability to high-dimensional data. The core idea of LSH is to design a special family of hash functions so that similar vectors have a high probability of being mapped to the same hash bucket, while dissimilar vectors have a high probability of being mapped to different hash buckets. This local sensitivity is achieved through the special construction of the hash functions. Different LSH function design methods exist for different distance metrics. For Euclidean distance, the commonly used LSH function is random projection hashing, which generates a hash value by generating a random vector and calculating the inner product of the data vector and the random vector. For cosine similarity, the commonly used LSH function is random hyperplane hashing (also known as simhash), which generates a hash bit by generating a random hyperplane and determining which side of the hyperplane the data vector lies on. For Hamming distance, the commonly used LSH function is bit sampling hashing, which directly samples certain bits of the data vector as the hash value. In building crack detection, compact feature vectors are usually binary or integer encoded, making Hamming distance or Euclidean distance suitable as similarity metrics; therefore, bit sampling hashing or random projection hashing can be used. The LSH index construction process is as follows: First, design L sets of hash functions, each containing k basic hash functions. A composite hash value is obtained by combining the results of the k basic hash functions (e.g., concatenating or adding them). Then, for each feature vector in the database, apply the L sets of hash functions to calculate L hash values, and insert the feature vector into the corresponding hash buckets in the L hash tables. The choice of L and k requires a trade-off between retrieval recall and time overhead; a larger L and smaller k result in higher recall but higher time overhead. During retrieval, the same L sets of hash functions are applied to the query vector to obtain L hash values. Then, the corresponding hash buckets are retrieved from the L hash tables. All retrieved candidate vectors are merged and deduplicated. Finally, precise distance calculation is performed on the candidate vectors, returning the k most similar vectors. The theoretical guarantee of LSH is: if the distance between two vectors is less than a certain threshold r, there is a high probability that they will be mapped to at least one of the same hash buckets (high recall); if the distance between two vectors is greater than cr (c>1 is a constant), the probability that they will be mapped to the same hash bucket is low (low false positive rate).By properly designing L and k, the retrieval time complexity can be reduced to a sublinear complexity close to O(1) while maintaining recall. LSH indexes are particularly suitable for fast retrieval of large-scale, high-dimensional feature databases, unaffected by the curse of dimensionality, and capable of millisecond-level retrieval in databases containing millions or even tens of millions of samples. For building crack detection, LSH's tolerance-matching feature is especially important: even if the query features deviate from the features in the database (e.g., due to changes in lighting, shooting angle deviations, image noise, etc.), as long as the deviation does not exceed the tolerance range, it can still be successfully retrieved. This robustness enables the crack detection system to work stably in complex and ever-changing real-world environments.
[0041] After constructing the initial LSH index, optimization and compression are performed based on the initial feature index structure to reduce storage space usage, resulting in an optimized feature index structure. Index optimization is the process of further reducing index storage overhead while maintaining retrieval efficiency, which is crucial for large-scale systems. Although LSH indexes have high retrieval efficiency, their storage overhead is relatively large: they require storing L hash tables, each of which may contain thousands to tens of thousands of hash buckets, and each hash bucket contains several data pointers. When the database size reaches millions, the storage space of the index itself may reach several GB or even tens of GB. Index optimization reduces storage overhead from several aspects. The first is the optimization of hash bucket distribution. Ideally, data should be evenly distributed across hash buckets, but since the actual distribution of data is often uneven, some hash buckets may contain too much data (overloaded), while other hash buckets may be almost empty (idle). Overloaded hash buckets will result in too many candidate vectors needing to be compared during retrieval, affecting retrieval speed; while a large number of empty hash buckets waste storage space. By analyzing the load distribution of hash buckets, the parameters of the hash function (such as random vectors, projection direction, etc.) can be adjusted to make the data distribution more even. Specific methods include: counting the data volume of each hash bucket to identify overloaded and idle hash buckets; for overloaded hash buckets, further splitting them into multiple sub-buckets by increasing the hash bit length; for idle hash buckets, merging them with adjacent buckets by reducing the hash bit length; and gradually optimizing the distribution of hash buckets through iterative adjustments. Secondly, there is the compression of redundant information. LSH indexes store a large number of data pointers, which are typically 64-bit memory addresses or database record IDs. When the data volume is huge, the pointers themselves occupy a large amount of space. Several techniques can be used to compress pointer storage: differential encoding, which stores the difference between adjacent pointers instead of their absolute values; the difference is usually small and can be represented with fewer bits; bitmap compression, which uses bitmaps to represent which IDs exist in a bucket within a certain range for dense ID distributions; run-length encoding, which uses the starting ID and length to represent consecutive ID sequences; and dictionary encoding, which creates a dictionary and represents recurring pointer patterns with an index. Thirdly, there is the optimization of memory layout. The memory access speed of modern computers is much lower than the CPU's computing speed, and memory access often becomes a performance bottleneck. By optimizing the memory layout of the index, cache hit rate can be improved and memory access latency reduced. Specific methods include: storing frequently accessed data (such as data pointers within the same hash bucket) in contiguous memory space to improve spatial locality; pre-sorting the hash table to make memory access patterns during retrieval more regular and reduce cache invalidation; and using compact data structures to reduce memory fragmentation and alignment waste. These optimizations reduce index storage space while maintaining retrieval efficiency, enabling support for larger-scale fragmented databases.
[0042] Building upon index optimization, a multi-level index hierarchy is constructed based on the optimized feature index structure to achieve progressive retrieval from coarse-grained to fine-grained, resulting in a hierarchical feature index structure. This multi-level index hierarchy is a key technology for further improving retrieval efficiency, drawing inspiration from the design concepts of multi-level storage hierarchies (such as CPU cache, memory, and hard disk) and classic data structures like B+ trees. While single-level indexes can achieve efficient retrieval, for ultra-large-scale databases (such as those with tens of millions of samples), the hash table size of a single-level index is still very large, requiring access to a significant number of hash buckets during retrieval. Multi-level indexes, by constructing a hierarchical structure from coarse to fine, perform progressive retrieval at different granularities, further improving efficiency. The hierarchical index is constructed as follows: The top-level index provides coarse-grained classification, dividing the feature space into several large regions, each corresponding to a category or cluster center. The purpose of the top-level index is to quickly eliminate a large number of irrelevant regions and narrow down the candidate range. The middle-level index performs medium-granularity partitioning within each top-level region, and can further partition based on the subspace characteristics of the feature vectors or clustering results. The bottom-level index is a detailed LSH hash table, providing accurate feature retrieval within the candidate regions determined by the middle-level index. In building crack detection, the hierarchical index can be designed as follows: The top-level index performs coarse classification based on the crack type (e.g., linear cracks, network cracks, radial cracks, etc.) and location region (e.g., building number, floor, wall location, etc.). This information can be obtained from the crack's metadata or automatically extracted through cluster analysis. The middle-level index performs medium-granularity partitioning based on the principal components of the feature vectors or clustering results. For example, linear cracks are divided into horizontal, vertical, and oblique subclasses based on direction, and network cracks are divided into sparse, medium, and dense subclasses based on density. The bottom-level index is an LSH hash table within each subclass, storing all feature vectors of that subclass. A progressive retrieval strategy is employed: First, the top-level index quickly locates 1-3 relevant top-level categories based on the type and location information of the query features; this step typically eliminates over 90% of the data. Then, the middle-level index further narrows the candidate range based on the principal component or cluster affiliation of the query features; this step can eliminate another 50%-80% of the candidate data. Finally, a detailed hash search and candidate vector comparison are performed in the bottom-level LSH index to return the most similar feature vector. The advantages of progressive retrieval are: relatively low retrieval overhead at each level, while significantly narrowing the search range of subsequent levels; different optimization strategies can be used for different levels of indexes, such as keeping the top-level index resident in memory to improve speed, while storing the bottom-level index on disk to save memory; the hierarchical structure provides natural parallelization opportunities, allowing retrieval at different levels or in different partitions to be executed in parallel. Through a multi-level index hierarchy, millisecond or even sub-millisecond query response speeds can be achieved, meeting the stringent requirements of real-time building crack monitoring.
[0043] Finally, based on the hierarchical feature index structure, an incremental index update mechanism is designed to support the dynamic addition of new crack feature samples, resulting in a spatially optimized feature index mechanism. The incremental update mechanism is a key technology for maintaining the real-time performance of the index and the scalability of the system. A building crack detection system is a continuously running dynamic system that constantly acquires new building images, detects new cracks, and accumulates new crack samples over time. If a traditional batch update method is used, the entire index structure needs to be rebuilt after each new sample is added, which is impractical in large-scale systems: rebuilding the index may take hours or even days, during which time the system cannot function properly or can only use the old index, resulting in new samples not being retrieved. The incremental update mechanism, through the design of a dynamic insertion algorithm, allows new crack feature samples to be directly inserted into the existing index structure, requiring only local adjustments to the relevant index nodes without rebuilding the entire index. The core challenge of incremental updates is supporting efficient dynamic insertion while maintaining index performance. For spatial partitioning structures like KD-trees and ball trees, incremental insertion is relatively straightforward: new data points start from the root node and recursively move downwards according to the partitioning rules to find the leaf node where they should be inserted, adding the data point to that leaf node. If the data volume of a leaf node exceeds a threshold, the leaf node is split, creating two new child nodes, and the data from the original leaf node and the newly inserted data are reassigned to the two child nodes. The splitting operation may propagate upwards, requiring updates to the parent node as well, but the impact is limited to the path from the root to the leaf, without needing to rebuild the entire tree. For LSH indexes, incremental insertion is even simpler: a hash function is applied to the new feature vector to calculate its hash value, which is then inserted into the corresponding hash bucket. However, incremental insertion also leads to a gradual degradation in index performance. For spatial partitioning trees, due to the randomness of the insertion order, the tree may become unbalanced, with some branches being too deep and others too shallow, resulting in decreased retrieval efficiency. For LSH indexes, as data increases, the load on the hash buckets increases, leading to more and more overloaded buckets and impacting retrieval speed. Therefore, incremental update mechanisms need to be combined with periodic index reorganization and balancing operations. Specific implementation strategies include: reserving a certain amount of expansion space for each hash bucket (e.g., 20%-50% of the initial capacity) to support a certain number of incremental insertions without immediate reorganization; setting a load threshold for hash buckets, triggering a bucket split operation when the data volume of a bucket exceeds the threshold, splitting a large bucket into two smaller buckets, recalculating the hash values of the data within the buckets, and redistributing them; performing a global analysis and optimization of the entire index periodically (e.g., daily or weekly) to identify severely unbalanced regions and reorganize them; maintaining index version information and change logs, recording the timestamp and impact scope of each insertion operation, and supporting index rollback and recovery. The incremental update mechanism also needs to handle concurrent access issues.In real-world systems, multiple users may query the index simultaneously, and new samples may need to be inserted. This necessitates that the index support concurrent read and write operations. Common concurrency control strategies include: read-write locks, which allow multiple read operations to execute concurrently, but write operations require exclusive access; optimistic locking, which allows concurrent operations but checks for conflicts upon commit; and version control, which maintains multiple versions of the index, with read operations accessing a stable version and write operations creating new versions, and versions are periodically merged. Through a carefully designed incremental update mechanism, the system can continuously accept new crack samples without interrupting service, maintaining the index's real-time performance and retrieval capabilities. The incremental update mechanism ensures the index's dynamism and the system's scalability, enabling the crack detection system to continuously learn and accumulate new crack samples, constantly enriching the crack database and improving detection accuracy and coverage. As the system runs longer, the database accumulates more and more crack samples, covering a wider range of crack types, and the detection capabilities continuously improve, forming a virtuous cycle.
[0044] As one implementation method, based on newly acquired building surface images, noise reduction, contrast enhancement, geometric correction, standardization, multi-scale feature extraction, feature dimensionality reduction, quantization encoding, and vector compression are sequentially performed to obtain the query feature vector. Based on current detection environment parameters and image quality indicators, a tolerance threshold for feature matching is dynamically calculated. Based on the feature indexing mechanism and the tolerance threshold, an approximate nearest neighbor search is performed on the query feature vector to obtain preliminary matching results. Based on the preliminary matching results, multi-level filtering and verification are performed to remove false matches, resulting in verified matching results. Based on the verified matching results, the crack matching result set is obtained by sorting the query feature vector and the matching feature vector according to their feature similarity.
[0045] Specifically, based on the newly acquired building surface images, the following processes are sequentially executed: noise reduction, contrast enhancement, geometric correction, standardization, multi-scale feature extraction, feature dimensionality reduction, quantization encoding, and vector compression, to obtain the query feature vector. This step is the starting point for crack matching, and its core requirement is to ensure that the feature extraction process of the newly acquired images is completely consistent with the feature extraction process of historical samples in the database, thereby ensuring that the generated query feature vector is comparable to the feature vector in the database. Consistency in feature extraction is a prerequisite for accurate matching; any difference in processing steps may lead to a shift in the feature space, affecting the reliability of the matching results. In specific implementation, the newly acquired original images are first denoised using a bilateral filtering algorithm, employing the same spatial domain standard deviation and value domain standard deviation parameters to ensure consistency in the denoising effect. Bilateral filtering removes image noise while preserving the sharp features of the crack edges, providing a high-quality image foundation for subsequent feature extraction. After denoising, an adaptive histogram equalization algorithm is used to improve image contrast. Through a localized contrast enhancement strategy, the distinction between cracks and the background is enhanced, especially in complex environments with uneven lighting, effectively highlighting crack features. After contrast enhancement, the system performs geometric correction to eliminate perspective distortion. By calculating the perspective transformation matrix, the tilted image is corrected to a frontal view, restoring the true shape of the crack. Geometric correction is crucial for ensuring the geometric consistency of features, as perspective distortion can distort the crack's morphological features, affecting the accuracy of feature matching. After correction, size and brightness standardization is performed, uniformly adjusting the image to a preset standard size and brightness range, eliminating format and quality differences under different shooting conditions. Standardization ensures that the feature extraction algorithm can operate on a consistent data format, avoiding feature deviations caused by differences in image size or brightness distribution.
[0046] Based on standardized images, pyramid transform or wavelet transform is applied for multi-scale decomposition to generate image layers of different resolutions, preparing for multi-scale feature extraction. Then, edge features, texture features, and directional features are extracted from the images at each scale. Edge features are extracted using edge detection operators such as Canny or Sobel to capture the contour information of the cracks; texture features are extracted using LBP or GLCM algorithms to describe the pattern characteristics of the crack region; and directional features are extracted using Gabor filters or HOG algorithms to reflect the direction of crack extension. These three types of features characterize the image properties of the cracks from different perspectives. Through multi-scale fusion and integration, a comprehensive multi-dimensional feature descriptor set is formed. After the feature descriptor set is generated, it undergoes importance assessment and principal component analysis (PCA) dimensionality reduction. Importance assessment identifies key features that contribute significantly to crack identification, and PCA dimensionality reduction maps the high-dimensional feature space to a low-dimensional space, significantly reducing the feature dimensionality while retaining more than 95% of the original information. The dimensionality-reduced feature representations are then quantized and encoded, converting continuous-value features into discrete codes and introducing a certain degree of fault tolerance. Finally, hash encoding or binary encoding methods are applied for further compression to generate compact feature vectors. The entire feature extraction process strictly follows the same algorithms and parameter settings as historical samples, ensuring that the query feature vector and the database feature vector are in the same feature space and have direct comparability. This consistency in the processing flow is the foundation for accurate matching; any deviation in any step may lead to misalignment of the feature space, affecting the reliability of the matching results.
[0047] After feature extraction, the tolerance threshold for feature matching is dynamically calculated based on the current detection environment parameters and image quality indicators. The tolerance threshold is a key parameter controlling approximate matching behavior; it determines the range of similar features the system searches for, directly affecting retrieval precision and recall. Setting the tolerance threshold is a trade-off: a threshold that is too small, while improving matching precision, may lead to insufficient recall, meaning some truly similar cracks will not be detected due to minor differences in features; a threshold that is too large, while improving recall, will introduce a large number of false matches, reducing matching precision. Under ideal detection conditions (such as indoor environment, stable lighting, professional equipment, and frontal shooting), image quality is high, feature extraction is stable, and the feature differences between images of the same crack acquired at different times are small. In this case, a smaller tolerance threshold can be used, such as a Hamming distance of no more than 5-10 bits or an Euclidean distance of no more than 5%-10% of the feature space radius. Under this setting, the system can achieve high-precision matching, accurately associating the queried crack with the most similar historical records in the database. However, in practical applications, the detection environment is often complex and variable, especially for outdoor building inspections, which face a variety of adverse factors: changes in lighting conditions (such as different times of day, such as sunny, cloudy, dusk, and night, and different lighting patterns such as direct sunlight, diffused light, and shadow) can cause changes in the overall brightness, contrast, and tone of the image; the influence of weather conditions (such as rain and fog leading to reduced visibility and image blur) can reduce image quality; deviations in shooting angle (due to unstable drone flight attitude or human shaking during handheld shooting) can cause perspective distortion and motion blur; and different shooting distances can affect the scale and resolution of cracks in the image. All these factors can lead to significant differences in the characteristics of images of the same crack acquired under different conditions. If a small tolerance threshold is still used, historical records may not be retrieved, resulting in a loss of long-term monitoring continuity. Therefore, it is necessary to dynamically adjust the tolerance threshold based on the current detection environment parameters and image quality indicators.
[0048] Dynamic tolerance calculation is based on a comprehensive evaluation of multiple input parameters. Environmental parameters include external conditions that can be directly measured or recorded: light intensity can be measured with a photometer or estimated from the overall brightness of the image; the lower the light intensity (e.g., cloudy days or dusk), the higher the tolerance threshold should be; weather conditions can be obtained from meteorological data or inferred from image sharpness; the tolerance threshold should be increased under adverse weather conditions; shooting distance can be obtained from the drone or camera's range sensor; the farther the shooting distance, the lower the image resolution, and the higher the tolerance threshold should be; shooting angle can be obtained from the camera's attitude sensor (e.g., gyroscope, accelerometer); the greater the deviation of the shooting angle from a direct frontal view, the higher the tolerance threshold should be. Image quality metrics are calculated through analysis of the acquired images themselves: image sharpness can be evaluated using variance or frequency domain analysis of the Laplacian operator; lower sharpness indicates a blurrier image, and the tolerance threshold should be increased. Image contrast can be evaluated using the distribution range of the grayscale histogram; lower contrast indicates poorer differentiation between cracks and the background, and the tolerance threshold should be increased. Signal-to-noise ratio (SNR) can be evaluated using noise estimation algorithms; lower SNR indicates more severe noise interference, and the tolerance threshold should be increased. Feature stability can be evaluated by calculating the variance of features from multiple samples of the same scene; a larger feature variance indicates poorer feature extraction stability, and the tolerance threshold should be increased. The system inputs these parameters into a tolerance calculation model, which can be a rule-based expert system or a regression model trained through machine learning. The rule-based model calculates tolerance by setting parameter thresholds and adjusting rules. For example, "If the light intensity is lower than threshold L1 and the image sharpness is lower than threshold C1, then the tolerance threshold is set to T." high If the light intensity is higher than threshold L2 and the image sharpness is higher than threshold C2, then the tolerance threshold is set to T. low Otherwise, the tolerance threshold is set to T. medium Machine learning models, trained on large amounts of labeled data, learn the mapping relationship between environmental parameters, image quality, and the optimal tolerance threshold, enabling them to adapt more precisely to various complex situations. Through dynamic tolerance calculation, they can adaptively adjust matching strategies in different application scenarios, maximizing precision while ensuring recall, thus optimizing retrieval performance.
[0049] After the tolerance threshold is determined, an approximate nearest neighbor search is performed on the query feature vector based on the feature indexing mechanism and the tolerance threshold to obtain preliminary matching results. The approximate nearest neighbor search utilizes the previously constructed multi-level index structure and LSH hash table to quickly locate candidate samples. This process fully demonstrates the advantages of the indexing mechanism, transforming a linear search that originally required comparing millions of samples one by one into an efficient retrieval that only needs to access a small number of candidate samples. The search process adopts a progressive strategy, refining the candidate range step by step in multiple stages. The first stage is top-level index retrieval, which first analyzes the coarse characteristics of the query feature vector, such as determining the possible major category (e.g., linear cracks, network cracks, etc.) and location region (e.g., building number, floor, etc.) of the cracks through certain dimensions or metadata information of the features. Based on this coarse classification information, the top-level index divides the entire database into several large partitions, quickly locating 1-3 partitions related to the query features. This step can usually eliminate more than 90% of the data, narrowing the search range from millions of samples to tens of thousands or hundreds of thousands of samples. The retrieval overhead of the top-level index is very small, typically requiring only a few hash lookups or simple rule judgments, taking only microseconds. The second stage is mid-level index retrieval, which further narrows the scope within the candidate partitions determined at the top level based on more refined characteristics of the query features. Mid-level indexes can be divided based on principal component projections or cluster affiliations of feature vectors. For example, for linear cracks, they can be further classified according to the dominant direction of the cracks (horizontal, vertical, oblique); for network cracks, they can be further classified according to crack density (sparse, medium, dense). The projection of the query features onto the principal component space or their distance to each cluster center is calculated to determine the most likely subclass, further narrowing the search scope to thousands or tens of thousands of samples. The retrieval overhead of the mid-level index remains relatively small, mainly involving vector projection calculations and distance comparisons, taking milliseconds. The third stage is bottom-level LSH index retrieval, which is the most critical and computationally intensive stage. Within the candidate subclasses determined at the mid-level, a detailed feature retrieval is performed using an LSH hash table.
[0050] The specific process of LSH retrieval is as follows: L pre-designed hash functions are applied to the query feature vector. Each hash function group contains a combination of k basic hash functions, resulting in L hash values. Each hash value corresponds to a hash bucket in the LSH index. These L hash buckets are accessed, and all feature vector pointers stored in each bucket are extracted. Considering the existence of a tolerance threshold, not only the exact matching hash bucket is accessed, but also neighboring hash buckets. The proximity relationship of hash buckets is defined by Hamming distance: if the Hamming distance between two hash values does not exceed the number of bits corresponding to the tolerance threshold, they are considered to be neighboring. For example, if the tolerance threshold corresponds to a Hamming distance of 5, and a hash value of the query vector is "10110101", then not only is that hash bucket accessed, but also all buckets corresponding to hash values whose Hamming distance to "10110101" does not exceed 5. By accessing neighboring hash buckets, similar samples that were not mapped to the exact same hash bucket due to minor feature deviations can be retrieved, ensuring the recall rate of the retrieval. The feature vector pointers extracted from all relevant hash buckets in the L hash tables constitute the candidate sample set. To avoid duplication, the candidate set is deduplicated, as the same feature vector may appear in multiple hash buckets across multiple hash tables. The deduplicated candidate sample set constitutes the initial matching result, typically ranging from hundreds to thousands of samples—thousands of times smaller than the original database. The entire approximate nearest neighbor search process leverages the efficient representation of compact feature vectors and an optimized index structure, enabling the search to be completed in milliseconds even with millions of crack samples in the database, meeting the stringent requirements of real-time detection. The initial matching result provides a high-quality candidate set for subsequent precise verification, containing all historical samples that might be similar to the queried crack.
[0051] However, the initial matching results may contain a certain proportion of mismatches, which is an inherent characteristic of approximate search. Mismatches mainly originate from two aspects: first, the probabilistic nature of the LSH hash function—while similar vectors have a high probability of being mapped to the same or neighboring hash buckets, dissimilar vectors also have a certain probability of hash collisions; second, the relaxation of the tolerance threshold—the expanded search range to ensure recall inevitably introduces some less similar samples. Therefore, based on the initial matching results, multi-level filtering and verification are performed to remove mismatches, resulting in verified matching results. The multi-level filtering adopts a progressive verification strategy from coarse to fine and from fast to slow, ensuring both verification accuracy and controlling computational overhead. The first level of filtering is a coarse distance filter, which is the fastest and most basic verification method. The precise distance between the query feature vector and each candidate sample feature vector is calculated; Hamming distance is used for binary feature vectors, and Euclidean or cosine distance is used for floating-point feature vectors. Although distance calculation is slower than hash lookup, the computational overhead remains manageable due to the significantly reduced number of candidate samples. A distance threshold is set, which can be the same as or slightly more lenient than the previous tolerance threshold, to remove candidate samples whose distance exceeds the threshold. This step can remove samples that are falsely retrieved due to hash collisions, typically filtering out 30%-50% of the candidate samples. The second level of screening is geometric consistency verification, a specialized verification method for image feature matching. For samples that are suspected of matching (i.e., samples that pass the first level of distance filtering), key points are extracted from the query image and the candidate sample image, such as the endpoints, intersections, and turning points of cracks. Then, geometric transformation verification is performed on these key points to confirm whether the spatial positional relationship of the cracks in the two images is consistent. Specifically, the RANSAC (Random Sample Consensus) algorithm is used to estimate the geometric transformation (such as affine transformation or perspective transformation) between the two images. If a geometric transformation can be found that makes the positional error of most corresponding key points within the tolerance range, the geometric consistency verification is considered to have passed; otherwise, it is considered a false match. Geometric consistency verification can effectively identify samples with similar feature vectors but actually representing different cracks. For example, two cracks may have similar length, width, and orientation features, but their spatial positions in the images are completely different. This step can typically filter out another 20%-30% of candidate samples. The third level of screening is visual verification, which is the most refined and computationally intensive verification method, and is usually only performed on a small number of highly suspected samples. For candidate samples that have passed the first two levels of screening, if it is still uncertain whether they are true matches (e.g., similarity scores are close to the threshold boundary), local region comparison of the original image can be performed.The system extracts local regions of interest (ROIs) around cracks in both the query image and candidate sample images. These ROIs are then normalized (eliminating scale, rotation, and illumination differences), and visual similarity metrics such as Normalized Cross-Correlation (NCC) or Structural Similarity Indices (SSIM) are calculated. If the visual similarity exceeds a threshold, a match is confirmed; otherwise, it is considered a false match. Visual verification, based on pixel-level comparison of the original images, can detect subtle differences that feature vectors cannot capture, making it the most reliable verification method, but also the most computationally expensive. Through a three-level progressive verification process, high-quality verified matching results are obtained, with the false match rate controlled below 5%.
[0052] Finally, based on the verified matching results, the crack matching result set is obtained by sorting the query feature vector and the matching feature vector according to their feature similarity. Similarity calculation is a key step in quantifying the degree of matching; different feature representations correspond to different similarity measurement methods. For binary feature vectors, the most commonly used similarity measure is the reciprocal of the Hamming distance or normalized Hamming similarity. The Hamming distance calculates the number of different bits in two binary vectors; the smaller the Hamming distance, the more similar the two vectors are. Hamming similarity can be defined as: 1 - Hamming distance / vector length, with a value range of [0, 1], and a larger value indicates greater similarity. Jaccard similarity is another commonly used binary vector similarity measure, defined as the number of 1s in the result of a bitwise AND operation of two vectors divided by the number of 1s in the result of a bitwise OR operation, also with a value range of [0, 1]. For floating-point feature vectors, commonly used similarity measures are cosine similarity and normalized Euclidean distance. Cosine similarity is calculated by the cosine of the angle between two vectors, defined as the inner product of the two vectors divided by the product of their magnitudes. Its value ranges from -1 to 1 (usually [0, 1] for feature vectors), with larger values indicating greater similarity. Euclidean distance is calculated by the straight-line distance between two vectors in Euclidean space; smaller distances indicate greater similarity. It can be normalized to a similarity score: similarity = 1 / (1 + Euclidean distance). In practical applications, multiple similarity measures may be used in combination, and a weighted average may be used to obtain a comprehensive similarity score. For example, feature vector similarity, geometric consistency score, and visual similarity can be calculated simultaneously, and then a weighted average can be used to obtain the final similarity score. The weights can be determined based on the reliability and discriminative power of different measures. Typically, feature vector similarity has the highest weight because it is the fastest and most stable measure; geometric consistency score is next; and visual similarity can have a relatively low weight, serving as an auxiliary verification. The verified matching results are then sorted according to the calculated similarity scores, with the sample with the highest similarity ranked first, indicating the closest match to the query. The sorted matching results are arranged in descending order of similarity, forming an ordered list. Each matching result includes not only a similarity score but also complete information about the matched sample: a compact feature vector, the storage path or database ID of the original image, pixel-level boundary coordinates of the crack, crack location information (building, floor, wall, etc.), crack type label, geometric parameters (length, width, area), detection time, and risk level. This rich information provides comprehensive data support for subsequent crack identification, parameter evaluation, and trend analysis. Depending on the application requirements, the Top-K most similar matching results can be returned to the user, with K typically set between 5 and 20; or a similarity threshold can be set to return all matching results with similarity exceeding the threshold. The final crack matching result set is the output of the crack retrieval process, providing a reliable data foundation for subsequent crack status assessment.
[0053] As one implementation method, based on the crack matching result set, crack area localization is performed using newly acquired building surface images to obtain the pixel-level boundary of the crack; according to the morphological characteristics of the pixel-level boundary of the crack, the crack type is classified to obtain crack type labels; based on the pixel-level boundary of the crack, the geometric parameters of the crack are measured and converted into physical units to obtain crack geometric parameter data; based on the crack geometric parameter data and the crack location information corresponding to the pixel-level boundary of the crack, the severity of the crack is assessed and the risk level is classified to obtain the crack risk level; the crack location information corresponding to the pixel-level boundary of the crack, the crack type labels, the crack geometric parameter data, and the crack risk level are integrated to obtain the crack status report.
[0054] First, based on the crack matching result set, and combined with newly acquired building surface images, crack regions are located to obtain pixel-level crack boundaries. Crack region localization is the first step in condition assessment and the foundation for all subsequent analyses. Although the matching retrieval has found historical samples similar to the query crack, the location information of these historical samples can only be used as a reference. Cracks in the newly acquired images still require precise pixel-level segmentation to obtain accurate boundaries. Crack segmentation is a challenging image processing task because building surfaces typically have complex textures and backgrounds, and cracks range in width (from sub-millimeters to several centimeters), have diverse shapes (linear, curved, branching, mesh-like, etc.), and exhibit large contrast variations (dark cracks on light backgrounds or light cracks on dark backgrounds). A two-step strategy is adopted for crack localization: coarse localization and fine segmentation.
[0055] Coarse localization utilizes prior information provided by the matching results to quickly determine the Region of Interest (ROI). The samples with the highest similarity in the matching result set usually represent historical cracks that are the same as or highly similar to the current crack, and the location information of these historical samples provides important clues. If the query image and historical samples were taken in the same or similar locations (determined by GPS coordinates, image metadata, or building identifiers), then the approximate location of the crack in the historical samples should also be similar in the new image. The crack boundary coordinates of the matching samples are extracted, and considering possible variations in shooting angle and distance, a rectangular or polygonal ROI containing the crack is delineated in the new image. The ROI is typically 20%-50% larger than the crack itself to ensure complete coverage of the crack area and inclusion of some background information. Through coarse localization, the system reduces the segmentation task from the entire image (potentially thousands × thousands of pixels) to the ROI (potentially hundreds × hundreds of pixels), significantly reducing computational load. Fine segmentation is then performed within the ROI, selecting an appropriate segmentation algorithm based on the characteristics of the crack and the complexity of the background. For high-contrast, simple backgrounds, threshold-based segmentation methods can be used. For example, Otsu's method automatically calculates the optimal threshold to binarize the image, or adaptive thresholding methods calculate different thresholds for different local regions of the image. Thresholding segmentation is simple and efficient, quickly extracting the approximate outline of cracks. For complex backgrounds and uneven contrast between cracks and backgrounds, more advanced segmentation methods are needed. Region-growing segmentation methods start from the seed point of the crack (which can be automatically determined through edge detection or morphological operations) and gradually expand outwards, incorporating neighboring pixels with similar gray values and textures into the crack region until a stopping criterion is met. Region-growing methods can handle the continuity and branching structure of cracks well. Segmentation based on active contour models (such as the snake model and level set methods) defines an energy function, allowing the contour curve to evolve to the crack boundary position under image gradient and smoothness constraints. Active contour models can obtain smooth, continuous boundary curves and are robust to noise and local disturbances.
[0056] For particularly complex backgrounds or situations where multiple types of cracks coexist, deep learning-based semantic segmentation methods can be employed. Deep learning semantic segmentation networks (such as U-Net, SegNet, FCN, and DeepLab) learn complex feature representations and contextual information of cracks by training on a large number of labeled crack images, enabling end-to-end pixel-level classification. These networks typically employ an encoder-decoder structure: the encoder progressively extracts high-level semantic features through multiple layers of convolution and pooling, while the decoder progressively restores spatial resolution through upsampling and convolution, ultimately predicting the category (crack or background) for each pixel. The advantage of deep learning methods lies in their ability to handle various complex situations, including uneven lighting, shadow occlusion, and background texture interference, offering high segmentation accuracy and strong generalization ability. The system can pre-train a general crack segmentation model and fine-tune it according to specific application scenarios (such as different building materials or different crack types) to achieve optimal segmentation results. The preliminary segmentation results usually require post-processing to improve quality. Morphological processing is a commonly used post-processing method: opening operations (erosion followed by dilation) can remove small noise and tiny false detection areas; closing operations (dilation followed by erosion) can fill small voids inside cracks and connect broken crack segments; skeleton extraction can refine coarse crack regions into single-pixel-wide centerlines, facilitating subsequent length and direction analysis. Connectivity analysis can identify independent connected regions in the segmentation results and filter out obvious false detection areas (such as noise with too small an area or regions whose aspect ratio does not conform to crack characteristics) based on the size, shape, and other features of the regions. Boundary smoothing can smooth rough boundaries using methods such as polynomial fitting and spline interpolation, removing jagged edges and obtaining continuous curves that better match the actual crack morphology. After these post-processing steps, the system obtains high-quality pixel-level crack boundaries, which are represented in the form of coordinate sequences or binary masks: coordinate sequences are sequentially arranged boundary point coordinates, suitable for describing simple single contours; binary masks are binary images of the same size as the original image, with pixel values of 1 at crack locations and pixel values of 0 at background locations, suitable for describing complex multi-branched and network cracks. Pixel-level boundaries accurately identify the location and shape of cracks in images, providing an accurate data foundation for subsequent type classification, parameter measurement, and risk assessment.
[0057] After obtaining the pixel-level boundaries of the cracks, the crack types are classified according to the morphological characteristics of these boundaries, resulting in crack type labels. Crack type classification is a crucial step in crack identification because different types of cracks often correspond to different causal mechanisms and degrees of harm, and the classification results directly affect subsequent risk assessments and maintenance recommendations. Building cracks can be classified into various types based on their morphological characteristics, each with its specific visual appearance and cause. Linear cracks are the most common type, appearing as a single straight or near-straight line, usually caused by uneven settlement, temperature stress, or uneven structural stress in the building. Linear cracks are characterized by a length much greater than their width, with an aspect ratio typically greater than 10 or even exceeding 100. The crack extends along a dominant direction with relatively low curvature (zero curvature if it is a straight line). Based on the direction of extension, linear cracks can be further subdivided into vertical cracks, horizontal cracks, and diagonal cracks. Cracks in different directions may indicate different causes: vertical cracks are often related to building settlement, horizontal cracks may be related to floor stress or temperature stress, and diagonal cracks may be related to shear forces. Network cracks appear as a grid-like pattern formed by multiple interwoven cracks, typically caused by material shrinkage, aging, or surface layer peeling. They are characterized by multiple intersections and closed loops, forming polygonal grid units between cracks. Individual cracks are relatively short, and the overall distribution is dense. Radial cracks appear as multiple cracks radiating outwards from a central point, usually caused by localized concentrated loads, impacts, or uneven foundation settlement. They are characterized by a distinct radiating center from which multiple cracks emanate, with the angles between cracks being approximately equal or exhibiting a certain regularity. Crazing is a special type of network crack, characterized by dense, fine cracks forming a pattern resembling a tortoise shell, typically caused by surface material shrinkage, aging, or temperature cycling. Crazing is characterized by very small crack widths (usually less than 1 mm), numerous cracks, dense distribution, and small, relatively uniform grid units.
[0058] Crack type classification is based on morphological features extracted from pixel-level boundaries. First, topological analysis of the cracks is performed to identify their connectivity, branching structure, and closed loops. For a single connected crack, its linearity is determined by analyzing the curvature distribution and aspect ratio of its skeleton lines: if the average curvature of the skeleton lines is less than a threshold (e.g., 0.1 radians / pixel) and the aspect ratio is greater than a threshold (e.g., 10), it is classified as a linear crack. Further analysis of the dominant direction of the skeleton lines (which can be determined by least squares fitting of a straight line or principal component analysis) determines whether it is a vertical, horizontal, or oblique crack. For cracks with multiple branches, the system analyzes the number of branches, the location of branch points, and the angular relationships between branches. If the branches are mainly concentrated in a central region and radiate outwards from that center, it is classified as a radial crack; if the branches are dispersed throughout the crack region and form multiple intersections and closed loops, it is classified as a network crack or a crazing crack. To distinguish between network cracks and crazing cracks, the system analyzes the crack density and the size of the mesh cells: the crack density (crack length per unit area) of crazing cracks is typically much higher than that of ordinary network cracks, and the average size of the mesh cells is also smaller. In addition to geometric morphological features, the system can also utilize texture and statistical features to aid classification. For example, reticular cracks and alligator cracks have specific texture patterns that can be extracted and used for classification using texture descriptors such as LBP and GLCM. Crack type classification can be achieved through a rule-based system, i.e., setting classification rules based on the aforementioned morphological features; or it can be achieved through a machine learning classifier, using algorithms such as decision trees, random forests, support vector machines, or neural networks to train a classification model on labeled crack samples. The advantage of machine learning methods lies in their ability to automatically learn complex distinguishing patterns between different types of cracks and handle cases with ambiguous boundaries (such as a crack simultaneously exhibiting linear and reticular features). The classification results are output in the form of labels, such as "vertical linear crack," "reticular crack," and "radial crack," which provide important qualitative information for subsequent causal analysis and risk assessment.
[0059] After type classification, the geometric parameters of the cracks are measured and converted into physical units based on the pixel-level boundaries of the cracks, resulting in crack geometric parameter data. Crack geometric parameters are key quantitative indicators for assessing crack severity, mainly including length, width, and area. Parameter measurement is based on pixel-level boundaries, but careful design of the measurement algorithm is required to ensure accuracy. Measuring crack length first requires extracting the crack skeleton line, which is the topological center line of the crack region, representing the crack's extension path. Skeleton extraction can use a morphological thinning algorithm, iteratively removing boundary pixels (while maintaining connectivity and topological structure), gradually refining the crack region into a single-pixel-wide skeleton. After obtaining the skeleton, the system accumulates the lengths of all line segments along the skeleton from the start to the end. For straight skeletons, the Euclidean distance between the start and end points can be simply calculated; for curved skeletons, the skeleton needs to be discretized into a series of adjacent pixels, and the distances between adjacent pixels are calculated and accumulated. The distance between adjacent pixels is determined by their relative positions: the distance between horizontal or vertical adjacent pixels is 1 pixel unit, and the distance between diagonally adjacent pixels is... The crack is represented by a pixel unit. The accumulated skeleton length is the pixel length of the crack in the image. Measuring the crack width is relatively complex because crack widths are usually non-uniform, and the width can vary significantly at different locations along the crack. A common method for measuring width is to calculate the cross-sectional width perpendicular to the skeleton direction at multiple sampling points along the skeleton line. Specifically, a series of sampling points are selected at equal intervals along the skeleton line. At each sampling point, the local tangent direction of the skeleton is calculated (approximately by connecting adjacent skeleton points). Then, the normal direction perpendicular to the tangent direction is calculated. The two intersection points of the crack boundary are found along the normal direction, and the distance between these two intersection points is the crack width at that location. By statistically analyzing the widths of all sampling points, we can obtain statistics such as the average width, maximum width, and minimum width of the crack. The average width reflects the overall thickness of the crack, and the maximum width reflects the location of the most severe crack. This information is important for risk assessment. Measuring the crack area is relatively simple; we can directly count the number of pixels within the crack area. For a crack boundary represented by a binary mask, the area is equal to the total number of pixels with a value of 1 in the mask.
[0060] After obtaining the geometric parameters of the pixel units, they need to be converted into physical units (such as millimeters, centimeters, meters) to have practical engineering significance. The key to this conversion is determining the spatial resolution of the image, that is, the actual physical size corresponding to each pixel. There are several methods for determining spatial resolution. The most direct method is to place a calibration object of known size (such as a ruler, calibration board, or a marker of a specific size) at the shooting location, with the calibration object on the same plane or at the same depth as the building surface being inspected. Measure the pixel size of the calibration object in the image, and divide the actual physical size of the calibration object by the pixel size to obtain the spatial resolution (millimeters / pixel). For example, if a ruler with an actual length of 100 millimeters occupies 500 pixels in the image, the spatial resolution is 100 / 500 = 0.2 millimeters / pixel. This method is simple and reliable, but it requires placing the calibration object for each shooting, which is inconvenient.
[0061] Another method is to calculate spatial resolution using camera calibration parameters and shooting distance. If the camera's focal length f, sensor size, image resolution, and the distance D from the camera to the surface being inspected are known, the spatial resolution can be calculated using geometric relationships. According to the pinhole imaging principle, spatial resolution = (D × sensor pixel size) / f. For example, if the camera focal length is 20 mm, the sensor pixel size is 5 micrometers (0.005 mm), and the shooting distance is 5 meters (5000 mm), then the spatial resolution = (5000 × 0.005) / 20 = 1.25 mm / pixel. This method does not require a calibration object but requires accurate measurement of the shooting distance, which can be estimated using a laser rangefinder or from GPS and barometer data from a drone. For multiple inspections of the same building, if the shooting position and angle are relatively fixed, a pre-calibration can be performed to establish the correspondence between the shooting position and the spatial resolution, and the calibration results can be directly used in subsequent inspections. After obtaining the spatial resolution, multiply the geometric parameters of the pixel unit by the spatial resolution to obtain the geometric parameters of the physical unit: Physical length = pixel length × spatial resolution, Physical width = pixel width × spatial resolution, Physical area = pixel area × (spatial resolution). 2 The converted geometric parameter data are expressed in standard units (such as millimeters and square millimeters), which can intuitively reflect the actual physical state of the cracks and provide a reliable quantitative basis for engineering evaluation.
[0062] After obtaining the geometric parameters of the crack, the system assesses the severity of the crack and classifies its risk level based on these parameters and the crack location information corresponding to the pixel-level boundaries. Crack risk assessment is a comprehensive decision-making process that requires consideration of information from multiple dimensions and weighted summation. Geometric parameters are the primary factor in risk assessment; generally, larger geometric parameters indicate a more severe crack. The impact of crack length is significant: long cracks may penetrate the entire structural member, affecting the structural integrity and load-bearing capacity. Cracks exceeding a certain threshold (such as 1 meter or spanning the entire wall) are generally considered severe cracks. The impact of crack width is even more direct, as it reflects the degree of crack opening. Excessively wide cracks not only affect structural strength but may also lead to secondary problems such as steel corrosion and leakage.
[0063] According to engineering specifications, there are usually clear limits on crack width: cracks less than 0.2 mm wide are generally considered harmless or minor cracks with minimal impact on structural safety; cracks between 0.2 and 0.3 mm wide are cracks requiring observation; cracks wider than 0.3 mm are considered harmful cracks requiring treatment; and cracks wider than 1 mm are considered serious cracks that may pose a threat to structural safety. Crack area reflects the cumulative impact of cracks. Large-area network cracks or crazing, even if individual cracks are not severe, can cause significant overall damage and require attention.
[0064] Crack location information is another crucial factor in risk assessment. Different parts of a building structure have varying importance and stress states, resulting in different levels of hazard from cracks. Cracks located in load-bearing structures pose the highest risk because these areas directly impact the building's structural safety. Load-bearing structures include beams, columns, load-bearing walls, and floor slabs. These components bear the primary loads, and severe cracks can lead to reduced load-bearing capacity or even structural instability. For example, vertical cracks in the middle of a beam may indicate bending cracks, diagonal cracks at the beam ends may indicate shear cracks, and horizontal cracks in columns may indicate compressive failure; all of these require special attention. In contrast, cracks in non-load-bearing areas such as non-load-bearing walls and decorative surfaces, while also requiring attention, have a smaller direct impact on structural safety and a relatively lower risk level. The specific location of the crack is also important: cracks in the middle of a component's span have different implications than those at the ends or nodes; cracks in tension zones differ in hazard from those in compression zones; and through cracks are more dangerous than surface cracks. It is necessary to identify the type and location of cracks based on architectural drawings, structural design information, or image analysis, and incorporate this information into the risk assessment. Crack type is also a factor to consider in risk assessment. Different types of cracks have different causes and hazards: vertical linear cracks, if located on load-bearing walls, may be related to building settlement and require attention to foundation issues; horizontal cracks, if located on floor slabs or beams, may be related to stress or temperature stress; diagonal cracks may be related to shear force and are more dangerous in some cases; network cracks and crazing are usually related to material aging and shrinkage, although their direct impact on structural safety may not be significant, they indicate a decline in material performance and may require repair or reinforcement; radial cracks may indicate localized concentrated loads or impacts, requiring investigation of the load source.
[0065] Based on this multi-dimensional information, a comprehensive assessment model is used to determine the risk level of cracks. The assessment model can be a rule-based expert system, which classifies risk levels by setting a series of judgment rules. For example: "If the crack width is >1 mm and it is located on a load-bearing beam, the risk level is critical; if the crack width is between 0.3 and 1 mm and it is located on a load-bearing wall, the risk level is high; if the crack width is <0.3 mm and it is located on a non-load-bearing wall, the risk level is low." The advantage of rule-based systems is their clear logic, strong interpretability, and alignment with engineers' thinking habits. However, setting rules requires extensive expert knowledge and experience, and it is difficult to handle conflicts and boundary conditions between rules. The fuzzy logic assessment method defines fuzzy sets and membership functions to map precise parameter values (such as a crack width of 0.25 mm) to fuzzy linguistic variables (such as a membership degree of 0.6 for "relatively wide"). Then, a comprehensive assessment is performed using fuzzy inference rules, and finally, the risk level is obtained through defuzzification. Fuzzy logic can better handle uncertainties and fuzzy boundary conditions, and is more in line with the characteristics of actual engineering judgments. Machine learning evaluation methods train classification or regression models on a large number of labeled crack samples to automatically learn the complex mapping relationship between geometric parameters, location information, crack type, and risk level. Algorithms such as decision trees, random forests, and neural networks can be used. Input features include crack geometric parameters, location encoding, and type encoding; the output is the risk level or risk score. The advantage of machine learning methods lies in their ability to automatically discover patterns in data and handle high-dimensional nonlinear relationships, but they require a large amount of high-quality labeled data for training. In practical applications, the system can use a combination of methods, such as first using a rule-based system to handle clearly defined high-risk and low-risk situations, and then using a machine learning model to refine the judgment for ambiguous intermediate situations. Risk levels are typically divided into four to five categories: Low risk (or harmless cracks) indicates that the cracks have minimal impact on structural safety and can be observed without immediate intervention; Medium risk (or cracks requiring observation) indicates that the cracks have some impact but have not yet reached a dangerous level, requiring enhanced monitoring and attention to their development; High risk (or harmful cracks) indicates that the cracks have posed a certain threat to structural safety and require timely development and implementation of repair plans; Emergency risk (or dangerous cracks) indicates that the cracks pose a serious threat to structural safety and require immediate temporary reinforcement measures or restrictions on use, with urgent treatment arrangements. Each risk level corresponds to different handling strategies and response time requirements, providing clear guidance for building management decisions.
[0066] Finally, the crack location information corresponding to the pixel-level boundary of the crack, the crack type label, the crack geometric parameter data, and the crack risk level are integrated to obtain the crack status report. The crack status report is the final output of the crack detection system. It is a structured and standardized technical document that provides authoritative data support for building safety management, maintenance decisions, insurance claims, and safety assessments. The report integration process is not a simple accumulation of information, but rather requires the organic organization of the data obtained from the aforementioned stages to form a logically clear, complete, and easy-to-understand document. Crack location information is the foundation of the report, including multiple levels of location description: macroscopic location information identifies the specific location of the crack in the building, such as building number or name, floor number, room number, wall location (east wall, west wall, south wall, north wall), component type (beam, column, floor slab, wall, etc.), component number, etc.; microscopic location information provides the precise coordinates of the crack in the image, represented in pixel-level boundary form, which can be a coordinate sequence, binary mask, or vector graphics; geographic location information, if the acquisition device has GPS, can also record the geographic coordinates of the shooting location, facilitating map marking and navigation. The crack type label is the qualitative description section of the report, identifying the crack morphology classification, such as "vertical linear crack," "horizontal linear crack," "network crack," "radial crack," and "crazing." The type label not only describes the crack's appearance but also suggests possible causes, providing clues for further analysis by professionals. The crack geometric parameter data is the quantitative measurement section of the report, providing precise values for parameters such as crack length, average width, maximum width, and area, using standard physical units (e.g., millimeters, square millimeters). This parameter data is the objective basis for assessing crack severity and serves as the benchmark for subsequent monitoring of crack development trends. The crack risk level is the assessment conclusion section of the report, providing a professional judgment on the crack's severity, such as "low risk," "medium risk," "high risk," and "critical risk." The risk level is a conclusion derived from comprehensively considering factors such as geometric parameters, location, and type, providing clear guidance for management decisions.
[0067] As one implementation, the crack geometry parameter data includes crack length, crack width, and crack area.
[0068] Specifically, crack length refers to the total length of a crack along its extension direction. For straight cracks, the length is the distance from the starting point to the ending point; for curved or branching cracks, the length is the cumulative length along the crack skeleton line. Crack length reflects the extent of crack expansion and is an important parameter for assessing the area affected by the crack. Crack width refers to the opening size perpendicular to the crack's extension direction. Since crack width may vary along its length, it is usually necessary to measure the width at multiple locations and statistically analyze the average, maximum, and minimum widths. Crack width is a key indicator for judging the severity of a crack. According to building codes, cracks of different widths correspond to different hazard levels. For example, cracks less than 0.2 mm wide are generally considered harmless, those between 0.2 and 0.3 mm require observation, and those greater than 0.3 mm require treatment. Crack area refers to the two-dimensional surface area occupied by the crack. For wider cracks or network cracks, the area parameter better reflects the overall scale of the crack. The rate of increase in crack area is also an important indicator for monitoring crack development. These three geometric parameters together constitute a quantitative description system of crack conditions, providing objective measurement basis for crack assessment and monitoring.
[0069] As one implementation method, based on the crack status report, historical crack data is extracted and organized according to time series to obtain a time-series crack dataset; based on the time-series crack dataset, the rate of change and trend of change of crack geometric parameters are calculated using time series analysis methods to obtain crack development trend prediction results; based on the crack risk level in the crack status report and the crack development trend prediction results, a multi-level early warning mechanism including primary early warning, intermediate early warning, and advanced early warning is designed to obtain graded early warning rules; based on the graded early warning rules, combined with the current crack status, an early warning signal of the corresponding level is triggered, and targeted maintenance suggestions are generated according to the crack type, location, and severity to obtain early warning information and maintenance plan; based on the early warning information and maintenance plan, a real-time monitoring process is established and crack status data is continuously updated to obtain the real-time monitoring and early warning system.
[0070] Specifically, based on the crack status report, historical crack data is extracted and organized according to time series to obtain a time-series crack dataset. The time-series crack dataset is the foundation for crack development trend analysis and a key data structure for transitioning from single-detection to continuous monitoring. The development of building cracks is a dynamic process; the geometric parameters and risk levels of the cracks change over time. These changes contain important information: is the crack stable, developing slowly, or deteriorating rapidly? Is the crack development linear, accelerating, or periodic? Is the crack status related to environmental factors (such as temperature, humidity, and load)? This information is crucial for assessing the future development trend of cracks, predicting potential risks, and formulating maintenance strategies. Obtaining this information requires establishing a complete and accurate time-series crack dataset. The construction of the time-series dataset first requires extracting relevant data from the historical crack status report database. The database stores a large number of crack detection records, each corresponding to a detection task, including the detection time, detection location, and detailed information on all detected cracks. The system searches the database for all historical records related to the crack that needs to be monitored. This process faces a key technical challenge: crack matching, i.e., how to confirm whether cracks detected at different time points are the same crack. Due to variations in factors such as shooting angle, lighting conditions, and image quality, the same crack may appear differently in images from different times; furthermore, multiple cracks may exist on a building, new cracks may appear, and old cracks may evolve or be repaired. Therefore, a reliable matching method is needed to establish the temporal correlation of cracks.
[0071] Crack matching is based on a comprehensive judgment using information at multiple levels. First is location information matching, which is the most basic and crucial matching criterion. This involves comparing macroscopic location information of the cracks, such as building number, floor, wall location, component type, and other metadata. If the macroscopic location information of two cracks is inconsistent (e.g., one on the east wall and the other on the west wall), they are clearly not the same crack. For cracks with consistent macroscopic locations, microscopic location information, i.e., the crack's coordinates in the image, is further compared. Since the shooting position and angle may vary slightly at different times, the image coordinates will not be completely identical, but should be within a certain tolerance range. Image registration techniques (such as feature point matching and image transform estimation) can be used to align images from different times to the same coordinate system, and then the crack's location coordinates can be compared. Second is morphological feature matching. Although the same crack may develop at different times (increasing in length, width, etc.), its basic morphological features should remain similar. The system compares morphological features such as crack type labels (e.g., all are vertical linear cracks), dominant direction (e.g., all extend along a north-south direction), and branching structure (e.g., the location and number of branch points). If two cracks have significantly different morphological characteristics (e.g., one is a linear crack and the other is a network crack), they are unlikely to be the same crack. The third method is feature vector matching. The system uses the aforementioned constructed feature vectors (compact feature vectors) to calculate the similarity between cracks at different times. If the feature vectors of two cracks are highly similar (the similarity exceeds a threshold), they are likely records of the same crack at different times. Feature vector matching can capture subtle features of cracks, improving matching accuracy. The fourth method is temporal logic constraints. The development of the same crack should conform to physical laws and temporal logic: the length and width of the crack are usually monotonically increasing (unless repaired), and cannot suddenly decrease significantly; the development speed of the crack should be within a reasonable range, and cannot change drastically in a short period of time (e.g., the length increases from 10 cm to 1 meter within a week); newly appearing cracks should be marked as "new" and should not be matched with old cracks. By integrating this information and constraints, the temporal matching relationship of cracks can be reliably established.
[0072] After matching is confirmed, key information for each matching record is extracted, including the detection time (accurate to year, month, day, and even hour, minute, and second), crack geometric parameters (length, average width, maximum width, area, etc.), crack type, crack risk level, detection environmental conditions (light, temperature, humidity, etc.), and information on detection personnel and equipment. This information is arranged in chronological order of detection time, forming a time series. For each monitored crack, the system establishes a time series dataset, recording the complete evolution of the crack from its initial discovery to the most recent detection. The data structure of the time series dataset is typically tabular, with each row corresponding to a detection record at a specific time point, and each column corresponding to a parameter or attribute. For example, a typical time-series dataset might contain the following: detection date (2023-01-15, 2023-04-20, 2023-07-18, etc.), crack length (120mm, 135mm, 158mm, etc.), average width (0.18mm, 0.22mm, 0.28mm, etc.), maximum width (0.25mm, 0.31mm, 0.42mm, etc.), and crack area (216mm²). 2 297mm 2 442mm 2 The quality of time-series datasets directly affects the accuracy of subsequent trend analysis; therefore, the system needs to clean and preprocess the data. Data cleaning includes removing outliers, handling duplicate records, and imputing missing data. Outliers may be caused by measurement errors, data entry errors, or abnormal detection conditions. For example, the crack width in a certain detection record may suddenly be abnormally large or small, showing a significant inconsistency with previous and subsequent records. The system uses statistical methods (such as the 3σ criterion, box plot method, etc.) or time-series model-based methods to detect outliers and decides whether to remove, correct, or mark them as suspected anomalies based on the specific circumstances. Duplicate records may be due to multiple detections or duplicate data entry on the same day. The system identifies and removes duplicate records, retaining the most reliable one. Missing data is a common problem in time-series analysis. Due to various reasons (such as equipment failure, personnel changes, weather effects, etc.), detection records may be missing at certain points in time, resulting in discontinuities in the time series. The system determines its processing strategy based on the proportion and pattern of missing data: if the missing rate is low (e.g., less than 10%), interpolation methods can be used to fill in the missing values. Commonly used interpolation methods include linear interpolation (linear estimation using values from previous and subsequent time points), spline interpolation (fitting with a smooth curve), or prediction interpolation based on a time series model. If the missing rate is high or the missing period is long, the missing data is retained, and methods capable of handling missing data are used in subsequent analyses. After cleaning and preprocessing, a high-quality time series crack dataset is obtained, laying a solid data foundation for subsequent trend analysis and prediction.
[0073] Based on the time-series dataset, and according to the aforementioned time-series crack dataset, time series analysis methods are used to calculate the rate of change and trend of crack geometric parameters, obtaining crack development trend prediction results. Time series analysis is a methodology system in statistics and data science specifically for studying the characteristics and patterns of time-series data, including multiple levels such as descriptive analysis, trend analysis, periodic analysis, and predictive modeling. In crack monitoring applications, the goal of time series analysis is to extract regular information about crack development from historical data, identify crack state types (stable, slow development, rapid deterioration, etc.), quantify the crack development speed, predict the future state of cracks, and provide a scientific basis for risk assessment and early warning decisions. Trend analysis is a fundamental method of time series analysis, aiming to identify the long-term trend of data, that is, the overall trend of data after removing short-term fluctuations and random noise. The simplest trend analysis method is linear regression, which uses time as the independent variable and crack parameters (such as width) as the dependent variable to fit a straight line. The slope of the line reflects the average rate of change of the parameters; a positive slope indicates that the parameters increase over time (crack development), a negative slope indicates that the parameters decrease (possibly after repair or seasonal contraction), and a slope close to zero indicates that the parameters are relatively stable. The goodness of fit (e.g., R²) is calculated. 2 The R-value can be used to assess the significance of a linear trend: 2 A value close to 1 indicates that the data highly conforms to a linear trend; R0 2 A smaller value indicates an unclear trend or the presence of nonlinear characteristics. For nonlinear trends, the system can use methods such as multinomial regression, exponential regression, or logarithmic regression to fit the curve. For example, if the crack development shows an accelerating trend (the rate of change is constantly increasing), it can be fitted with a quadratic polynomial or exponential function; if the development speed gradually slows down, it can be fitted with a logarithmic function or power function. Identifying nonlinear trends is particularly important for risk assessment: cracks that develop at an accelerating rate indicate that the damage process is deteriorating, the risk is rapidly increasing, and high attention is required; while cracks that develop at a decelerating rate or tend to stabilize indicate that the damage process may be suppressed or the structure has adapted to a new equilibrium state, and the risk is relatively controllable.
[0074] The rate of change calculation complements and refines trend analysis. By calculating the difference or derivative of parameters at adjacent time points, it quantifies the instantaneous development speed of cracks. There are several definitions of the rate of change: absolute rate of change is defined as the absolute difference of parameters between two adjacent measurements divided by the time interval, such as the absolute rate of change of crack width = (current width - previous width) / (current measurement date - previous measurement date), in mm / day or mm / month; relative rate of change is defined as the absolute rate of change divided by a baseline value (such as the previous parameter value or average value), in % / month or % / year. The relative rate of change better reflects the development speed relative to the current state. The system calculates the rate of change for each time period, forming a time series of rates of change, and then performs statistical analysis: calculating the average rate of change, the maximum rate of change, and the standard deviation of the rate of change. The average rate of change reflects the average speed of crack development and is a quantitative indicator of long-term trends; the maximum rate of change reflects the period of fastest crack development, which may correspond to a specific event (such as earthquakes, major loads, extreme temperatures, etc.); the standard deviation of the rate of change reflects the degree of fluctuation in the development speed. A large standard deviation indicates that the development speed is unstable and may be significantly affected by external factors. By analyzing the rate of change, the system can identify the stage characteristics of crack development: if the rate of change is consistently positive and relatively stable, it indicates that the crack is developing steadily; if the rate of change gradually increases, it indicates that the development is accelerating; if the rate of change fluctuates between positive and negative, it may indicate that the crack has periodic opening and closing (such as temperature cracks).
[0075] Periodicity analysis is an advanced method in time series analysis designed to identify periodic or seasonal patterns in data. Certain types of cracks, particularly those caused by temperature stress, may exhibit pronounced periodic variations. For example, concrete structures expand during the high temperatures of summer, potentially closing or narrowing cracks; conversely, they contract during the low temperatures of winter, opening or widening cracks. This periodicity causes crack widths to fluctuate annually or seasonally. Identifying this periodicity is crucial for correctly interpreting crack condition changes: neglecting periodicity might lead to misinterpreting increased width in winter as crack deterioration or decreased width in summer as crack healing. Methods for periodicity analysis include autocorrelation analysis, spectral analysis, and seasonality decomposition. Autocorrelation analysis identifies periodic patterns by calculating the correlation coefficient of the time series at different time lags: if periodicity exists, the autocorrelation function will peak at integer multiples of the period. Spectral analysis transforms the time series from the time domain to the frequency domain using Fourier transform, identifying the main periodic components and their intensity. Seasonal decomposition (such as STL decomposition, Census X-12, etc.) decomposes time series into trend components, seasonal components, and stochastic components, enabling the simultaneous extraction of long-term trends and periodic patterns. Through periodic analysis, the system can establish more accurate crack behavior models, distinguishing between genuine structural developments and reversible environmental impacts.
[0076] Predictive modeling is the highest-level application of time series analysis. Its goal is to predict the possible values of future crack parameters based on historical data, providing a basis for forward-looking decision-making. There are various types of predictive models, ranging from simple extrapolation methods to complex machine learning models. The simplest prediction method is trend extrapolation, which extends the fitted trend line (linear or non-linear) to future time points to obtain predicted parameter values. This method assumes that future trends are consistent with historical trends and is suitable for situations with stable trends and small fluctuations. ARIMA (Autoregressive Moving Average) is a classic time series prediction model. It makes one or more forward predictions by establishing a linear relationship between current and historical values, as well as a relationship between current and historical errors. ARIMA models can capture the autocorrelation structure and short-term fluctuations of data and are suitable for stationary or differenced time series. Exponential smoothing methods (such as simple exponential smoothing, Holt linear trend method, Holt-Winters seasonality method, etc.) predict future values by weighting historical data (with greater weight for recent data and less weight for older data). They can adaptively track data changes and are suitable for situations with trends and seasonal variations. In recent years, deep learning methods have made significant progress in time series forecasting, especially recurrent neural network architectures such as Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs). These models can learn long-term dependencies and complex nonlinear patterns in time series, demonstrating excellent performance in multivariate, long-term forecasting tasks. The appropriate model should be selected based on the characteristics of the data and the forecasting requirements: for cases with limited data and simple trends, simple extrapolation or exponential smoothing can be used; for cases with abundant data and complex patterns, ARIMA or deep learning models can be used. The forecast results include not only point estimates of parameters (e.g., predicting a crack width of 0.35 mm after 3 months) but also prediction intervals or confidence intervals (e.g., a width between 0.30 and 0.40 mm at 95% confidence), reflecting the uncertainty of the forecast.
[0077] The analysis results are presented in charts and numerical formats, providing users with intuitive and easy-to-understand information. The curves showing the change of crack parameters over time are the most basic and intuitive form of display. The horizontal axis represents time (e.g., month or day), and the vertical axis represents the parameter value (e.g., width in mm). Points on the curve represent historical detection data, and the curve can be connected using line graphs or fitted with a smooth curve. Trend lines (showing long-term trends), prediction curves (showing future predicted values and confidence intervals), and warning threshold lines (showing safety limits) can be overlaid on the same chart to help users quickly understand the historical evolution and future trends of cracks. For multiple parameters (e.g., length, width, area), multiple sub-charts or multiple curves (distinguished by different colors) can be displayed simultaneously for easy comparative analysis. The rate of change chart shows the change in the speed of crack development, with the horizontal axis representing time and the vertical axis representing the rate of change (e.g., mm / month). Bar charts or line charts show the rate of change for each time period, supplemented by a reference line for the average rate of change. Periodic analysis results can be displayed using a seasonal decomposition chart, plotting the original data, trend components, seasonal components, and random components in four separate sub-charts, clearly presenting the multi-level structure of the data. Numerical statistical tables provide precise quantitative information, including current parameter values, average rate of change, predicted values, confidence intervals, and risk assessments. For rapidly developing cracks, a warning signal is given on the chart using a striking color or marker (such as a red warning icon), prompting the user to increase the monitoring frequency or take intervention measures. These rich visualizations and numerical analysis results transform crack development trend prediction from an abstract data model into a concrete and actionable decision-making basis, providing forward-looking technical support for building safety management.
[0078] Based on a comprehensive assessment of the current state and development trend, and according to the crack risk level in the crack status report and the crack development trend prediction results, a multi-level early warning mechanism including primary, intermediate, and advanced early warnings is designed, resulting in graded early warning rules. The multi-level early warning mechanism is the core function of the real-time monitoring system. It combines the static assessment (current state) and dynamic assessment (development trend) of cracks, realizing a shift from passive response to proactive prevention. Risk assessment based solely on the current state has significant limitations: a crack currently classified as "low-risk" may rapidly evolve into a high-risk crack in the short term; conversely, a crack currently classified as "medium-risk" may not pose a high actual risk if it remains stable over a long period. Therefore, the early warning mechanism needs to comprehensively consider the current risk level and future development trend of the crack, setting scientifically reasonable early warning trigger conditions. Primary early warning is the first line of defense in the early warning system, targeting cracks that, while currently not at high risk, have potential hidden dangers. Triggering conditions for a primary warning include: crack width or length within a safe range but a rate of change exceeding a threshold, for example, a crack currently 0.15 mm wide (below the harmless limit of 0.2 mm) but with a monthly growth rate of 0.03 mm / month, which, at this rate, will approach the harmful crack standard in two months; newly appearing cracks, although small in size, are located in critical areas, such as new cracks on load-bearing beams or columns, requiring close monitoring even if the initial width is small; multiple cracks appearing successively in the same area within a short period may indicate a systemic problem in that area; the crack development trend shifts from stable to increasing, even if the growth rate is not fast, the change in trend itself is a warning signal. Recommended measures for primary warnings include increasing monitoring frequency, from routine quarterly monitoring to monthly or even weekly monitoring, to more promptly capture crack changes. Intermediate warnings target cracks of medium risk or developing rapidly, which are approaching or have reached a level requiring intervention. The triggering conditions for an intermediate-level warning include: crack width approaching the code limit, such as 0.25-0.30 mm, which, although not exceeding the 0.3 mm harmful crack standard, is close to the critical value; crack length significantly increasing in a short period, such as an increase of more than 20% within a month or an absolute increase exceeding a certain threshold (e.g., 50 mm); multiple cracks appearing densely in the same component or area, with crack density exceeding the safety threshold; and trend prediction indicating that the cracks will develop into a high-risk state in the near future (e.g., within 1-3 months). Recommended measures for an intermediate-level warning include: conducting professional structural inspection and assessment, with on-site inspection by professional engineers to analyze the causes of the cracks and their impact on the structure; preparing repair plans, including repair method selection, material preparation, and construction plans, for rapid implementation when necessary; and strengthening monitoring, such as using more precise monitoring methods, like installing crack gauges and strain gauges for continuous monitoring.Advanced warning is the highest level of the early warning system, targeting high-risk or rapidly deteriorating cracks that pose a threat to structural safety and require immediate action. Triggering conditions for advanced warnings include: crack width exceeding code limits (e.g., exceeding 0.3mm or even 0.5mm); cracks exhibiting accelerated development with a continuously increasing rate of change (e.g., the current month's growth rate is more than double that of the previous month); the appearance of penetrating cracks or cracks causing significant structural deformation; and crack development accompanied by other abnormal phenomena such as concrete spalling, exposed rebar, and water seepage. Advanced warnings require immediate temporary reinforcement measures, such as external reinforcement of the cracked area with steel plates or carbon fiber cloth, and using supports or top bracing to distribute the load, to prevent further crack development or structural instability. It may be necessary to restrict the use of the affected area, such as prohibiting personnel entry, reducing load, or suspending use until thorough repair and reinforcement are completed. Emergency arrangements should be made for professional repair and reinforcement work, prioritizing resource allocation and implementing treatment as quickly as possible. The design of tiered early warning rules needs to combine building codes, engineering experience, and statistical data to ensure the timeliness, accuracy, and operability of the warnings. Rules can be implemented using decision trees, rule engines, or fuzzy logic systems, supporting complex logical combinations and priority judgments.
[0079] Based on the early warning rules, and combined with the current crack status, the system triggers an early warning signal of the corresponding level. It then generates targeted maintenance suggestions based on the crack type, location, and severity, resulting in early warning information and a maintenance plan. Early warning triggering is an automated, real-time process that continuously monitors the crack status database. Whenever new crack detection data is input or during periodic automatic evaluations, the early warning engine immediately assesses the status of all monitored cracks. The assessment process includes: extracting the latest parameter values and historical time-series data of the cracks; calculating the rate of change and development trend; comparing them with the trigger conditions in the hierarchical early warning rules; and determining whether the trigger conditions for any early warning level are met. Once a trigger condition is detected, the system immediately generates early warning information. The early warning information is a structured data record containing rich content: the warning level (basic, intermediate, or high), identified by prominent color coding (e.g., green, yellow, red); the triggering reason, detailing which condition(s) triggered the warning, such as "crack width reaches 0.32mm, exceeding the 0.3mm limit" or "the average monthly crack growth rate is 0.05mm / month, exceeding the 0.03mm / month threshold"; detailed information about the relevant cracks, including crack ID, location, current parameter values, historical evolution curves, etc.; the predicted development trend, such as "at the current rate, the width is expected to reach 0.42mm in 2 months"; and recommended response measures. The early warning information is promptly sent to relevant personnel through multiple channels to ensure a rapid response. The interface's alert dashboard displays alert information in real time, attracting user attention with eye-catching visual elements such as flashing warning icons and pop-up windows; emails automatically send alert notifications to a pre-set email address list, containing detailed alert information and quick access links; SMS or mobile push notifications are sent to relevant personnel's mobile phones, especially for advanced alerts, ensuring timely notifications even when personnel are not in the office; the system log records all alert events, including trigger time, alert level, and response status, facilitating post-event traceability and auditing.
[0080] Targeted maintenance recommendations are a crucial output of the early warning system, translating abstract risk assessments into concrete engineering measures and providing actionable guidance for building management and maintenance personnel. Maintenance recommendations are generated based on the multifaceted characteristics of cracks. Crack type is a key consideration: For linear cracks, especially narrow surface cracks, common repair methods include surface sealing (sealing the crack surface with epoxy resin or polymer mortar to prevent moisture and harmful substances from penetrating), grouting repair (for cracks between 0.2-2 mm wide, pressure grouting with low-viscosity epoxy resin or cement-based grout to fill the internal space of the crack), and crack-spanning (attaching steel plates or carbon fiber cloth to both sides of the crack to limit its further expansion). For network cracks or large-area crazing, extensive surface treatment may be required, such as removing loose surface layers, re-plastering or spraying, and applying crack-resistant mesh. For structural cracks, i.e., cracks affecting load-bearing capacity, more specialized reinforcement methods are needed, such as attaching steel plates or carbon fiber cloth, adding supports or beams, grouting reinforcement, and prestressed reinforcement. The location of cracks also affects maintenance strategies: In addition to structural repairs, exterior wall cracks require special attention to waterproofing to prevent rainwater seepage and internal damage or leaks; roof cracks have even higher waterproofing requirements and may require a complete overhaul of the waterproofing layer; cracks in load-bearing structures require priority treatment, and repair methods must ensure that the load-bearing capacity is not reduced; cracks in non-load-bearing areas can be repaired using simpler and more economical methods. The severity of cracks determines the urgency and investment required for maintenance: minor cracks can be included in the routine maintenance plan and do not require emergency treatment; moderate cracks are recommended to be repaired within 3-6 months; severe cracks need to be treated within 1-3 months; dangerous cracks require immediate temporary reinforcement and permanent repair as soon as possible.
[0081] The maintenance plan is a detailed breakdown of maintenance recommendations, including comprehensive technical and management information. The recommended repair methods section describes the specific construction process in detail, such as "Epoxy resin grouting repair: First, clean the cracks, removing dust and loose materials; then install grouting nozzles at 30-50cm intervals; prepare the epoxy resin grout; use a pressure pump to inject from one end at a pressure of 0.2-0.4MPa until overflow from the other end; after curing, remove the grouting nozzles and level the surface." The estimated workload provides material and labor requirements, such as "It is estimated that 5kg of epoxy resin grout, 20 grouting nozzles, and 2 man-days are needed," providing a basis for cost estimation and resource allocation. The urgency section clarifies the time requirements for the repair, such as "It is recommended to complete within 2 weeks" or "Immediate action is required." The referenced technical specifications list relevant national standards, industry specifications, or technical guidelines to ensure that the repair work complies with specifications. Additional precautions highlight any special construction conditions or safety requirements.
[0082] Finally, based on the aforementioned early warning information and maintenance plan, a real-time monitoring process is established and crack status data is continuously updated, resulting in the real-time monitoring and early warning system. The real-time monitoring process is a continuously operating closed-loop system that organically connects data acquisition, analysis and evaluation, early warning triggering, maintenance implementation, and effect verification, forming a cycle of "monitoring-analysis-early warning-maintenance-monitoring." The monitoring process includes two modes: periodic automatic detection and on-demand manual detection, which complement each other. Automatic detection is the technical foundation for real-time monitoring. The system deploys fixed high-resolution cameras or periodically patrolling drones at key locations on the building to automatically collect images according to a preset schedule. Fixed cameras can be installed on opposite buildings, scaffolding, or dedicated monitoring towers, continuously capturing images of the monitoring area 24 hours a day or at fixed time intervals (e.g., daily, weekly). Drones automatically patrol according to preset flight routes and shooting points, completing image acquisition for the entire building or building complex. The acquired images are automatically uploaded to the monitoring system server via wired or wireless networks. The system automatically performs a series of processes, including image preprocessing, feature extraction, crack matching, and status assessment, without manual intervention. The advantages of automated detection lie in its high frequency, low cost, and comprehensiveness, enabling it to capture subtle changes in cracks in a timely manner. It is particularly suitable for intensive monitoring of critical areas or high-risk cracks. Manual detection, on the other hand, involves professional inspectors using portable devices (such as handheld cameras or drones) to collect data on-site upon receiving warning signals, conducting specialized inspections, or when automated detection detects anomalies. The advantages of manual detection are its flexibility and professionalism. Inspectors can adjust the shooting angle, distance, and parameters according to specific circumstances, focusing on capturing and recording suspected problems from multiple angles. They can also simultaneously perform visual inspections and tapping tests to obtain more comprehensive information. Data acquired through manual detection is also uploaded to the system, undergoes the same processing flow, and is integrated into the crack's time-series dataset.
[0083] The results of each inspection are updated in real time to the crack status database, forming a complete time-series record. The database uses a relational or time-series database management system, supporting efficient data storage, querying, and analysis. Each crack in the database maintains a complete file, including basic information (crack ID, initial detection time, location, etc.), time-series inspection records (time of each inspection, parameter values, images, etc.), analysis results (trends, predictions, risk levels, etc.), early warning history (triggered early warnings and response status), and maintenance records (implemented repair measures and their effects). The database supports multi-dimensional queries, such as querying all cracks on a specific floor or wall by location, querying inspection records for a specific period by time, and querying all high-risk cracks by risk level. A visual monitoring dashboard is provided, displaying the current status of all monitored cracks in real time. Dashboards typically include multiple views: an overview view displays the distribution of all monitoring points in the form of a map or building model, uses different colors to indicate cracks of different risk levels, and uses icons to indicate the current warning status; a list view lists key information about all cracks in tabular form, supporting sorting, filtering, and searching; a details view displays complete information about the selected crack, including location, image, parameters, historical curves, warning records, etc.; and a statistics view displays overall statistical information, such as the distribution of crack quantity, type, risk level, and warning frequency. Managers can use the dashboard to quickly understand the overall health status of the building, identify high-risk areas requiring attention, and track the progress of maintenance work.
[0084] Example 2: like Figure 2 As shown, this embodiment provides a building engineering crack detection system based on image recognition, including: The image acquisition module 10 is used to acquire raw image data of the building surface through the acquisition device, and to preprocess the raw image data in sequence to obtain a standardized building surface image. Feature extraction module 20 is used to perform multi-scale decomposition on the standardized building surface image, extract edge features, texture features and directional features on each scale image respectively, and integrate them to obtain a multi-dimensional feature descriptor set; The feature compression module 30 is used to evaluate the importance of each dimension of the features in the multidimensional feature descriptor set, and based on the importance evaluation results, perform feature dimensionality reduction, feature quantization encoding and feature vector compression in sequence to obtain a compact feature vector. The index building module 40 is used to partition the feature space based on the compact feature vector, build a feature index structure, and optimize, compress, and construct a multi-level hierarchy of the feature index structure to obtain a feature index mechanism. The crack matching module 50 is used to acquire newly collected building surface images and extract corresponding compact feature vectors as query feature vectors. Based on the current detection environment and image quality, the tolerance threshold for feature matching is dynamically adjusted. The feature indexing mechanism and the tolerance threshold are used to perform an approximate nearest neighbor search on the query feature vector. The search results are filtered and verified at multiple levels and sorted according to feature similarity to obtain a crack matching result set. The crack analysis module 60 is used to locate crack regions and classify crack types based on the crack matching result set, measure the geometric parameters of cracks and assess crack severity, and integrate the location, type, geometric parameters and severity of cracks to obtain a crack status report. The monitoring and early warning module 70 is used to perform time-series analysis of historical crack data based on the crack status report to monitor the crack development trend, design a multi-level early warning mechanism based on the crack status report and the crack development trend, and provide maintenance suggestions to obtain a real-time monitoring and early warning system.
[0085] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for detecting cracks in building engineering based on image recognition, characterized in that, include: The original image data of the building surface is acquired by the acquisition device, and the original image data is preprocessed sequentially to obtain a standardized building surface image. The standardized building surface image is decomposed into multiple scales, and edge features, texture features, and directional features are extracted from each scale image and integrated to obtain a multi-dimensional feature descriptor set. The importance of each dimension of the feature in the multidimensional feature descriptor set is evaluated. Based on the importance evaluation results, feature dimensionality reduction, feature quantization encoding, and feature vector compression are performed sequentially to obtain a compact feature vector. Based on the compact feature vector, the feature space is partitioned, a feature index structure is constructed, and the feature index structure is optimized, compressed, and constructed in a multi-level hierarchy to obtain the feature index mechanism. Acquire newly collected building surface images and extract corresponding compact feature vectors as query feature vectors. Dynamically adjust the tolerance threshold for feature matching based on the current detection environment and image quality. Perform approximate nearest neighbor search on the query feature vector using the feature indexing mechanism and the tolerance threshold. Perform multi-level filtering and verification on the retrieval results and sort them according to feature similarity to obtain a crack matching result set. Based on the crack matching result set, crack area is located and crack type is classified. The geometric parameters of the crack are measured and the severity of the crack is assessed. The location, type, geometric parameters and severity of the crack are integrated to obtain a crack status report. Based on the crack status report, a time-series analysis of historical crack data is performed to monitor crack development trends. A multi-level early warning mechanism is designed based on the crack status report and the crack development trends, and maintenance suggestions are provided to obtain a real-time monitoring and early warning system.
2. The method according to claim 1, characterized in that, The step of preprocessing the original image data sequentially to obtain a standardized building surface image includes: Based on the original image data, a bilateral filtering algorithm is used for noise reduction, which removes noise while preserving image edge information, resulting in a denoised image. Based on the denoised image, an adaptive histogram equalization algorithm is used to improve the image contrast and enhance the distinction between the crack and the background, resulting in an image with enhanced contrast. Based on the contrast-enhanced image, geometric correction is performed to eliminate perspective distortion, resulting in a geometrically corrected image. Based on the geometrically corrected image, size and brightness normalization processing is performed to obtain the normalized building surface image.
3. The method according to claim 1, characterized in that, The standardized building surface image is decomposed into multiple scales, and edge features, texture features, and directional features are extracted from each scale image and integrated to obtain a multi-dimensional feature descriptor set, including: Based on the standardized building surface image, multi-scale decomposition is performed using pyramid transform or wavelet transform to obtain image representations at different scales. Based on the image representations at different scales, edge detection operators are applied to extract possible crack edge features to obtain edge feature maps; Based on the image representations at different scales, texture features are extracted using the local binary mode or gray-level co-occurrence matrix algorithm to obtain texture feature representations. Based on the image representations at different scales, Gabor filters or histograms of oriented gradients are used to extract the directional features of the cracks, resulting in directional feature representations. Based on the edge feature map, the texture feature representation, and the directional feature representation, multi-scale fusion and integration are performed to obtain the multi-dimensional feature descriptor set.
4. The method according to claim 1, characterized in that, The importance of each dimension of the features in the multidimensional feature descriptor set is evaluated, and based on the importance evaluation results, feature dimensionality reduction, feature quantization encoding, and feature vector compression are performed sequentially to obtain a compact feature vector, including: Based on the features in each dimension of the multidimensional feature descriptor set, the importance is evaluated using information gain or principal component analysis methods to obtain feature importance scores. Based on the feature importance score, the principal component analysis algorithm is used to map the multidimensional feature descriptor set from the high-dimensional feature space to the low-dimensional space, minimizing the feature dimension while retaining key identification information, and obtaining the dimensionality-reduced feature representation. Based on the reduced-dimensional feature representation, quantization encoding is performed to convert continuous-value features into discrete codes, resulting in quantized feature codes. Based on the quantized feature encoding, further compression is performed using hash encoding or binary encoding methods to obtain the compressed feature representation; Based on the compressed feature representation, the features are integrated to obtain the compact feature vector.
5. The method according to claim 1, characterized in that, The feature space is partitioned based on the compact feature vector, a feature index structure is constructed, and the feature index structure is optimized, compressed, and constructed in a multi-level hierarchy to obtain the feature index mechanism, including: Based on the compact feature vector, the feature space is divided into multiple sub-regions using a KD tree or ball tree spatial partitioning algorithm to obtain feature space partitions; Based on the feature space partitioning, a feature index structure that supports approximate matching is constructed using the locality-sensitive hashing algorithm, thereby improving the retrieval efficiency of a large-scale feature database and obtaining the initial feature index structure. Based on the initial feature index structure, optimization and compression are performed to reduce storage space usage, resulting in an optimized feature index structure. Based on the optimized feature index structure, a multi-level index hierarchy is constructed to achieve progressive retrieval from coarse-grained to fine-grained, resulting in a hierarchical feature index structure. Based on the hierarchical feature index structure, an incremental index update mechanism is designed to support the dynamic addition of new crack feature samples, resulting in a spatially optimized feature index mechanism.
6. The method according to claim 1, characterized in that, The process involves acquiring newly collected building surface images and extracting corresponding compact feature vectors as query feature vectors. Based on the current detection environment and image quality, the tolerance threshold for feature matching is dynamically adjusted. An approximate nearest neighbor search is performed on the query feature vector using the feature indexing mechanism and the tolerance threshold. The search results are then subjected to multi-level filtering and verification, and sorted according to feature similarity to obtain a crack matching result set, including: Based on the newly acquired building surface images, the following processes are sequentially executed: noise reduction, contrast enhancement, geometric correction, standardization, multi-scale feature extraction, feature dimensionality reduction, quantization encoding, and vector compression, to obtain the query feature vector. Based on the current detection environment parameters and image quality indicators, the tolerance threshold for feature matching is dynamically calculated. Based on the feature indexing mechanism and the tolerance threshold, an approximate nearest neighbor search is performed on the query feature vector to obtain preliminary matching results; Based on the preliminary matching results, multi-level filtering and verification are performed to remove false matches, resulting in verified matching results. Based on the verified matching results, the crack matching result set is obtained by sorting the query feature vector and the matching feature vector according to the feature similarity.
7. The method according to claim 1, characterized in that, The process involves locating crack regions and classifying crack types based on the crack matching result set, measuring crack geometric parameters and assessing crack severity, and integrating the crack location, type, geometric parameters, and severity to obtain a crack status report, including: Based on the crack matching result set, the crack area is located by combining the newly acquired building surface image, and the pixel-level boundary of the crack is obtained. Based on the morphological features of the pixel-level boundaries of the cracks, the crack types are classified to obtain crack type labels. Based on the pixel-level boundary of the crack, the geometric parameters of the crack are measured and converted into physical units to obtain the crack geometric parameter data. Based on the crack geometric parameter data and the crack location information corresponding to the pixel-level boundary of the crack, the severity of the crack is assessed and the risk level is classified to obtain the crack risk level. The crack status report is obtained by integrating the crack location information corresponding to the pixel-level boundary of the crack, the crack type label, the crack geometric parameter data, and the crack risk level.
8. The method according to claim 7, characterized in that, The crack geometry parameters include crack length, crack width, and crack area.
9. The method according to claim 1, characterized in that, The system involves performing time-series analysis of historical crack data based on the crack status report to monitor crack development trends, designing a multi-level early warning mechanism based on the crack status report and crack development trends, and providing maintenance suggestions to obtain a real-time monitoring and early warning system, including: Based on the crack status report, historical crack data is extracted and organized according to time series to obtain a time series crack dataset; Based on the time-series crack dataset, the rate of change and trend of change of crack geometric parameters are calculated using time series analysis methods to obtain crack development trend prediction results. Based on the crack risk level in the crack status report and the crack development trend prediction results, a multi-level early warning mechanism including primary early warning, intermediate early warning and advanced early warning is designed to obtain graded early warning rules. Based on the aforementioned graded early warning rules, and combined with the current crack status, an early warning signal of the corresponding level is triggered. Based on the type, location, and severity of the crack, targeted maintenance suggestions are generated to obtain early warning information and maintenance plans. Based on the aforementioned early warning information and maintenance plan, a real-time monitoring process is established and crack status data is continuously updated to obtain the real-time monitoring and early warning system.
10. A building crack detection system based on image recognition, characterized in that, include: The image acquisition module is used to acquire raw image data of the building surface through the acquisition device, and to preprocess the raw image data in sequence to obtain a standardized building surface image. The feature extraction module is used to perform multi-scale decomposition on the standardized building surface image, extract edge features, texture features and directional features on each scale image respectively, and integrate them to obtain a multi-dimensional feature descriptor set; The feature compression module is used to evaluate the importance of each dimension of the features in the multidimensional feature descriptor set, and based on the importance evaluation results, perform feature dimensionality reduction, feature quantization encoding and feature vector compression in sequence to obtain a compact feature vector. An index construction module is used to partition the feature space based on the compact feature vector, construct a feature index structure, and optimize, compress, and construct a multi-level hierarchy of the feature index structure to obtain a feature index mechanism. The crack matching module is used to acquire newly collected building surface images and extract the corresponding compact feature vectors as query feature vectors. Based on the current detection environment and image quality, the tolerance threshold for feature matching is dynamically adjusted. The feature indexing mechanism and the tolerance threshold are used to perform an approximate nearest neighbor search on the query feature vectors. The search results are filtered and verified at multiple levels and sorted according to feature similarity to obtain a crack matching result set. The crack analysis module is used to locate crack regions and classify crack types based on the crack matching result set, measure the geometric parameters of cracks and assess crack severity, and integrate the location, type, geometric parameters and severity of cracks to obtain a crack status report. The monitoring and early warning module is used to perform time-series analysis of historical crack data based on the crack status report to monitor crack development trends. Based on the crack status report and the crack development trend, a multi-level early warning mechanism is designed and maintenance suggestions are provided to obtain a real-time monitoring and early warning system.
Citation Information
Cited By
Slurry shield mud film maintenance test device and service life prediction method
CN121998994A
A method for predicting the service life of a slurry shield mud membrane
CN121998994B