Unsupervised pavement crack detection method and system based on de-noising diffusion model
Through the unsupervised pavement crack detection method based on the denoising diffusion model, using pseudo-crack synthesis technology and denoising diffusion implicit model, the problems of high data labeling cost and poor generalization ability in traditional detection methods are solved, and efficient and accurate pavement crack detection is achieved.
Patent Information
- Application Number
- CN202510285813.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-03-12
AI Technical Summary
The existing pavement crack detection methods rely on low efficiency and high cost in manual inspection, and the methods based on image processing and supervised learning have problems such as high data labeling cost and poor generalization ability.
Unsupervised road surface crack detection method based on denoising diffusion model is adopted, pseudo-label is generated through pseudo-crack synthesis technology, segmentation models are trained to reduce data annotation costs, and the detection accuracy is improved by using implicit model of denoising diffusion and target-guided reconstruction mechanism.
It reduces the cost of data labeling, improves the accuracy and robustness of crack detection, and can perform well under different lighting and complex background conditions. The detection results reach key indicators of 44.71%, 66.08% and 93.66% on the Crack500 dataset.
Smart Images

Figure CN119784764A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pavement crack detection, and in particular to an unsupervised pavement crack detection method and system based on a denoising diffusion model. Background Art
[0002] Pavement cracks are the most common type of damage in road facilities, usually caused by temperature changes, traffic loads, moisture erosion, material aging and other factors. Pavement cracks not only affect the service life of roads, but also seriously threaten traffic safety. Therefore, timely and effective detection of pavement cracks is crucial for road maintenance and safety management. Traditional crack detection methods mainly rely on manual inspection, which is inefficient, costly, and easily limited by the experience and subjective judgment of inspectors. With the development of science and technology, automated crack detection systems have gradually become a research hotspot.
[0003] Traditional image processing-based methods, such as threshold methods, local binary patterns (LBP), Fourier transforms, and wavelet transforms, perform well in specific scenarios, but these methods rely on manual feature extraction and have poor generalization capabilities under complex backgrounds or environmental changes. In order to overcome these problems, supervised learning methods based on machine learning have gradually been applied, especially convolutional neural networks (CNNs), which have been widely used in pavement crack detection. By training classifiers with labeled data, supervised learning methods can automatically extract features from images and perform crack segmentation. However, these methods also have certain limitations, mainly reflected in their reliance on a large amount of labeled data. The collection of labeled data is not only expensive, but also requires a lot of human resources, which limits its promotion in practical applications.
[0004] In recent years, unsupervised learning methods have been applied to the field of crack detection as an emerging solution. Unsupervised methods based on reconstruction generally reconstruct the crack image first to generate an ideal image after removing the cracks, then calculate the difference between the crack image and the ideal image, and mark the area with large differences as a crack defect. However, these methods generally have problems such as poor reconstruction quality, inability to effectively handle large-scale crack areas, and insufficient positioning accuracy.
[0005] In recent years, the Diffusion Model has achieved great success in the field of natural image generation. The model has been proven to have strong capabilities in industrial product defect image restoration and anomaly detection tasks by gradually adding noise to the data and restoring the data through the reverse denoising process. However, due to the large inter-domain differences between the data characteristics of pavement and industrial products or natural images, the pavement crack detection method directly based on the diffusion model still faces problems such as low training efficiency, high computational overhead, and insufficient detection accuracy. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide an unsupervised pavement crack detection method and system based on a denoising diffusion model, which uses pseudo-crack synthesis technology to provide pseudo-label information for the segmentation model, greatly reducing the cost of data annotation and improving the accuracy and robustness of crack detection.
[0007] In order to solve the above technical problems, the technical solution of the present invention is as follows: In a first aspect, an unsupervised pavement crack detection method based on a denoising diffusion model is provided, the method comprising: Step 1: Use the unlabeled normal road image dataset D1 to train the denoising diffusion implicit model, and the input image is normalized to a uniform size of W×H; Step 2, construct a road surface defect texture dataset D2, add noise to normal road images and input the diffusion model for reconstruction, add random disturbance to generate abnormal road surface images; Step 3, generate a random Perlin noise image and binarize it to obtain a mask image, fuse the abnormal texture image with the normal road image based on the mask image, and generate a pseudo-crack road surface image and its pseudo-label; Step 4, forward noise is added to the pseudo crack image to generate two images with different noise levels; Step 5, input a noisy image into the diffusion model to reconstruct it into a target image, and use the target image to guide the reconstruction process of another noisy image to obtain an image with defects removed; Step 6: construct a segmentation model based on the pseudo-crack dataset, with the input being the concatenation of the pseudo-crack image and its reconstructed image, and outputting the predicted crack result, which is trained by minimizing the loss function; Step 7: Replace the pseudo crack image with the real road surface image to be detected to obtain a reconstructed image, which is then stitched and input into the trained segmentation model to obtain the final defect detection result.
[0008] Furthermore, a road surface defect texture dataset D2 is constructed by adding noise to normal road images and inputting the diffusion model for reconstruction, and adding random disturbances to generate abnormal road surface images, including: Construct a road defect texture dataset D2, for each normal road image Add noise and input it into the diffusion model trained in step 1 for reconstruction. Add random disturbances to the diffusion model inverse denoising and reconstruction process to make it deviate from the normal distribution and generate abnormal road surface images. .
[0009] Furthermore, a random Perlin noise image is generated and binarized to obtain a mask image, and the abnormal texture image is fused with the normal road image based on the mask image to generate a pseudo crack road surface image and its pseudo label, including: Construct a pavement pseudo crack dataset D3, for each pavement image in dataset D1 , generate a random two-dimensional Perlin noise image P of size W×H, and randomly select a threshold for P to binarize the image to obtain a mask image of each pixel label; The constructed road defect texture dataset D2 is used as the abnormal texture source A, and the abnormal texture images are randomly selected from A, and based on the mask map Normal road image Fusion is performed to obtain a pseudo-crack road surface image , Pseudo-crack pavement image The defect pseudo label is the obtained label map .
[0010] Furthermore, the pseudo crack image is forward-noised to generate two images with different noise levels, including: For each image in dataset D3 Both use the diffusion time step and , based on the noise model in the diffusion model in step 1, the pseudo crack image Perform forward noise addition to obtain an image and an image .
[0011] Furthermore, a noisy image is input into a diffusion model to be reconstructed into a target image, and the target image is used to guide the reconstruction process of another noisy image to obtain an image with defects removed, including: For each image in the dataset D3 , the image Input the diffusion model and define the reconstructed image as the target image ; Using the target image Guide the inverse reconstruction process of the diffusion model to transform the image Reconstruct the image to remove defects .
[0012] Furthermore, a segmentation model is constructed based on the pseudo-crack dataset. The input is the concatenation of the pseudo-crack image and its reconstructed image. The output is the predicted crack result. The training is performed by minimizing the loss function, including: The segmentation model is constructed and trained based on the dataset D3. The input of the segmentation model is the pseudo crack image spliced in the channel dimension. and its reconstructed image , the output is a single-channel predicted crack result image; The training is performed by minimizing the loss function between the predicted output of the segmentation model and the pseudo label to obtain a segmentation model for pavement crack detection.
[0013] Furthermore, the pseudo crack image is replaced by the real road surface image to be detected to obtain a reconstructed image, which is then spliced and input into the trained segmentation model to obtain the final defect detection result, including: The pseudo crack images in step 4 and step 5 are Replace it with the real road image to be detected, and obtain the reconstructed image by following steps 4 to 5. ; The road surface image to be inspected and the corresponding reconstructed image are spliced in the channel dimension and input into the trained segmentation model to obtain the final defect detection result.
[0014] In the second aspect, an unsupervised pavement crack detection system based on a denoising diffusion model comprises: The first training module is used to train the denoising diffusion implicit model using the unlabeled normal road image dataset D1, and the input image is normalized to a uniform size W×H; The generation module is used to construct the road surface defect texture dataset D2 by adding noise to the normal road image and inputting the diffusion model for reconstruction, and adding random disturbance to generate abnormal road surface images; A processing module is used to generate a random Perlin noise image and binarize it to obtain a mask image, fuse the abnormal texture image with the normal road image based on the mask image, and generate a pseudo-crack road surface image and its pseudo-label; A noise adding module is used to perform forward noise adding on the pseudo crack image to generate two images with different noise levels; A reconstruction module is used to input a noisy image into a diffusion model to reconstruct a target image, and use the target image to guide the reconstruction process of another noisy image to obtain an image with defects removed; The second training module is used to build a segmentation model based on the pseudo-crack dataset. The input is the concatenation of the pseudo-crack image and its reconstructed image. The output is the predicted crack result. The training is performed by minimizing the loss function. The splicing module is used to replace the pseudo crack image with the real road surface image to be detected to obtain a reconstructed image, which is then input into the trained segmentation model to obtain the final defect detection result.
[0015] According to a third aspect, a computing device includes: one or more processors; The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method described.
[0016] In a fourth aspect, a computer-readable storage medium stores a program, and when the program is executed by a processor, the method described is implemented.
[0017] The above solution of the present invention includes at least the following beneficial effects: The present invention only relies on normal road surface images for training, avoiding the need for manually annotated data, greatly reducing training costs and human resource consumption. Secondly, the present invention combines the denoising diffusion implicit model (DDIM) with the target-guided reconstruction mechanism, taking advantage of the advantages of two noise scales, so that the generated reconstructed image has both pixel quality and semantic quality, and can more accurately restore the details of the crack image, while improving the accuracy of crack positioning.
[0018] The pseudo-crack synthesis technology proposed in the present invention can provide abundant training samples, enhance the robustness of the model under different lighting, shadow and complex background conditions, and make crack detection perform well in various environments. The method provided by the present invention was tested on the public Crack500 dataset, and achieved 44.71%, 66.08% and 93.66% in key indicators such as IoU, F1-Score and AUROC, respectively, which are better than the existing unsupervised crack detection methods, showing its efficient and accurate performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is an overall flow chart of an embodiment of the present invention; Figure 2 It is a training process architecture diagram of the present invention; Figure 3 It is a test process architecture diagram of the present invention; Figure 4 is a flow chart of the pseudo-crack synthesis method of the present invention; Figure 5 It is a sample diagram of the detection result of the present invention. DETAILED DESCRIPTION
[0020] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0021] like Figure 1 As shown, an embodiment of the present invention proposes an unsupervised pavement crack detection method based on a denoising diffusion model, the method comprising the following steps: Step 1: Use the unlabeled normal road image dataset D1 to train the denoising diffusion implicit model (such as Figure 2(left), this example uses the public Crack500 dataset, and cuts out 1896 normal road images from its training set as dataset D1. Before training, the input road images are first normalized to the same size of 256×256, and the total time step of the diffusion process is set to , the batch size is set to 32, and the initial learning rate is 3Í10 -4 , weight decay is set to 0.05, and training is performed for 4000 epochs. For the denoising diffusion implicit model, the improved Unet framework is used. The specific structure is: the first layer is the input layer, and the size of each input sample is , the first layer uses The convolution kernel has 64 output channels. The downsampling part includes six convolution layers, which are downsampled layer by layer. The resolution is: 256→128→64→32→16→8. Each convolution layer contains 2 residual blocks (each residual block includes two Convolution), attention module (applied in 32, 16 and 8 resolutions). After each downsampling, the resolution is halved and the number of channels increases (the multiplication factor is 1, 1, 2, 2, 4, 4); followed by the middle block (Middle Block) located in the lowest resolution layer, which contains 2 residual blocks and 1 multi-head attention block to process the bottleneck features of the network; the upsampling part contains six convolution layers, which are upsampled layer by layer, and the resolutions are: 8→16→32→64→128→256, each layer contains 2 residual blocks and attention modules (applied in 8, 16 and 32 resolutions). The upsampling part uses the nearest neighbor interpolation method to enlarge the resolution, and adjusts the number of channels through convolution. The features of each layer are spliced with the corresponding downsampled features using jump connections. The last layer is the output layer, using The convolution kernel has a channel number of 3, and the final size is images; Step 2: Construct a road surface defect texture dataset D2. For each normal road image Add noise and then input it into the diffusion model trained in step 1 for reconstruction. Add random disturbances to the diffusion model inverse denoising and reconstruction process to make it deviate from the normal distribution and generate abnormal road surface images. , the specific process is as follows: In the reverse denoising process, the diffusion model gradually restores the image through the following conditional probability distribution: ; in, is the time step, , express The reconstructed image at the moment, It refers to the noise image , the original input image predicted by the noise model of the diffusion model, is the noise scheduling parameter in the diffusion process, , is an equally spaced sequence from 0.0001 to 0.02, , is the noise prediction of the diffusion model, is a random noise term sampled from a standard Gaussian distribution.
[0022] To generate abnormal road surface images , introducing additional disturbance terms in the reverse denoising process, which includes two core steps: (a) Add random perturbation s to the noise model, which is expressed as follows:
[0023] in, , yes Abnormal images of the moment, is the control parameter of abnormal intensity, and its value is [0, 1]. .
[0024] (b) Based on the previous step, the prior information of the crack is introduced to further enhance the realism of the defect texture. The inside of the crack is generally wide and concave, and dust and dirt are accumulated inside, resulting in the color of the crack being generally darker and darker, and visually having a large color difference from the surrounding normal road surface. The specific implementation method is shown as follows: ; in, In the interval The random sampling in the image makes the image texture reconstructed based on the diffusion model generate in a darker and deeper direction to approximate the visual characteristics of road cracks. Step 3, such as Figure 4 As shown, a pavement pseudo crack dataset D3 is constructed. For each pavement image in the dataset D1 (normal texture), generate a random two-dimensional Perlin noise image P of size W×H, and randomly select a threshold for P to binarize the image to obtain a mask map of pixel-by-pixel labels The constructed road surface defect texture dataset D2 is used as the abnormal texture source A, and the abnormal texture images are randomly selected from A, and based on the mask map Normal road image Fusion is performed to obtain a pseudo-crack road surface image The defect pseudo label of this image is the label image obtained above. The above process can be expressed by the following formula:
[0025] in, It is a pseudo label The reversal of represents an element-by-element multiplication operation, and is a parameter that controls the opacity of the blending process, from a given interval (i.e. The final synthesized training samples include two parts: pavement images containing pseudo cracks , and pixel-level pseudo-labels ; Step 4: For each image in dataset D3 Both use a smaller and a larger diffusion time step, respectively. and , based on the noise model in the diffusion model in step (1), the pseudo crack image Perform forward noise addition to obtain an image with small noise and an image with a lot of noise ; Step 5, such as Figure 2 (Middle) shows that for each image in the dataset D3 , the small noise image The input is fed into the trained diffusion model, and through a shorter diffusion trajectory, it is reconstructed into an image that retains more fine-grained textures, but crack defects may not be fully restored. . Defined as the target image, the target is used to guide the inverse process of the diffusion model to transform the large noise image Reconstructed image with cracks removed To guide The reconstruction result Towards the target image Approximation, by moving Add with Image of the moment A consistent noise can be generated with Intermediate target images with similar distribution . This makes it possible to can be gradually guided towards Approximation. Target image In each step of reverse diffusion, the noise is predicted by the diffusion model. The linear combination of : ; in, is the noise scheduling parameter in the diffusion process. Then, according to the conditional score item , further correcting the noise estimate of the model , the corrected noise term Expressed as: ; in, is a hyperparameter that adjusts the strength of the conditional constraint. Finally, in each step of reverse diffusion denoising, the model is based on the corrected noise term , update the denoising result for: ; Through the target guidance mechanism, the reconstructed image It can completely remove the crack defect area and retain more detailed textures of the original image. For the Crack500 dataset, the noise scale is set to 200, is set to 550. The target guidance mechanism enables the reconstruction of the image It can filter out crack defects and match the original normal image. Very similar; Step 6, such as Figure 2 (right) shows the construction and training of a segmentation model based on the dataset D3. The input of the model is a pseudo crack image spliced in the channel dimension. and its reconstructed image , the output is a single-channel predicted crack result image. The training is performed by minimizing the loss function between the predicted output of the segmentation model and the pseudo label.
[0026] The segmentation model uses the U-Net architecture, which includes an encoder, a decoder, and jump connections. The encoder gradually reduces the spatial resolution and extracts features. It contains six convolutional blocks with a basic channel number of 64. Each convolutional block contains two convolutional layers and one The maximum pooling layer with a convolution kernel size of , the stride is ; The decoder performs upsampling through nearest neighbor interpolation and contains five convolution blocks with a convolution kernel size of , each decoder convolution block is upsampled and concatenated with the encoder convolution block output, and then processed through two convolution layers; finally, a convolution kernel size of The output layer and Sigmoid activation function generate pixel-level segmentation result probability map. Manual or automatic setting of the binarization threshold, here the manual threshold of 0.5 is used, the result probability map can be converted into a binary mask segmentation result map. The training parameter batch size is set to 64, and the initial learning rate is 1Í10 −4, train for 100 epochs; Step 7: In the actual road crack detection application, the pseudo crack images in steps 4 and 5 are Replace it with the real road image to be detected. Follow steps 4 to 5 to get the reconstructed image The road surface image to be inspected and the corresponding reconstructed image are spliced in the channel dimension and input into the trained segmentation model to finally generate the predicted defect mask as the final inspection result.
[0027] like Figure 2 As shown in (left), the denoising diffusion implicit model (DDIM) is trained using an unlabeled normal road image dataset D1. This embodiment uses the public Crack500 dataset and cuts out 1896 normal road images from its training set as the dataset D1. Before training, the input road images are first normalized to the same size of 256×256, and the total time step of the diffusion process is set to , the batch size is set to 32, and the initial learning rate is 3Í10 -4 , weight decay is set to 0.05, and training is performed for 4000 epochs. For the denoising diffusion implicit model, the improved Unet framework is used. The specific structure is: the first layer is the input layer, and the size of each input sample is , the first layer uses The convolution kernel has 64 output channels. The downsampling part includes six convolution layers, which are downsampled layer by layer. The resolution is: 256→128→64→32→16→8. Each convolution layer contains 2 residual blocks (each residual block includes two Convolution), attention module (applied in 32, 16 and 8 resolutions). After each downsampling, the resolution is halved and the number of channels increases (the multiplication factor is 1, 1, 2, 2, 4, 4); followed by the middle block (Middle Block) located in the lowest resolution layer, which contains 2 residual blocks and 1 multi-head attention block to process the bottleneck features of the network; the upsampling part contains six convolution layers, which are upsampled layer by layer, and the resolutions are: 8→16→32→64→128→256, each layer contains 2 residual blocks and attention modules (applied in 8, 16 and 32 resolutions). The upsampling part uses the nearest neighbor interpolation method to enlarge the resolution, and adjusts the number of channels through convolution, and uses jump connections to splice the features of each layer with the corresponding downsampled features. The last layer is the output layer, using The convolution kernel has a channel number of 3, and the final size is images; (2) Constructing the road surface defect texture dataset D2. This embodiment uses the public DTD texture dataset and randomly uses randomly selected data enhancement methods (random rotation, color jitter, histogram equalization, pixel value flipping, sharpness enhancement, and hue change) on abnormal textures to obtain the road surface defect texture dataset D2.
[0028] (3) If Figure 4 As shown, a pavement pseudo crack dataset D3 is constructed. For each pavement image in the dataset D1 (normal texture), generate a random two-dimensional Perlin noise image P of size W×H, and randomly select a threshold for P to binarize the image to obtain a mask map of pixel-by-pixel labels The constructed road surface defect texture dataset D2 is used as the abnormal texture source A, and the abnormal texture images are randomly selected from A, and based on the mask map Normal road image Fusion is performed to obtain a pseudo-crack road surface image The defect pseudo label of this image is the label image obtained above. The above process can be expressed by the following formula: ; in, It is a pseudo label The reversal of represents an element-by-element multiplication operation, and is a parameter that controls the opacity of the blending process, from a given interval (i.e. The final synthesized training samples include two parts: pavement images containing pseudo cracks , and pixel-level pseudo-labels .
[0029] (4) For each image in dataset D3 Both use a smaller and a larger diffusion time step, respectively. and , based on the noise model in the diffusion model in step (1), the pseudo crack image Perform forward noise addition to obtain an image with small noise and an image with a lot of noise .
[0030] (5) If Figure 2 (Middle) shows that for each image in the dataset D3 , the small noise image The input is fed into the trained diffusion model, and through a shorter diffusion trajectory, it is reconstructed into an image that retains more fine-grained textures, but crack defects may not be fully restored. . Defined as the target image, the target is used to guide the inverse process of the diffusion model to transform the large noise image Reconstructed image with cracks removed To guide The reconstruction result Towards the target image Approximation, by moving Add with Image of the moment A consistent noise can be generated with Intermediate target images with similar distribution . This makes it possible to can be gradually guided towards Approximation. Target image In each step of reverse diffusion, the noise is predicted by the diffusion model. The linear combination of : ; in, is the noise scheduling parameter in the diffusion process. Then, according to the conditional score item , further correcting the noise estimate of the model , the corrected noise term Expressed as: ; in, is a hyperparameter that adjusts the strength of the conditional constraint. Finally, in each step of reverse diffusion denoising, the model is based on the corrected noise term , update the denoising result for: ; Through the target guidance mechanism, the reconstructed image It can completely remove the crack defect area and retain more detailed textures of the original image. For the Crack500 dataset, the noise scale is set to 200, is set to 550. The target guidance mechanism enables the reconstruction of the image It can filter out crack defects and match the original normal image. Very similar.
[0031] (6) Figure 2 (right) shows the construction and training of a segmentation model based on the dataset D3. The input of the model is a pseudo crack image spliced in the channel dimension. and its reconstructed image , the output is a single-channel predicted crack result image. The training is performed by minimizing the loss function between the predicted output of the segmentation model and the pseudo label.
[0032] The segmentation model uses the U-Net architecture, which includes an encoder, a decoder, and jump connections. The encoder gradually reduces the spatial resolution and extracts features. It contains six convolutional blocks with a basic channel number of 64. Each convolutional block contains two convolutional layers and one The maximum pooling layer with a convolution kernel size of , the stride is ; The decoder performs upsampling through nearest neighbor interpolation and contains five convolution blocks with a convolution kernel size of , each decoder convolution block is upsampled and concatenated with the encoder convolution block output, and then processed through two convolution layers; finally, a convolution kernel size of The output layer and Sigmoid activation function generate pixel-level segmentation result probability map. The binarization threshold is set manually or automatically. Here, the manual threshold is 0.5, which can convert the result probability map into a binary mask segmentation result map. The training parameter batch size is set to 64, and the initial learning rate is 1Í10 −4 , train for 100 epochs.
[0033] (7) In the actual road crack detection application, the pseudo crack images in step (4) and step (5) are Replace it with the real road image to be detected. Follow steps (4) to (5) to obtain the reconstructed image. The road surface image to be inspected and the corresponding reconstructed image are spliced in the channel dimension and input into the trained segmentation model to finally generate the predicted defect mask as the final inspection result.
[0034] An unsupervised pavement crack detection system based on a denoising diffusion model, comprising: The first training module is used to train the denoising diffusion implicit model using the unlabeled normal road image dataset D1, and the input image is normalized to a uniform size W×H; The generation module is used to construct the road surface defect texture dataset D2 by adding noise to the normal road image and inputting the diffusion model for reconstruction, and adding random disturbance to generate abnormal road surface images; A processing module is used to generate a random Perlin noise image and binarize it to obtain a mask image, fuse the abnormal texture image with the normal road image based on the mask image, and generate a pseudo-crack road surface image and its pseudo-label; A noise adding module is used to perform forward noise adding on the pseudo crack image to generate two images with different noise levels; A reconstruction module is used to input a noisy image into a diffusion model to reconstruct a target image, and use the target image to guide the reconstruction process of another noisy image to obtain an image with defects removed; The second training module is used to build a segmentation model based on the pseudo-crack dataset. The input is the concatenation of the pseudo-crack image and its reconstructed image. The output is the predicted crack result. The training is performed by minimizing the loss function. The splicing module is used to replace the pseudo crack image with the real road surface image to be detected to obtain a reconstructed image, which is then input into the trained segmentation model to obtain the final defect detection result.
[0035] It should be noted that the system is a system corresponding to the above method, and all implementation methods in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0036] The embodiment of the present invention further provides a computing device, comprising: a processor, a memory storing a computer program, wherein when the computer program is executed by the processor, the method described above is executed. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0037] The embodiment of the present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the method described above. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
Claims
1. An unsupervised pavement crack detection method based on a denoising diffusion model, characterized in that: The method comprises: Step 1: Use the unlabeled normal road image dataset D1 to train the denoising diffusion implicit model, and the input image is normalized to a uniform size of W×H; Step 2, construct a road surface defect texture dataset D2, add noise to normal road images and input the diffusion model for reconstruction, add random disturbance to generate abnormal road surface images; Step 3, generate a random Perlin noise image and binarize it to obtain a mask image, fuse the abnormal texture image with the normal road image based on the mask image, and generate a pseudo-crack road surface image and its pseudo-label; Step 4, forward noise is added to the pseudo crack image to generate two images with different noise levels; Step 5, input a noisy image into the diffusion model to reconstruct it into a target image, and use the target image to guide the reconstruction process of another noisy image to obtain an image with defects removed; Step 6: construct a segmentation model based on the pseudo-crack dataset, with the input being the concatenation of the pseudo-crack image and its reconstructed image, and outputting the predicted crack result, which is trained by minimizing the loss function; Step 7: Replace the pseudo crack image with the real road surface image to be detected to obtain a reconstructed image, which is then stitched and input into the trained segmentation model to obtain the final defect detection result.
2. The unsupervised pavement crack detection method based on denoising diffusion model according to claim 1 is characterized in that: Construct a road surface defect texture dataset D2 by adding noise to normal road images and inputting the diffusion model for reconstruction, and add random disturbances to generate abnormal road surface images, including: Construct a road defect texture dataset D2, for each normal road image Add noise and input it into the diffusion model trained in step 1 for reconstruction. Add random disturbances to the diffusion model inverse denoising and reconstruction process to make it deviate from the normal distribution and generate abnormal road surface images. .
3. The unsupervised pavement crack detection method based on denoising diffusion model according to claim 2 is characterized in that: Generate a random Perlin noise image and binarize it to obtain a mask image. Fusion the abnormal texture image with the normal road image based on the mask image to generate a pseudo-crack road surface image and its pseudo-label, including: Construct a pavement pseudo crack dataset D3, for each pavement image in dataset D1 , generate a random two-dimensional Perlin noise image P of size W×H, and randomly select a threshold for P to binarize the image to obtain a mask image of each pixel label; The constructed road defect texture dataset D2 is used as the abnormal texture source A, and the abnormal texture images are randomly selected from A, and based on the mask map Normal road image Fusion is performed to obtain a pseudo-crack road surface image , Pseudo-crack pavement image The defect pseudo label is the obtained label map .
4. The unsupervised pavement crack detection method based on denoising diffusion model according to claim 3 is characterized in that: The pseudo crack image is forward-noised to generate two images with different noise levels, including: For each image in dataset D3 Both use the diffusion time step and , based on the noise model in the diffusion model in step 1, the pseudo crack image Perform forward noise addition to obtain an image and an image .
5. The unsupervised pavement crack detection method based on denoising diffusion model according to claim 4 is characterized in that: Input a noisy image into the diffusion model to reconstruct it into a target image, and use the target image to guide the reconstruction process of another noisy image to obtain an image with defects removed, including: For each image in the dataset D3 , the image Input the diffusion model and define the reconstructed image as the target image ; Using the target image Guide the inverse reconstruction process of the diffusion model to transform the image Reconstruct the image to remove defects .
6. The unsupervised pavement crack detection method based on denoising diffusion model according to claim 5 is characterized in that: A segmentation model is built based on the pseudo-crack dataset. The input is the concatenation of the pseudo-crack image and its reconstructed image. The output is the predicted crack result. The training is performed by minimizing the loss function, including: The segmentation model is constructed and trained based on the dataset D3. The input of the segmentation model is the pseudo crack image spliced in the channel dimension. and its reconstructed image , the output is a single-channel predicted crack result image; The training is performed by minimizing the loss function between the predicted output of the segmentation model and the pseudo label to obtain a segmentation model for pavement crack detection.
7. The unsupervised pavement crack detection method based on denoising diffusion model according to claim 6 is characterized in that: The real road surface image to be inspected replaces the pseudo crack image to obtain the reconstructed image, which is then stitched and input into the trained segmentation model to obtain the final defect detection results, including: The pseudo crack images in step 4 and step 5 are Replace it with the real road image to be detected, and obtain the reconstructed image by following steps 4 to 5. ; The road surface image to be inspected and the corresponding reconstructed image are spliced in the channel dimension and input into the trained segmentation model to obtain the final defect detection result.
8. An unsupervised pavement crack detection system based on a denoising diffusion model, characterized in that: Applied to the method according to any one of claims 1 to 7, comprising: The first training module is used to train the denoising diffusion implicit model using the unlabeled normal road image dataset D1, and the input image is normalized to a uniform size W×H; The generation module is used to construct the road surface defect texture dataset D2 by adding noise to the normal road image and inputting the diffusion model for reconstruction, and adding random disturbance to generate abnormal road surface images; A processing module is used to generate a random Perlin noise image and binarize it to obtain a mask image, fuse the abnormal texture image with the normal road image based on the mask image, and generate a pseudo-crack road surface image and its pseudo-label; A noise adding module is used to perform forward noise adding on the pseudo crack image to generate two images with different noise levels; A reconstruction module is used to input a noisy image into a diffusion model to reconstruct a target image, and use the target image to guide the reconstruction process of another noisy image to obtain an image with defects removed; The second training module is used to build a segmentation model based on the pseudo-crack dataset. The input is the concatenation of the pseudo-crack image and its reconstructed image. The output is the predicted crack result. The training is performed by minimizing the loss function. The splicing module is used to replace the pseudo crack image with the real road surface image to be detected to obtain a reconstructed image, which is then input into the trained segmentation model to obtain the final defect detection result.
9. A computing device, characterized in that include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Remote sensing image semantic segmentation method and system based on diffusion model and knowledge distillation
CN117152427A
Semi-supervised medical image segmentation method based on data enhancement strategy
CN117710681A
Aluminum foil package infrared sealing image defect detection method based on self-supervised learning
CN118297937A
Concrete crack image generation method based on de-noising diffusion probability model
CN118657719A
Medical image segmentation method and system based on diffusion model and domain adaptation
CN118799337A
Cited By
Method, device and equipment for constructing large-scale scene road crack distribution map
CN120543562A
Face forgery detection method and system based on mask and frequency diffusion reconstruction
CN120853272A