An unsupervised pavement crack detection method and device and a storage medium

By employing unsupervised random masking and conditional generative adversarial networks, the problems of dependence on large amounts of labeled data and insufficient generalization in pavement crack detection are solved, achieving fully automated and efficient pavement crack detection and improving detection performance and generalization ability.

CN116993684BActive Publication Date: 2026-07-03TONGJI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TONGJI UNIV
Filing Date
2023-07-10
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing deep learning-based road surface crack detection algorithms require a large amount of manually labeled data and have poor generalization ability, resulting in a significant waste of human and material resources. Furthermore, their reliance on labeled training leads to insufficient generalization.

Method used

An unsupervised method based on random masks and conditional generative adversarial networks is adopted. A conditional generative adversarial network model is constructed by randomly removing healthy road surface images using multi-scale random square masks. The model is trained using pixel-wise loss, structural consistency loss, feature consistency loss, and adversarial loss functions to learn the reconstruction and restoration mapping from the randomly removed healthy road surface images to the original images. Crack detection is achieved by combining filtering and binarization processing.

Benefits of technology

It achieves fully automated intelligent detection without manual annotation, improves the generalization performance of road crack detection, and performs on Crack500, Deepcrack, and CFD datasets at a level comparable to supervised algorithms, saving manpower and resources and improving detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116993684B_ABST
    Figure CN116993684B_ABST
Patent Text Reader

Abstract

This invention relates to an unsupervised method, apparatus, and storage medium for detecting pavement cracks. The method includes the following steps: randomly removing pavement from a healthy pavement image using a multi-scale random square mask; constructing a conditional generative adversarial network (GAN) model to extract information and feature distributions from the randomly removed healthy pavement image, and reconstructing a new healthy pavement image based on the extracted feature distributions; training the network model using a pixel-wise loss function, a structural consistency loss function, a feature consistency loss function, and an adversarial loss function; inputting a pavement crack image to obtain the image reconstructed by the GAN model, comparing it with the input pavement crack image to obtain an error map; and filtering and binarizing the error map to obtain the pavement crack detection result. Compared with existing technologies, this invention has advantages such as no need for manual annotation and excellent generalization performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of unsupervised learning technology, and in particular to an unsupervised method, apparatus and storage medium for detecting road surface cracks based on random masks and conditional generative adversarial networks. Background Technology

[0002] In the fields of digital twin and smart city construction, intelligent detection of road damage is crucial for ensuring road quality and maintaining road safety, smooth traffic flow, and comfort. Any road damage that is not detected and repaired in a timely manner not only inconveniences drivers but also poses a significant threat to vehicle condition, traffic safety, and human life, potentially leading to irreparable personal injury and property damage. With the rapid development of artificial intelligence in recent years, many researchers, as pioneers in digital twin and smart city construction, are dedicated to developing intelligent road damage detection algorithms to advance the implementation of AI-powered road inspection systems. Among these, intelligent detection of road cracks is one of the most classic research areas.

[0003] Before the explosion of deep learning, classic intelligent road crack detection algorithms were all based on traditional two-dimensional image processing methods. These can be categorized by their underlying principles into edge-based, threshold-based, texture-based, wavelet-based, and minimum path searching-based methods. While these classic methods can achieve good results in some simple scenarios, they are typically computationally intensive and sensitive to various environmental factors, particularly lacking robustness to different lighting and weather conditions. Furthermore, road cracks often have irregular shapes, making the geometric assumptions made in these classic algorithms sometimes infeasible.

[0004] Subsequently, some classic machine learning algorithms and models began to be applied to detect road surface cracks, such as Support Vector Machine (SVM), Random Forest, Markov Random Field, and Adaboost ensemble learning. Furthermore, with the latest advancements in deep learning in recent years, Deep Convolutional Neural Networks (DCNNs) have become the mainstream intelligent road surface crack detection technology considered by researchers due to their superior performance. Unlike classic algorithms that segment road surface images to detect cracks by explicitly setting parameters and manually setting thresholds, existing DCNN algorithms typically use a large amount of manually labeled road surface data for backpropagation training. They can be considered data-driven algorithms, as they do not require manually setting parameters, do not assume the shape of road surface cracks, and are more robust to various environmental factors. These data-driven road surface crack detection algorithms can be further divided into three categories: (1) image classification networks; (2) object detection networks; and (3) semantic segmentation networks. The first type of algorithm trains a network using data to classify images of healthy road surfaces and images of road surface cracks. The second type of algorithm trains an object detection network to achieve instance-level road surface crack detection, and the output is generally a bounding box labeling the road surface crack area and category. The third type of algorithm trains a semantic segmentation network to segment road surface images to achieve pixel-level road surface crack detection.

[0005] While existing DCNN algorithms have achieved good results in road crack detection, most of these algorithms are based on supervised network algorithms, which require a large amount of manually labeled datasets during network training. Preparing such complete and usable datasets usually requires a lot of manpower and resources. Moreover, road cracks are not ubiquitous, and collecting images of road cracks often consumes a significant amount of time. Furthermore, because these algorithms rely entirely on labeled training, their generalization ability is relatively poor. Summary of the Invention

[0006] The purpose of this invention is to provide an unsupervised method, device, and storage medium for detecting pavement cracks based on random masking and conditional generative adversarial networks. By utilizing random masking technology and reconstruction-based unsupervised anomaly detection technology, this invention addresses the problems of existing supervised pavement crack detection methods, such as the need for large amounts of well-labeled datasets and poor generalization ability.

[0007] The objective of this invention can be achieved through the following technical solutions:

[0008] An unsupervised method for detecting pavement cracks based on random masks and conditional generative adversarial networks includes the following steps:

[0009] S1. Use a multi-scale random square mask to randomly remove parts from the healthy road surface image and divide it into a training set and a validation set;

[0010] S2. Construct a conditional generative adversarial network model to extract information and feature distribution from the input randomly removed healthy road surface image, and reconstruct a new healthy road surface image based on the extracted feature distribution; train the network model using the pixel-wise loss function, structural consistency loss function, feature consistency loss function, and adversarial loss function to learn the mapping relationship between the randomly removed healthy road surface image and the original healthy road surface image, and save the model parameters that perform best on the validation set to complete the model training;

[0011] S3. During the testing phase, input the road surface crack images from the test set, obtain the reconstructed images from the conditional generative adversarial network model, compare them with the input road surface crack images, and obtain the error map.

[0012] S4. Filter the error graph;

[0013] S5. Binarize the filtered error map to obtain the road surface crack detection results.

[0014] The conditional generative adversarial network model includes a generator and a discriminator. The generator has an encoder-decoder structure, wherein the encoder includes eight convolutional blocks consisting of convolution operation-batch regularization operation-LeakyReLU activation, the decoder includes eight convolutional blocks consisting of deconvolution operation-batch regularization operation-ReLU activation, and the discriminator includes five convolutional blocks consisting of convolution operation-batch regularization operation-LeakyReLU activation.

[0015] The pixel-by-pixel loss function uses the average error loss and is defined as follows:

[0016]

[0017] Among them, L MAE Let I be the pixel-wise loss function, and let I be the original healthy road surface image. The reconstructed image obtained by the generator.

[0018] The structural consistency loss function includes a structured similarity index loss function and a gradient magnitude similarity loss function to penalize structural differences between the original healthy road surface image and the reconstructed image. Its expression is as follows:

[0019]

[0020]

[0021] Among them, L SSiM The structured similarity index measures the loss function. Represents the original healthy road surface image I and the reconstructed image In the diagram, the structured similarity index value between image patches with center point coordinates (i,j); L GMS Let be the gradient magnitude similarity loss function. Represents the original healthy road surface image I and the reconstructed image In the image, the gradient magnitude values ​​between image blocks with center point coordinates (i,j) are shown; H and W are the length and width of the image, respectively.

[0022] The feature consistency loss function employs style loss, penalizing results that are stylistically dissimilar to the target by defining a distance measure between the covariances of the activation maps of the pre-trained network, given a specific size C. i ×H i ×E i Feature map, feature consistency loss function L style Defined as:

[0023]

[0024] in, Represents from φ i A C was obtained i ×C i Gram matrix, φ i This represents the activation map of the i-th layer obtained from the pre-trained model, where I is the original healthy road surface image. E is the reconstructed image obtained by the generator. i This indicates loss calculation.

[0025] The adversarial loss function is:

[0026]

[0027] Where G represents the generator, D represents the discriminator, and I represents the original healthy road surface image. The input image represents the image after randomly removing elements from the healthy road surface image, and E represents the loss calculation.

[0028] Step S4 specifically involves: performing filtering on the error map based on bilateral filtering technology, adjusting the diameter parameter of each pixel neighborhood, the standard deviation of the color space filter, and the standard deviation of the filter in the spatial coordinates during the filtering process to reduce reconstruction noise.

[0029] Step S5 specifically involves: performing binarization segmentation on the filtered error map based on the Otsu threshold algorithm to obtain the road surface crack detection result.

[0030] An unsupervised pavement crack detection device based on random masking and conditional generative adversarial networks includes a memory, a processor, and a program stored in the memory. When the processor executes the program, it implements the method described above.

[0031] A storage medium having a program stored thereon, which, when executed, implements the method described above.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] (1) This invention proposes an unsupervised road surface crack detection method based on random mask and conditional generative adversarial network, which effectively solves the problems of existing deep learning-based supervised road surface crack detection algorithms relying on a large amount of detailed and complete labeled data, resulting in a large amount of manpower and material resources being consumed, and poor generalization ability. It eliminates the need for manual labeling and realizes fully automated intelligent detection.

[0034] (2) The present invention designs a multi-scale random square mask to randomly remove blocks from the healthy road surface images in the training set as the input of the network. This can prevent the network from degenerating into learning the identity mapping from input to output and promote the network to learn the distribution characteristics of the healthy road surface images.

[0035] (3) This invention constructs a conditional generative adversarial network model and designs a comprehensive loss function to constrain the training of the network, including a pixel-wise loss function, a structural consistency loss function, a feature consistency loss function and an adversarial loss function. The proposed network model is trained to learn the mapping relationship between the reconstruction and restoration of the original healthy road surface image after random removal, which makes the model training results better and the reconstruction effect better.

[0036] (4) The present invention has performance comparable to supervised road surface crack detection algorithms on datasets such as Crack500, Deepcrack, and CFD, and has better generalization performance. Attached Figure Description

[0037] Figure 1 This is a flowchart of the method of the present invention;

[0038] Figure 2 This is a schematic diagram of the network architecture of the present invention;

[0039] Figure 3 This is a schematic diagram of the multi-scale random square mask of the present invention;

[0040] Figure 4 This is an example of a healthy road surface image used in the training phase in one embodiment of the present invention;

[0041] Figure 5This is an example of a road surface crack image used in the testing phase in one embodiment of the present invention;

[0042] Figure 6 This is a road surface image reconstructed by the model during the testing phase in one embodiment of the present invention;

[0043] Figure 7 This is an error diagram obtained in one embodiment of the present invention. Detailed Implementation

[0044] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0045] Existing supervised pavement crack detection algorithms based on deep learning suffer from the problems of requiring extensive manual annotation and poor generalization ability. These problems are determined by the network design and training strategies of the algorithms themselves. These algorithms are data-driven, relying entirely on detailed and complete labeled data during training. On the one hand, this pixel-level fine annotation requires a lot of manpower and resources; on the other hand, the complete dependence of these algorithms on annotation training leads to their poor generalization ability.

[0046] To solve the above problems, such as Figure 1 As shown, this embodiment provides an unsupervised pavement crack detection method based on random masks and conditional generative adversarial networks, the network architecture of which is as follows. Figure 2 As shown, it includes the following steps:

[0047] S1. Use a multi-scale random square mask to randomly remove parts from the healthy road surface image and divide it into a training set and a validation set.

[0048] Using a multi-scale random square mask to randomly remove blocks from healthy road surface images in the training set as input to the network, the network learns the mapping from the removed images to the original healthy images, avoiding the network's degradation in learning the identity mapping from the original images to the original images.

[0049] Specifically, the input is a healthy road surface image, which is read into a NumPy matrix for easy processing using the OpenCV library. Then, one image is randomly selected. Figure 3The square mask shown is also read as a NumPy matrix and multiplied pixel-by-pixel with the healthy road surface image to achieve random removal of the input healthy road surface image. A key consideration in mask design is that image regions should have an equal probability of being removed, because the feature distributions of all healthy road surface image patches should have an equal probability of being learned by the network. The input image is set to a length and width of 256*256, which also serves as the mask size. Specifically, the mask is divided into 256 / k*256 / k grids, where k determines the grid density. In this design, k is set to 128, 64, and 32 respectively. Figure 2 As shown, the black area represents the area to be removed, with a pixel value set to 0, and the white area represents the area to be retained, with a pixel value set to 1. The ratio between the white and black areas is set to 1:1. By swapping the black and white areas, complementary multi-scale square mask images are obtained, with a total of six images.

[0050] S2. Construct a conditional generative adversarial network model to extract information and feature distribution from the input randomly removed healthy road surface image, and reconstruct a new healthy road surface image based on the extracted feature distribution; train the network model using the pixel-wise loss function, structural consistency loss function, feature consistency loss function, and adversarial loss function to learn the mapping relationship between the randomly removed healthy road surface image and the original healthy road surface image, and save the model parameters that perform best on the validation set to complete the model training.

[0051] The Conditional Generative Adversarial Network (GAN) model includes a generator and a discriminator. The generator has an encoder-decoder structure, where the encoder consists of eight convolutional blocks composed of convolution operations, batch regularization operations, and LeakyReLU activations. The decoder consists of eight convolutional blocks composed of deconvolution operations, batch regularization operations, and ReLU activations. The discriminator consists of five convolutional blocks composed of convolution operations, batch regularization operations, and LeakyReLU activations. This embodiment uses the designed GAN model to extract information and feature distribution from the input image of a randomly removed healthy road surface. Using the extracted feature distribution as input, a new healthy road surface image is reconstructed. The input image is converted into tensor format and normalized to obtain a tensor matrix of size 3*256*256, where 256 and 256 represent the image's length and width, and 3 represents the number of channels in the input image, containing three channels: R (Red), G (Green), and B (Blue), forming a color image. In this process, after processing by each convolutional block of the encoder in the generator, feature maps with sizes of (64*128*128), (128*64*64), (256*32*32), (512*16*16), (512*8*8), (512*4*4), (512*2*2), and (512*1*1) are obtained sequentially. Then, after processing by each convolutional block of the decoder in the generator, feature maps with sizes of (512*2*2), (512*4*4), (512*8*8), (512*16*16), (256*32*32), (128*64*64), and (64*128*128) and an output tensor matrix of (3*256*256) are obtained sequentially. Furthermore, the U-Net structure, first proposed in medical image segmentation, was used, and skip connections were added to enable the direct transmission of rich semantic context information within the network.

[0052] Convolution is a mathematical concept defined as the sequential integration of an input signal by a convolution kernel (also called a filter) function. Batch regularization is a layer of computation added before the nonlinear activation function of each layer of a neural network. Its operation is to normalize the input value and map it to the desired range. ReLU activation function, short for Linear Rectification Function, is a commonly used nonlinear activation function in artificial neural networks. When the input is greater than 0, this function is completely identity, equivalent to no calculation being performed. Therefore, compared with the traditional neural network activation function Sigmoid, it has advantages such as faster computation and convenient backpropagation of error. At the same time, because it splits into two discontinuous parts at the 0 position, it possesses the same nonlinear characteristics as the Sigmoid function. Therefore, it is more suitable for deep feedforward neural networks.

[0053] Deconvolution can be viewed as a mirror image of convolution; every convolution operation has a corresponding deconvolution operation. The first step is to convert the convolution kernel of the convolution operation into a deconvolution kernel, essentially flipping it horizontally and vertically relative to the original kernel. The second step is to pad the input image corresponding to the deconvolution operation with zeros on both sides to create a larger image. This ensures that when the deconvolution kernel is applied to this padded image, the output image is the same size as the input image of the convolution operation. The third step is to convolve the deconvolution kernel with the padded input image to obtain the convolution result of the deconvolution kernel.

[0054] This embodiment designs a root mean square error loss function to constrain pixel-wise consistency, a structural similarity loss function and a gradient magnitude similarity deviation loss function to constrain structural consistency, a style loss function to constrain feature consistency, and an adversarial loss brought by the discriminator structure to constrain distribution consistency. The proposed network model is trained to learn the mapping relationship from the randomly removed healthy road surface image to the original healthy road surface image for reconstruction and restoration.

[0055] The pixel-wise loss function uses the average error loss and is defined as follows:

[0056]

[0057] Among them, L MAE Let I be the pixel-wise loss function, and let I be the original healthy road surface image. The reconstructed image obtained by the generator.

[0058] Although the MAE loss function is commonly used, it directly and independently calculates the differences between pixels, ignoring the correlation between adjacent pixels. Therefore, this embodiment further employs the Structured Similarity Index Loss (SSIMloss) and Gradient Magnitude Similarity Loss (GMS loss) to penalize the structural differences between the original input image and the reconstructed image. That is, the structural consistency loss function includes the Structured Similarity Index Loss function and the Gradient Magnitude Similarity Loss function to penalize the structural differences between the original healthy road surface image and the reconstructed image. Its expression is:

[0059]

[0060]

[0061] Among them, L SSiM The structured similarity index measures the loss function. Represents the original healthy road surface image I and the reconstructed image In the diagram, the structured similarity index value between image patches with center point coordinates (i,j); L GMS Let be the gradient magnitude similarity loss function. Represents the original healthy road surface image I and the reconstructed image In the image, the gradient magnitude values ​​between image blocks with center point coordinates (i,j) are shown; H and W are the length and width of the image, respectively.

[0062] To further penalize feature inconsistencies between the original input image and the reconstructed image, this embodiment employs a style loss function as the feature consistency loss function. As the name suggests, style loss penalizes results that are stylistically dissimilar to the target by defining a distance measure between the covariances of the activation maps of the pre-trained network. Given a specific size C... i ×H i ×W i The feature map, and the style loss function are defined as:

[0063]

[0064] in, Represents from φ i A C was obtained i ×C i Gram matrix, φ i E represents the activation map of the i-th layer obtained from the pre-trained model. i This represents the loss calculation. In this embodiment, it represents the activation feature maps of ReLu1_2, ReLu2_2, ReLu3_4, ReLu4_4, and ReLu5_4 obtained from the VGG19 model pre-trained on ImageNet.

[0065] The generator, during training, aims to generate reconstructed images sufficient to confuse the discriminator, while the discriminator, during training, aims to distinguish between real input pair combinations (the region-removed image and the original input image) and fake input pair combinations (the region-removed image and the reconstructed image). Therefore, the adversarial loss function is defined as follows:

[0066]

[0067] Where G represents the generator and D represents the discriminator. The input image represents the image after randomly removing elements from the healthy road surface image, and E represents the loss calculation.

[0068] The graphics card used during training was an NVIDIA RTX 3090Ti with 24GB of VRAM. The operating system was Ubuntu, the programming language was Python 3.8, and the deep learning framework was PyTorch 1.9.0. Training lasted for 200 epochs. If the performance on the validation set did not improve for 20 consecutive epochs, training was terminated. The model parameters that performed best on the validation set were retained, including the weights and biases of each neuron in each layer. The command used was the `torch.save()` function in the PyTorch framework. During training, this embodiment used the Adam optimizer to optimize the network, where β1 = 0.5 and β2 = 0.999. The initial learning rates for the generator G and discriminator D were set to 0.0001 and 0.0004, respectively. During training, the learning rate decayed exponentially. Healthy road surface images used during the training phase included... Figure 4 As shown, this includes 1,896 and 300 healthy road surface images cropped from the original Crack500 and Deepcrack data, respectively.

[0069] During training, a validation set is used for validation, and the model parameters that perform best on the validation set are ultimately saved, including the weights and biases of each neuron in each layer.

[0070] S3. During the testing phase, input road surface crack images from the test set to obtain images reconstructed by the conditional generative adversarial network model. Compare these images with the input road surface crack images and perform pixel-by-pixel squared difference operations to obtain an error map.

[0071] In this embodiment, the test set is taken from the Crack500, Deepcrack, and CFD datasets. Crack500 contains 500 road surface crack images, each 2000×1500 pixels in size. These images were collected using smartphones at Temple University's main campus and manually labeled with pixel-level tags. Each image was cropped into 16 non-overlapping image regions, retaining only regions containing crack images larger than 1000 pixels. Therefore, Crack500 contains 1896 training data images, 348 validation data images, and 1124 test data images. In the experiments, the original Crack500 dataset was used to train the supervised method. Furthermore, in this embodiment, 1896 and 348 healthy road images were cropped from the initial 500 road surface images to train the unsupervised method. It is worth noting that the images in Crack500 are challenging for actual crack segmentation due to the presence of shadows, occlusion, uneven lighting conditions, noise, etc.

[0072] The DeepCrack dataset contains 537 544×384 pixel images of concrete surfaces with cracks at multiple scales and in various scenes. All images were manually annotated with pixel-level labels and were divided into two main subsets: 300 images for training and 237 images for testing. In the experiments, the original DeepCrack dataset was used to train the supervised method, and 300 healthy road images were further cropped from the initial concrete surface images to train the unsupervised method.

[0073] The CFD dataset contains 118 images of concrete surface cracks with manually annotated pixel-level labels. All images are 480×320 pixels in size. Because these images contain various lighting conditions, shadows, stains, and lane lines, it is difficult to detect the cracks. To increase the amount of data, this embodiment further cropped 200 images to 256×256 pixels to evaluate the generalization ability of supervised and unsupervised methods.

[0074] The input test set contains images of road surface cracks, which are then processed by a pre-trained model to obtain reconstructed images. Since the model only learns the distribution characteristics of healthy road surfaces during training, it can only reconstruct healthy road surface areas well, but cannot reconstruct areas with cracks. Next, the reconstructed images are compared with the original input images of road surface cracks. By calculating the squared difference pixel-by-pixel, an error map that can infer the crack segmentation region is obtained.

[0075] S4. Filter the error graph.

[0076] Specifically, the error map is filtered using a bilateral filter technique. During the filtering process, the diameter parameter of each pixel's neighborhood, the standard deviation of the color space filter, and the standard deviation of the filter in the spatial coordinates are adjusted to reduce reconstruction noise.

[0077] Bilateral filtering is a non-linear filtering method that combines spatial proximity and pixel value similarity in an image, considering both spatial information and grayscale similarity to achieve edge-preserving noise reduction. It is simple, non-iterative, and local, with the advantage of edge preservation. In the OpenCV library, the bilateral filtering function has three parameters: the diameter of each pixel's neighborhood during filtering, the standard deviation of the color space filter, and the standard deviation of the filter in spatial coordinates. This embodiment adjusts these three parameters to reduce noise in the error map.

[0078] S5. Binarize the filtered error map to obtain the road surface crack detection results.

[0079] Specifically, based on the Otsu thresholding algorithm, the filtered error map is binarized to obtain the binarized segmentation results of the cracks and background, which serve as the final road surface crack detection results.

[0080] The Otsu thresholding algorithm, also known as the maximum inter-class variance method, is based on the idea of ​​using a threshold to divide the data in an image into two classes: one class in which the gray values ​​of all pixels are less than the threshold, and the other class in which the gray values ​​of all pixels are greater than or equal to the threshold.

[0081] In the construction of smart cities oriented towards digital twins, the proposed method can serve as a novel intelligent detection tool for road damage. Combined with inspection robots, it can accumulate backend reports on road damage, enabling intelligent data sharing among road construction, management, and maintenance systems. Compared to existing supervised detection algorithms, this invention truly eliminates the need for manual intervention, saving time and budget. Furthermore, after establishing a comprehensive and scientific road damage database, intelligent data sharing among road construction, management, and maintenance systems can be achieved, further enabling the development of road damage prediction models and making road damage evolution "measurable." This, in turn, allows for the formulation of reasonable maintenance plans, early prediction of maintenance, and reduction of maintenance cycles.

[0082] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0083] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. An unsupervised method for detecting pavement cracks based on random masks and conditional generative adversarial networks, characterized in that, Includes the following steps: S1. Use a multi-scale random square mask to randomly remove parts from the healthy road surface image and divide it into a training set and a validation set; S2. Construct a conditional generative adversarial network model to extract information and feature distribution from the input randomly removed healthy road surface image, and reconstruct a new healthy road surface image based on the extracted feature distribution; train the network model using the pixel-wise loss function, structural consistency loss function, feature consistency loss function, and adversarial loss function to learn the mapping relationship between the reconstruction and recovery of the randomly removed healthy road surface image and the original healthy road surface image, save the corresponding model parameters, and complete the model training. S3. During the testing phase, input the road surface crack images from the test set, obtain the reconstructed images from the conditional generative adversarial network model, compare them with the input road surface crack images, and obtain the error map. S4. Filter the error graph; S5. Binarize the filtered error map to obtain the road surface crack detection results; The pixel-by-pixel loss function uses the average error loss and is defined as follows: in, For pixel-by-pixel loss function, I Original healthy road surface image, The reconstructed image obtained by the generator; The structural consistency loss function includes a structured similarity index loss function and a gradient magnitude similarity loss function to penalize structural differences between the original healthy road surface image and the reconstructed image. Its expression is as follows: in, The structured similarity index measures the loss function. Represents the original healthy road surface image I With reconstructed images In the middle, the coordinates of the center point are ( i , j The structured similarity index value between image patches; Let be the gradient magnitude similarity loss function. Represents the original healthy road surface image I With reconstructed images In the middle, the coordinates of the center point are ( i , j Gradient magnitude map values ​​between image blocks; H , W These are the length and width of the image, respectively; The feature consistency loss function employs style loss, penalizing results that are stylistically dissimilar to the target by defining a distance metric between the covariances of the activation maps of the pre-trained network, given a preset size. Feature map, feature consistency loss function Defined as: in, Representative from One received Gram matrix, The first term obtained from the pre-trained model i Layer activation graph, I Original healthy road surface image, The reconstructed image obtained by the generator. Indicates loss calculation; The adversarial loss function is: in, G Represents generator, D Represents the discriminator. I Original healthy road surface image, This represents the input image after randomly removing elements from a healthy road surface image. E This indicates loss calculation.

2. The unsupervised pavement crack detection method based on random masking and conditional generative adversarial networks according to claim 1, characterized in that, The conditional generative adversarial network model includes a generator and a discriminator. The generator has an encoder-decoder structure, wherein the encoder includes eight convolutional blocks consisting of convolution operation-batch regularization operation-LeakyReLU activation, the decoder includes eight convolutional blocks consisting of deconvolution operation-batch regularization operation-ReLU activation, and the discriminator includes five convolutional blocks consisting of convolution operation-batch regularization operation-LeakyReLU activation.

3. The unsupervised pavement crack detection method based on random masking and conditional generative adversarial networks according to claim 1, characterized in that, Specifically, S4 involves filtering the error map using bilateral filtering technology, adjusting the diameter parameter of each pixel's neighborhood, the standard deviation of the color space filter, and the standard deviation of the filter in the spatial coordinates during the filtering process to reduce reconstruction noise.

4. The unsupervised pavement crack detection method based on random masking and conditional generative adversarial networks according to claim 1, characterized in that, Specifically, S5 involves performing binarization segmentation on the filtered error map based on the Otsu threshold algorithm to obtain the road surface crack detection result.

5. An unsupervised pavement crack detection device based on random masking and conditional generative adversarial networks, comprising a memory, a processor, and a program stored in the memory, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-4.

6. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed, it implements the method as described in any one of claims 1-4.