Pavement crack image segmentation method and system based on convolution block attention and diffusion model

The pavement crack image segmentation method based on convolutional block attention and diffusion model solves the problems of insufficient detection accuracy and high dataset requirements, realizes efficient and convenient pavement crack detection, and improves detection accuracy and efficiency.

CN120599469APending Publication Date: 2025-09-05SHAANXI UNIV OF SCI & TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510683606.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

Existing technologies for pavement crack detection have problems such as insufficient detection accuracy and high data set requirements. In addition, manual detection is inefficient and costly, making it difficult to meet the rapidly developing needs of highway construction.

Method used

A pavement crack image segmentation method based on convolutional block attention and diffusion model is adopted. Brightness enhancement is performed through an adaptive histogram equalization algorithm. The convolutional block attention mechanism and the diffusion generation segmentation model are combined. The U-net model is used for feature tensor training, and a feature-level joint training mechanism is adopted for crack image segmentation.

Benefits of technology

The accuracy and efficiency of crack image segmentation are improved, the demand for data set size is reduced, an end-to-end model is built, the application convenience is enhanced, and the contrast and segmentation accuracy of the crack area are significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120599469A_ABST
    Figure CN120599469A_ABST
Patent Text Reader

Abstract

The invention discloses a pavement crack image segmentation method based on a convolution block attention and diffusion model, and belongs to the technical field of computer vision deep learning application. The problem of excessive enhancement caused by traditional histogram equalization is solved through an adaptive histogram equalization algorithm, the contrast of a crack region is remarkably improved while texture details are reserved, and a higher-quality data basis is provided for subsequent segmentation; a segmentation framework combining a convolution block attention mechanism and a diffusion generation model is adopted, crack features are accurately positioned through a space-channel double attention mechanism, interference of road background noise is effectively inhibited, and the crack segmentation accuracy is improved; a feature-level joint training mechanism is adopted, convolution attention enhancement of an FEF module is matched, multi-dimensional feature complementation is achieved, multi-scale features are effectively combined, space positioning of a crack area is enhanced, an end-to-end model is constructed, and convenience of image segmentation is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer vision deep learning applications, and specifically relates to a pavement crack image segmentation method and system based on a convolutional block attention and diffusion model. Background Art

[0002] The robustness of transportation infrastructure forms the fundamental pillar of urban expansion and residents' daily lives. Among these infrastructures, concrete bridges play a crucial role. They are indispensable links between regions and cities, carrying the vital mission of supporting the passage of thousands of vehicles and pedestrians. As a key element of modern infrastructure, the safety of highway infrastructure plays a vital role in promoting economic and social progress. They not only strengthen the stability of the domestic economic cycle but also have a profound impact on promoting high-quality economic growth. If these cracks are not promptly identified and repaired, they will worsen with continued vehicle traffic and over time, evolving into more serious road surface problems, increasing maintenance costs and potentially causing traffic accidents. To ensure the long-term durability and operational efficiency of highways, maintain their smooth operation, and prevent traffic accidents, a systematic monitoring mechanism is necessary. Through periodic structural performance testing and assessment, any damage can be promptly detected and repaired, enabling dynamic identification of structural damage and functional defects and implementing preventive maintenance interventions.

[0003] Traditional manual inspection methods for road cracks are struggling to keep pace with the rapid pace of highway construction. Relying on manual inspection is not only inefficient but also comes with high labor costs, a lengthy timeframe, disrupts traffic flow, and poses potential safety risks. Therefore, this method is no longer able to meet the growing demand for inspection. With the rapid advancement of information technology, computer-aided inspection (CAD) technologies are becoming increasingly popular. These emerging technologies offer significant advantages over traditional manual inspection methods in terms of efficiency and cost-effectiveness. While neural network-assisted crack detection methods are gaining momentum, they still face a bottleneck in terms of the large dataset size required. The difficulty in collecting sufficient crack images for detailed road sections leads to reduced detection accuracy, making it difficult to accurately determine maintenance strategies for specific sections. Diffusion models, with their ability to enhance existing data, effectively alleviate the high cost and limited availability of road crack images.

[0004] Given this background, further research is needed to improve its practicality and efficiency in pavement crack detection. First, how can we ensure crack image segmentation accuracy while reducing the dataset size required by the neural network model? Second, from the perspective of practical industrial applications, how can we lower the technical barriers for practitioners, build an end-to-end model, and increase its ease of application? Summary of the Invention

[0005] The purpose of the present invention is to overcome the above-mentioned shortcomings and provide a pavement crack image segmentation method and system based on convolutional block attention and diffusion model.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a pavement crack image segmentation method based on a convolutional block attention and diffusion model, comprising the following steps: Acquire pavement crack images; Adaptive histogram equalization algorithm is used to enhance the brightness of the acquired pavement crack image to obtain a brightness-enhanced pavement crack image. A diffusion-generated segmentation model based on the convolutional block attention mechanism is used to input the brightness-enhanced pavement crack image into the segmentation model to generate a feature tensor. The generated feature tensor is then input into the U-net model for training to obtain a pseudo-label feature tensor. A feature-level joint training mechanism is adopted. The original crack image feature tensor, label feature tensor, denoised crack image feature tensor and pseudo-label feature tensor are input into independent convolution blocks respectively. Convolution attention enhancement is performed through the FEF module. The processed multi-branch features are spliced ​​along the channel dimension and input into the U-net model for segmentation to obtain the segmented crack image.

[0007] In the step of using an adaptive histogram equalization algorithm to enhance the brightness of the acquired pavement crack image to obtain the brightness-enhanced pavement crack image, contrast limitation and bilinear interpolation histogram reconstruction are introduced to enhance the contrast of the crack image.

[0008] A contrast limitation mechanism is introduced to compare the local brightness value information and the global brightness value information in the pavement crack image. The pixel brightness distribution is adjusted to enhance the distinction between the target and the background. The specific formula is as follows: (1) (2) in, Represents a sub-block The histogram of represents the contrast limit threshold, Indicates the number of pixels exceeding the contrast limit threshold, represents the histogram after contrast limiting processing, L Indicates the number of gray levels.

[0009] In the step of generating a segmentation model based on the diffusion of the convolutional block attention mechanism, inputting the brightness-enhanced road crack image into the segmentation model to generate a feature tensor, and inputting the generated feature tensor into the U-net model for training to obtain a pseudo-label feature tensor, the specific method is as follows: The pavement crack image after brightness enhancement is input into the segmentation model for position encoding processing; The position-encoded image is fed into a pre-trained visual encoder based on the DinoV2 model to obtain image representation information. The acquired image representation information is processed through a multi-layer perceptron to promote the representation alignment between the FDiT module and the corresponding layers of the DinoV2 module, generating an enhanced crack feature tensor. Noise is introduced into the processing chain composed of multiple FDiT modules. Each FDiT module performs denoising on the enhanced crack feature tensor in turn to generate a denoised crack image feature tensor. The denoised crack image and its corresponding label feature tensor are input into the U-net model for training to obtain the pseudo label feature tensor.

[0010] A convolutional block attention mechanism is embedded in the FDiT module to enhance the capture of high-frequency features of crack edges and textures through dynamic weight distribution of channels and spatial dimensions, thereby generating an enhanced crack feature tensor.

[0011] In the step of processing the acquired image representation information through a multi-layer perceptron to promote representation alignment between the FDiT module and the corresponding layer of the DinoV2 module, and generating an enhanced crack feature tensor, a feature reconstruction loss function is introduced to calculate the feature difference between the output of the decoder intermediate layer of the segmentation model and the corresponding layer of DinoV2. The mathematical expression of the feature reconstruction loss function is as follows: (6) in, and are the segmentation model parameters to be optimized, and represents the trainable parameters, Represents a random variable expectations, for The noise-free crack image at this moment, represents a noise-correlated random variable, The function represents the similarity between two parameters, Represents the feature vector corresponding to the nth patch in the feature, express The depth, Indicates the number of patches.

[0012] The feature-level joint training mechanism is adopted to input the original crack image feature tensor, label feature tensor, denoised crack image feature tensor and pseudo-label feature tensor into independent convolution blocks respectively, perform convolution attention enhancement through the FEF module, splice the processed multi-branch features along the channel dimension, and input them into the U-net model for segmentation. In the step of obtaining the segmented crack image, the FEF module is used to enhance the image or label features through the convolution block attention, and then combine them with the original data set input features to adjust the input dimension.

[0013] The FEF module adopts the convolution block attention mechanism and multi-layer convolution architecture, and its multi-layer convolution architecture is as follows: The first layer uses a convolution kernel size of 3×3 combined with the ReLU function; The second layer uses a convolution kernel size of 5×5 combined with a Leaky ReLU function; The third layer uses a convolution kernel size of 1×1 combined with a sigmoid function.

[0014] It also includes: measuring the crack segmentation accuracy by calculating the difference between the segmented crack image and the true label.

[0015] In a second aspect, the present invention provides a pavement crack image segmentation system based on a convolutional block attention and diffusion model, comprising: An acquisition module, used for acquiring a road crack image; A preprocessing module is used to enhance the brightness of the acquired pavement crack image using an adaptive histogram equalization algorithm to obtain a brightness-enhanced pavement crack image; The representation alignment generation module is used to generate a segmentation model based on the diffusion of the convolutional block attention mechanism. The brightness-enhanced pavement crack image is input into the segmentation model to generate a feature tensor. The generated feature tensor is then input into the U-net model for training to obtain a pseudo-label feature tensor. The joint segmentation module adopts a feature-level joint training mechanism to input the original crack image feature tensor, label feature tensor, denoised crack image feature tensor and pseudo-label feature tensor into independent convolution blocks respectively. The FEF module performs convolution attention enhancement, and the processed multi-branch features are spliced ​​along the channel dimension and input into the U-net model for segmentation to obtain the segmented crack image.

[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention discloses a pavement crack image segmentation method based on a convolutional block attention and diffusion model, comprising the following steps: acquiring a pavement crack image; performing brightness enhancement on the acquired pavement crack image using an adaptive histogram equalization algorithm to obtain a brightness-enhanced pavement crack image; using a diffusion generation segmentation model based on a convolutional block attention mechanism, inputting the brightness-enhanced pavement crack image into a segmentation model to generate a feature tensor, and inputting the generated feature tensor into a U-net model for training to obtain a pseudo-label feature tensor; using a feature-level joint training mechanism, respectively inputting the original crack image feature tensor, the label feature tensor, the denoised crack image feature tensor, and the pseudo-label feature tensor into independent convolution blocks, performing convolutional attention enhancement using an FEF module, splicing the processed multi-branch features along the channel dimension, and inputting the processed multi-branch features into a U-net model for segmentation to obtain a segmented crack image. The adaptive histogram equalization algorithm solves the over-enhancement problem caused by traditional histogram equalization, significantly improving the contrast of crack areas while retaining texture details, providing a higher-quality data foundation for subsequent segmentation. A segmentation framework combining the convolutional block attention mechanism with the diffusion generation model is adopted. The spatial-channel dual attention mechanism is used to accurately locate crack features, effectively suppressing the interference of road background noise and improving the accuracy of crack segmentation. The feature-level joint training mechanism is adopted, combined with the convolutional attention enhancement of the FEF module, to achieve multi-dimensional feature complementarity, effectively combine multi-scale features and strengthen the spatial positioning of crack areas, build an end-to-end model, and enhance the convenience of image segmentation.

[0017] Furthermore, the DinoV2 self-supervised visual representation model is used for pre-training to extract global features. By introducing a feature reconstruction loss function, the intermediate layer output of the FDiT model is aligned with the pre-trained features of DinoV2, which significantly accelerates the model convergence speed, reduces the neural network model's demand for data set size, and solves the problem of high computational complexity of traditional diffusion models. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 Flow chart of the method of the present invention; Figure 2 Schematic diagram of the structure of the method of the present invention; Figure 3 This is a general framework diagram of the diffusion Transformer model based on representation learning in the present invention; Figure 4 This is the overall framework diagram of the end-to-end crack image segmentation model in the present invention; Figure 5 A diagram of the multi-layer convolutional structure in the feature enhancement and fusion module of Example 1 of the present invention; Figure 6This is a comparison chart of image quality evaluation results generated by the FDiT model in Example 2 of the present invention and other generation models; Figure 7 This is a visualization comparison result diagram of crack generation images of different models in Example 2 of the present invention; Figure 8 This is a comparison of the semantic segmentation performance of different methods in Example 2 of the present invention on the CRACK500 dataset; Figure 9 This is a visualization comparison result diagram of image segmentation using different methods in Example 2 of the present invention. DETAILED DESCRIPTION

[0019] In order to further understand the content of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the embodiments are only for explaining the present invention and are not intended to limit it.

[0020] like Figures 1 and 2 As shown in FIG, a pavement crack image segmentation method based on convolutional block attention and diffusion model includes the following steps: S1: Acquire pavement crack images; S2: using an adaptive histogram equalization algorithm to perform brightness enhancement on the acquired pavement crack image to obtain a brightness enhanced pavement crack image; S3: Based on the diffusion generative segmentation model of the convolutional block attention mechanism, the brightness-enhanced pavement crack image is input into the segmentation model to generate a feature tensor, which is then input into the U-net model for training to obtain the label feature tensor. S4: A feature-level joint training mechanism is adopted to input the original crack image feature tensor, label feature tensor, denoised crack image feature tensor and pseudo-label feature tensor into independent convolution blocks respectively. Convolutional attention enhancement is performed through the FEF module. The processed multi-branch features are spliced ​​along the channel dimension and input into the U-net model for segmentation to obtain the segmented crack image.

[0021] Specifically, in S2, an adaptive histogram equalization algorithm is used to perform local brightness enhancement on the acquired pavement crack image. The brightness-enhanced pavement crack image is obtained by limiting contrast clipping and reconstructing the histogram using bilinear interpolation. The specific method is as follows: The contrast limiting mechanism is introduced to compare the local brightness value information and the global brightness value information in the road crack image, and to enhance the distinction between the target and the background by adjusting the pixel brightness distribution. When calculating the histogram of the sub-block (local brightness value information), a contrast limiting threshold is set. If the number of pixels at a certain gray level exceeds the threshold , the number of pixels exceeding the threshold is evenly distributed to other gray levels, thereby avoiding excessive enhancement of local contrast.

[0022] Specifically, let the sub-block The histogram of , the contrast limit threshold is For grayscale ,if , then the number of pixels exceeding the threshold Evenly distributed to other gray levels, its mathematical expression is shown in formula (1). Histogram after contrast limitation processing The mathematical expression of is shown in formula (2). Finally, according to the processed histogram Grayscale mapping is performed on the pixels in the sub-block. The specific formula is as follows: (1) (2) in, Represents a sub-block The histogram of represents the contrast limit threshold, Indicates the number of pixels exceeding the contrast limit threshold, represents the histogram after contrast limiting processing, L Indicates grayscale levels.

[0023] Furthermore, the process and principle of bilinear interpolation to reconstruct the histogram are as follows: In histogram reconstruction, the histogram's horizontal axis (grayscale value) is considered the x-axis, and the vertical axis (frequency) is considered the y-axis. Because the histogram data after contrast-limited cropping is discrete and suffers from information loss, bilinear interpolation is used to calculate continuous frequency values ​​between discrete histogram data points, transforming the histogram from a discrete state to a continuous, smooth distribution.

[0024] A two-dimensional plane is given by four known points , , , , to calculate the point The function value of ,in .

[0025] First, linear interpolation is performed along the x direction. and Linear interpolation is performed on the two lines. On this line, calculate , its value is obtained by linear combination of the function values ​​of point A and point C, as shown in formula (1). On this line, the calculation formula is shown in formula (2).

[0026] (1) (2) Then, linear interpolation is performed along the y direction, using the previously calculated and , calculate the point P function value through linear combination , the calculation formula is shown in (3).

[0027] .

[0028] The histogram reconstructed by bilinear interpolation can better reflect the grayscale distribution characteristics of the local area of ​​the image, and thus provide a more reasonable basis for the subsequent remapping of the image pixel grayscale values ​​according to the new histogram, ultimately achieving local contrast enhancement and obtaining an enhanced image that is more suitable for segmentation model processing.

[0029] Specifically, in S3, such as Figure 3 As shown in the figure, a diffusion-generated segmentation model based on the convolutional block attention mechanism is used to input the brightness-enhanced pavement crack image into the segmentation model to generate a feature tensor. The generated feature tensor is then input into the U-net model for training to obtain a pseudo-label feature tensor. The specific method is as follows: When using self-supervised learning to train a visual encoder, the effect of using a decoder with reconstruction loss is far inferior to using a joint embedding architecture with feature prediction loss and collapse prevention mechanism. Therefore, the present invention includes the feature prediction loss of DinoV2 (Distillation with NO labels, Version 2, a self-supervised visual representation learning framework) on the basis of focusing on the generated pixels of the crack image enhancement, so that the internal representation of the decoder can be accelerated according to the pre-trained visual encoder. The segmentation model adopts a simple regularization technique based on the diffusion Transformer architecture. The diffusion Transformer model is introduced to capture the long-range dependencies of the crack image, and combined with the multi-step iterative denoising of the diffusion model, it realizes the refined modeling from noise to real crack features, ensuring the generation of high-quality crack images while improving the sampling speed. This regularization can better align the extended model representation with the target self-supervised representation. The working method of the segmentation model is as follows: The pavement crack image after brightness enhancement is input into the segmentation model for position encoding processing; The position-encoded image is fed into a pre-trained visual encoder based on the DinoV2 model to obtain image representation information, including its feature tensor and label feature tensor. This visual encoder is pre-trained on the ImageNet256 dataset to learn image representations. The acquired image representation information is processed through a multi-layer perceptron, which drives the alignment of the representations of the corresponding layers of the FDiT module and the DinoV2 module, generating an enhanced crack feature tensor. This accelerates the FDiT module's learning of low-frequency background and coarse crack pixels in the crack image, thereby improving the overall sampling speed of the model. Noise is introduced into the processing chain composed of multiple FDiT modules. Each FDiT module performs denoising on the enhanced crack feature tensor in turn to generate a denoised crack image feature tensor. The denoised crack image and its corresponding label tensor are input into the U-net model for training to obtain the pseudo-label feature tensor.

[0030] This regularization method effectively distills pre-trained self-supervised visual representations into the FDiT module, enabling the segmentation model to fully utilize these semantically rich external representations for generation, significantly improving performance. The convolutional block attention mechanism embedded in the FDiT module enhances the capture of high-frequency features such as crack edges and textures through dynamic weight distribution across channels and spatial dimensions, generating an enhanced crack feature tensor.

[0031] Furthermore, the segmentation model introduces a feature reconstruction loss function to calculate the feature difference between the output of the intermediate layer of the decoder of the segmentation model and the corresponding layer of DinoV2, constraining the distribution consistency of low-frequency background features. Its goal is to enable the hidden state of the diffusion Transformer architecture to predict noise-free visual representations, thereby extracting noisy inputs containing semantic information. is a pre-trained encoder, for The crack image without noise at this moment, the features encoded by pre-training The mathematical expression of is shown in formula (3). Indicates the total number of patches. express The segmentation model will and Perform representation alignment, is the encoder output of the diffusion converter The result after projection through the trainable head, and The mathematical expressions of are shown in formula (4) and formula (5) respectively. The method proposed in this invention adopts multi-layer perceptron parameterization .

[0032] (3) (4) (5) in, represents a trainable parameter function, Represents the input noise data at time t, and the segmentation model is represented by maximizing the pre-training and hidden state The feature reconstruction loss function is The mathematical expression is shown in formula (6): (6) in, and are the segmentation model parameters to be optimized, Represents a random variable expectations, The function represents the similarity between two parameters, represents the feature vector corresponding to the nth patch, express The depth, Indicates the number of patches.

[0033] Reconstruct the loss function from features Added to the objective function of the segmentation model, its mathematical expression is shown in formula (7): (7) in, Represents the final objective function of the segmentation model, Represents the original objective function of the segmentation model, represents a hyperparameter that acts as a trade-off.

[0034] Specifically, in S4, a feature-level joint training mechanism is adopted. The original crack image feature tensor and its corresponding label feature tensor, as well as the generated denoised crack image feature tensor and its corresponding pseudo-label feature tensor are input into independent convolution blocks. Convolutional attention enhancement is performed through the FEF module. The processed multi-branch features are spliced ​​along the channel dimension and input into the U-net model for segmentation to obtain the segmented crack image. The specific method is as follows: In the end-to-end model, the entire process from the input image to the labeling or segmentation of the crack area in the output image is processed within a unified framework without the need for manual intervention or separate intermediate steps. Figure 4 As shown in the figure, the FEF module (Feature Enhancement and Fusion module) is used to enhance the image or label features through the convolution block attention, and then combine them with the input features of the original dataset to adjust the input dimension.

[0035] The FEF module proposed in this paper adopts the convolution block attention mechanism and multi-layer convolution architecture, where the multi-layer convolution architecture is as follows: Figure 5 As shown in the figure, it mainly undertakes the triple functions of feature space mapping, dimensionality adaptation, and information enhancement. The FEF module directly processes the generated denoised crack image tensor output by the segmentation model and converts it into a feature representation that meets the input requirements of the U-net through convolution operations, while retaining and enhancing the semantic information of the crack features. The FEF module design follows the lightweight principle, minimizing computational complexity while ensuring the effect of feature conversion. Its core consists of three convolutional layers, each equipped with batch normalization and nonlinear activation functions. The specific design of the FEF module is as follows: Suppose the output image of the segmentation model is ,in Indicates the height of the image, Indicates the width of the image, Indicates the number of channels of the image. The size of the first convolution kernel is , the input channel is , a symmetric filling strategy is used to keep the spatial dimension unchanged. Then, input image Convert to feature map ,in and is the height and width of the feature map after the convolution operation. The present invention uses the same padding. , The main function of this layer is to expand the number of channels, map the original RGB three-channel features to a 64-dimensional feature space, and enhance the model's ability to express crack features in different color spaces. Selecting a 3×3 convolution kernel can capture local neighborhood features while avoiding the loss of detail information caused by an excessively large receptive field. In order to enhance the nonlinear expression ability of the model, an activation function is usually added after each convolution layer. The FEF module uses The Rectified Linear Unit (Rectified Linear Unit) activation function implements nonlinear transformation, which can effectively improve the feature separability. Its mathematical expression is shown in formula (8). application After the activation function, the activated feature map is obtained .

[0036] (8) The size of the second convolution kernel is In order to capture a wider range of context information, the activation function of this layer adopts Function, used to alleviate the problem of gradient explosion. The mathematical expression of the function is shown in formula (9). Let the second layer convolution kernel be , after convolution and activation operations, the feature map is obtained .

[0037] (9) Finally, in order to ensure that the output of the conversion module can match the input of the U-net model, we need to adjust the final feature map. The convolution kernel performs channel compression and linearly combines the channels without changing the size of the feature map. Convolution achieves cross-channel information fusion while maintaining the integrity of spatial information, and is particularly suitable for linear combinations between feature channels. Function normalization to obtain the final feature map F , its mathematical expression is shown in formula (10).

[0038] (10) use This function ensures that pixel values ​​are distributed in the interval [0, 1], consistent with the expected distribution of the U-net model input layer. The final output features retain the full spatial resolution information, avoiding the blurring of crack edges caused by pooling operations.

[0039] Example 2 The verification results based on the embodiments of the present invention are as follows: In order to verify the effectiveness of the proposed method, the FDiT model based on representation learning, the variational autoencoder (VAE) and the crack images generated by GAN were used to calculate the FID index and KID index. The comparison results are shown in Figure 2. Figure 6 The generated images of each model are visualized as shown in Figure 7 shown. Figure 6 The FID index is an image feature extracted based on the pre-trained Inception network. It measures the difference between the real image and the generated image by calculating the statistical distance in the feature space. Suppose the mean vector of the real crack image feature is , the covariance matrix is ; The mean vector of the crack image features is generated as , the covariance matrix is , the mathematical expression of FID is shown in formula (11). represents the Euclidean norm, represents the trace of the matrix.

[0040] (11) in, The mean vector representing the true crack image features; Represents the mean vector of generated crack image features; express The covariance matrix of express The covariance matrix of represents the Euclidean norm; represents the trace of the matrix.

[0041] Figure 6 The KID index in

[15] also uses the network features of pre-trained Inception to measure the similarity between real images and generated images through a kernel function. Compared with FID, KID is more robust to fluctuations in the number of samples and has a more stable calculation. A smaller KID value indicates that the distribution of generated images and real images in the feature space is more similar. Suppose that the set of real crack images is and generate a set of crack images Extract Samples and The number of samples is , the mathematical expression of KID is shown in formula (12).

[0042] (12) in: Represents a collection of crack images The sample drawn; Represents the generated image set The sample drawn; Represents a collection of crack images the number of samples drawn; Represents the generated image set The number of samples drawn.

[0043] By observation Figure 6The data shows that crack images generated by VAE have the lowest quality, while FDiT has the highest quality. FDiT's FID index is 25.2 lower than that of VAE and 17.1 lower than that of GAN. FDiT's KID index is 0.0477 lower than that of VAE and 0.0181 lower than that of GAN. The core reason why VAE and GAN are slightly inferior to diffusion models in generation quality can be attributed to the fundamental differences in their probabilistic modeling mechanisms. VAEs map the data distribution to the latent space by introducing a KL divergence constraint. While this approximate inference ensures training stability, it forces the latent variable distribution to be close to the prior (e.g., a Gaussian distribution), resulting in information loss in the generated samples, manifesting as blurring or loss of detail. GANs implicitly model the data distribution through adversarial training, but the optimization objective of their generator is theoretically inconsistent with the Kullback-Leibler divergence of the true data distribution. This makes the training process prone to mode collapse and makes it difficult to capture the multimodality of the data distribution. In addition, the saturation problem of the discriminative ability of the GAN discriminator will also limit the diversity and fidelity of the generated samples. The diffusion model gradually destroys the data structure through an explicit Markov chain diffusion process, and learns a refined expression of the data distribution in the reverse denoising process. Its advantages are that it gradually restores data details through cumulative optimization of a multi-step denoising process; explicit optimization based on the likelihood function avoids the adversarial training instability of GAN; and the implicit probabilistic modeling framework allows for more flexible capture of complex data structures, thereby significantly outperforming traditional models in the fidelity, diversity, and detail restoration of generated samples. In summary, the effectiveness of the method proposed in the present invention has been verified.

[0044] observe Figure 7 The visualization results show that for samples that exhibit both rough texture and fine details, the VAE-generated images exhibit significant texture loss and fail to reproduce the crack characteristics of the real CRACK500 samples. The GAN-generated images exhibit fractured or distorted crack structures, failing to reproduce the continuous extension of real cracks. For crack samples with complex branches, while CBIDM can capture the basic orientation, it lacks fine branch detail. FDiT-generated images, on the other hand, closely resemble the real CRACK500 samples in terms of crack texture, structural continuity, and integration with the background. Analysis reveals that the reasons for this are: VAE, due to its limited latent space modeling capabilities, struggles to capture the complex crack characteristics; GAN suffers from pattern collapse, preventing it from stably generating reasonable structures; CBIDM, while advantageous for progressive generation, lacks the ability to handle long-range dependencies. FDiT leverages the Transformer's ability to capture long-range dependencies through its self-attention mechanism, combined with a diffusion model to refine the generation process, accurately models the texture and structure of pavement cracks. Consequently, it significantly outperforms other models in generation quality, achieving a realistic reproduction of the complex characteristics of pavement cracks.

[0045] In order to further verify the performance of the segmentation method proposed in this paper, the semantic segmentation performance of the pavement crack image of the proposed method was compared with that of U-net, PSPNet, DeepLabV3+, HRNet and CBIDM models. The results are shown in Figure 2. Figure 8 As shown in Figure 2, the visualization results of different segmentation models are as follows: Figure 9 shown.

[0046] By observation Figure 8 It can be seen that the proposed FDiT model has the best segmentation performance, with mIoU improved by 2.92%, mAP improved by 2.15%, and Acc improved by 1.06% compared to the CBIDM model used. Analysis shows that the reasons for this are: CBIDM's underlying architecture is DDIM, which, as an improved variant of the diffusion model, optimizes generation speed through a deterministic sampling path, but sacrifices some generation diversity and detail fidelity. Its implicit probabilistic modeling framework has limitations in the refined representation of complex data distributions; PSPNet achieves multi-scale context aggregation through a pyramid pooling module, but the global average pooling operation leads to the loss of spatial detail information, especially when dealing with small, elongated targets such as cracks, making it difficult to accurately capture their edge continuity. While DeepLabV3+'s modules, constructed using atrous spatial pyramid pooling (ASPP), can expand the receptive field, their gridding artifacts (GA) can introduce artifacts. Furthermore, its encoder-decoder architecture only restores resolution through simple bilinear interpolation in the decoder stage, failing to effectively utilize low-level features and resulting in blurred crack edge segmentation. HRNet maintains high-resolution features through a multi-branch parallel structure, but lacks an explicit information exchange mechanism between branches and skip connections, making it difficult to establish a direct link between deep semantic features and shallow detail features, thus weakening its ability to accurately model the local structure of cracks. In contrast, FDiT's symmetric encoder-decoder architecture directly fuses shallow high-resolution features with deep semantic features through skip connections, preserving the spatial detail of cracks while effectively integrating contextual semantics. This makes it particularly suitable for processing cracks with complex morphology and low contrast. In addition, the data augmentation design in FDiT reduces the risk of overfitting and performs more robustly in small sample scenarios. However, PSPNet, DeepLabV3+, and HRNet have larger parameter sizes and require more training data. They are prone to poor generalization performance when data is scarce in specific areas such as pavement cracks.

[0047] observe Figure 9The visualization results show that: in the first row of crack samples, U-net and DeepLabV3+ have obvious neglect of the definition of small crack edges, and PSPNet and HRNet mistakenly divide large areas of background into crack areas; FDiT clearly outlines the edges of small cracks, effectively solving the problems of missed segmentation and blurred boundaries of small cracks. Although CBIDM can present the crack morphology, it has blurred boundaries. In the second row of complex crack branch samples, models such as U-net and PSPNet have segmentation breaks or area loss. FDiT maintains the consistency of crack segmentation and accurately restores branch details. The boundary clarity and detail integrity of CBIDM are slightly inferior to FDiT. In the fourth row of low-contrast crack samples, U-net, DeepLabV3+, and HRNet significantly ignore cracks. PSPNet missegments at the junction of coarse and thin cracks. FDiT achieves coherent and detailed segmentation with precise feature capture. Although CBIDM can identify cracks, the blurred boundaries affect the accuracy.

[0048] Example 3 A pavement crack image segmentation system based on convolutional block attention and diffusion model, including: An acquisition module, used for acquiring a road crack image; A preprocessing module is used to enhance the brightness of the acquired pavement crack image using an adaptive histogram equalization algorithm to obtain a brightness-enhanced pavement crack image; The representation alignment generation module is used to generate a segmentation model based on the diffusion of the convolutional block attention mechanism. The brightness-enhanced pavement crack image is input into the segmentation model to generate a feature tensor. The generated feature tensor is then input into the U-net model for training to obtain a pseudo-label feature tensor. The joint segmentation module adopts a feature-level joint training mechanism to input the original crack image feature tensor, label feature tensor, denoised crack image feature tensor and pseudo-label feature tensor into independent convolution blocks respectively. The FEF module performs convolution attention enhancement, and the processed multi-branch features are spliced ​​along the channel dimension and input into the U-net model for segmentation to obtain the segmented crack image.

[0049] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.

Claims

1. A pavement crack image segmentation method based on convolutional block attention and diffusion model, characterized in that: The steps include: Acquire pavement crack images; Adaptive histogram equalization algorithm is used to enhance the brightness of the acquired pavement crack image to obtain a brightness-enhanced pavement crack image. A diffusion-generated segmentation model based on the convolutional block attention mechanism is used to input the brightness-enhanced pavement crack image into the segmentation model to generate a feature tensor. The generated feature tensor is then input into the U-net model for training to obtain a pseudo-label feature tensor. A feature-level joint training mechanism is adopted. The original crack image feature tensor, label feature tensor, denoised crack image feature tensor and pseudo-label feature tensor are input into independent convolution blocks respectively. Convolution attention enhancement is performed through the FEF module. The processed multi-branch features are spliced ​​along the channel dimension and input into the U-net model for segmentation to obtain the segmented crack image.

2. The pavement crack image segmentation method based on convolutional block attention and diffusion model according to claim 1 is characterized in that: In the step of using an adaptive histogram equalization algorithm to enhance the brightness of the acquired pavement crack image to obtain the brightness-enhanced pavement crack image, contrast limitation and bilinear interpolation histogram reconstruction are introduced to enhance the contrast of the crack image.

3. The pavement crack image segmentation method based on convolutional block attention and diffusion model according to claim 2 is characterized in that: A contrast limitation mechanism is introduced to compare the local brightness value information and the global brightness value information in the pavement crack image. The pixel brightness distribution is adjusted to enhance the distinction between the target and the background. The specific formula is as follows: (1) (2) in, Represents a sub-block The histogram of represents the contrast limit threshold, Indicates the number of pixels exceeding the contrast limit threshold, represents the histogram after contrast limiting processing, L Indicates the number of gray levels.

4. The pavement crack image segmentation method based on convolutional block attention and diffusion model according to claim 1 is characterized in that: In the step of generating a segmentation model based on the diffusion of the convolutional block attention mechanism, inputting the brightness-enhanced road crack image into the segmentation model to generate a feature tensor, and inputting the generated feature tensor into the U-net model for training to obtain a pseudo-label feature tensor, the specific method is as follows: The pavement crack image after brightness enhancement is input into the segmentation model for position encoding processing; The position-encoded image is fed into a pre-trained visual encoder based on the DinoV2 model to obtain image representation information. The acquired image representation information is processed through a multi-layer perceptron to promote the representation alignment between the FDiT module and the corresponding layers of the DinoV2 module, generating an enhanced crack feature tensor. Noise is introduced into the processing chain composed of multiple FDiT modules. Each FDiT module performs denoising on the enhanced crack feature tensor in turn to generate a denoised crack image feature tensor. The denoised crack image and its corresponding label feature tensor are input into the U-net model for training to obtain the pseudo label feature tensor.

5. The pavement crack image segmentation method based on convolutional block attention and diffusion model according to claim 4 is characterized in that: A convolutional block attention mechanism is embedded in the FDiT module to enhance the capture of high-frequency features of crack edges and textures through dynamic weight distribution of channels and spatial dimensions, thereby generating an enhanced crack feature tensor.

6. The pavement crack image segmentation method based on convolutional block attention and diffusion model according to claim 4 is characterized in that: In the step of processing the acquired image representation information through a multi-layer perceptron to promote representation alignment between the FDiT module and the corresponding layer of the DinoV2 module, and generating an enhanced crack feature tensor, a feature reconstruction loss function is introduced to calculate the feature difference between the output of the decoder intermediate layer of the segmentation model and the corresponding layer of DinoV2. The mathematical expression of the feature reconstruction loss function is as follows: (6) in, and are the segmentation model parameters to be optimized, and represents the trainable parameters, Represents a random variable expectations, for The noise-free crack image at this moment, represents a noise-correlated random variable, The function represents the similarity between two parameters, Represents the feature vector corresponding to the nth patch in the feature, express The depth, Indicates the number of patches.

7. The pavement crack image segmentation method based on convolutional block attention and diffusion model according to claim 1 is characterized in that: The feature-level joint training mechanism is adopted to input the original crack image feature tensor, label feature tensor, denoised crack image feature tensor and pseudo-label feature tensor into independent convolution blocks respectively, perform convolution attention enhancement through the FEF module, splice the processed multi-branch features along the channel dimension, and input them into the U-net model for segmentation. In the step of obtaining the segmented crack image, the FEF module is used to enhance the image or label features through the convolution block attention, and then combine them with the original data set input features to adjust the input dimension.

8. The pavement crack image segmentation method based on convolutional block attention and diffusion model according to claim 7 is characterized in that: The FEF module adopts the convolution block attention mechanism and multi-layer convolution architecture, and its multi-layer convolution architecture is as follows: The first layer uses a convolution kernel size of 3×3 combined with the ReLU function; The second layer uses a convolution kernel size of 5×5 combined with a Leaky ReLU function; The third layer uses a convolution kernel size of 1×1 combined with a sigmoid function.

9. The pavement crack image segmentation method based on convolutional block attention and diffusion model according to claim 1, characterized in that: Also includes: The crack segmentation accuracy is measured by calculating the difference between the segmented crack image and the true label.

10. A road crack image segmentation system based on convolutional block attention and diffusion model according to any one of claims 1 to 9, characterized in that: include: An acquisition module, used for acquiring a road crack image; A preprocessing module is used to enhance the brightness of the acquired pavement crack image using an adaptive histogram equalization algorithm to obtain a brightness-enhanced pavement crack image; The representation alignment generation module is used to generate a segmentation model based on the diffusion of the convolutional block attention mechanism. The brightness-enhanced pavement crack image is input into the segmentation model to generate a feature tensor. The generated feature tensor is then input into the U-net model for training to obtain a pseudo-label feature tensor. The joint segmentation module adopts a feature-level joint training mechanism to input the original crack image feature tensor, label feature tensor, denoised crack image feature tensor and pseudo-label feature tensor into independent convolution blocks respectively. The FEF module performs convolution attention enhancement, and the processed multi-branch features are spliced ​​along the channel dimension and input into the U-net model for segmentation to obtain the segmented crack image.

Citation Information

Cited By

  • Hydraulic engineering concrete crack detection method and system

    CN121074034A

  • A method and system for detecting concrete cracks in hydraulic engineering

    CN121074034B