Pavement crack detection method and device and electronic equipment
Through the improved U-Net model, combined with the cross-scale attention mechanism and switchable normalization, the problem of feature information loss and gridding in pavement crack detection is solved, the detection accuracy and model performance are improved, and it is suitable for environments with limited resources.
Patent Information
- Application Number
- CN202410769400.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-11
AI Technical Summary
Existing pavement crack detection methods suffer from the problems of time-consuming and labor-intensive manual detection, inconsistent results, and loss of feature information and gridding in deep learning models, resulting in low segmentation accuracy and inconsistent model complexity and performance.
The improved U-Net model is adopted, by introducing the cross-scale joint attention interaction module and the joint attention expansion module, combined with the pixel inverse reorganization layer and switchable normalization, SiLU activation function, to enhance feature extraction and fusion, reduce the amount of parameters, and improve cracks Segmentation accuracy.
It improves the accuracy and segmentation effect of pavement crack detection, reduces model complexity, is suitable for environments with limited resources, and can accurately identify detailed features in low contrast and complex backgrounds.
Smart Images

Figure CN118761964A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of structural engineering technology, and in particular to a road crack detection method, device and electronic equipment. Background Art
[0002] Cracks are widely recognized as a potential risk factor in structural engineering, and their presence may cause irreversible damage to buildings and infrastructure. Cracks can weaken the strength and stability of structures, and may eventually cause them to collapse or collapse. Therefore, early detection and timely repair of cracks are essential to ensure structural safety. However, traditional manual crack detection has a series of disadvantages that limit its application in large-scale structural monitoring. First, manual detection consumes a lot of manpower and time, and is easily affected by subjective factors and fatigue, resulting in inconsistent detection results; at the same time, crack detection is affected by a variety of complex factors, such as lighting conditions, differences in structural materials, crack shape and size, and low foreground-background contrast. These factors make the accurate positioning and precise identification of cracks a challenging task.
[0003] With the rapid development of deep learning, although the existing deep learning-based image segmentation methods have achieved good results in detecting pavement cracks, there are still some shortcomings: multiple downsampling in the network model is conducive to abstract feature extraction, but this also leads to the loss of crack image information; in the process of feature fusion in encoding and decoding, simply fusing low-level features with high-level features will make the features related to defects easily submerged by the background; although the void convolution can expand the receptive field of the network, there is a gridding problem, which will cause the overall structure of the segmented cracks to be blurred and unclear, weakening the focus on small defect areas, and ultimately affecting the segmentation accuracy; without paying attention to the trade-off between performance and complexity, models with better accuracy often have a large number of parameters, which is not conducive to actual model deployment. Summary of the invention
[0004] The purpose of the present application is to provide a pavement crack detection method, device and electronic equipment, which can perform pavement crack detection through an improved U-Net model, highlight features that are conducive to crack segmentation, so as to solve the problems raised in the background technology, thereby improving the accuracy of pavement crack segmentation.
[0005] In a first aspect, the present application provides a pavement crack detection method, the method comprising: obtaining a pavement crack image to be detected; inputting the pavement crack image into a preset pavement crack detection model, and outputting a crack detection result corresponding to the pavement crack image; wherein the pavement crack detection model is obtained by training an improved U-Net model using a deep supervision method; the improved U-Net model comprises: an improved encoding layer connected with a pixel anti-recombination layer and a decoding layer connected with a pixel reconstruction layer as a sampling combination, and introducing a cross-scale joint attention interaction module and a joint attention expansion module, the improved encoding layer comprises: two three-branch convolutional layers, switchable normalization and SiLU activation function.
[0006] Furthermore, the overall network structure corresponding to the above-mentioned pavement crack detection model includes: a first convolutional layer, a first encoding layer, a first pixel anti-reorganization layer, a second encoding layer, a first channel separation layer, a second pixel anti-reorganization layer, a third encoding layer, a second channel separation layer, a third pixel anti-reorganization layer, a fourth encoding layer, a second convolutional layer, a joint attention expansion module, a first decoding layer, a first pixel reorganization layer, a third convolutional layer, a first cross-scale joint attention interaction module, a second decoding layer, a second pixel reorganization layer, a second cross-scale joint attention interaction module, a third decoding layer, a third pixel reorganization layer, a third cross-scale joint attention interaction module, a fourth decoding layer, and a fourth convolutional layer, which are connected in sequence; the first encoding layer is also connected to the third cross-scale joint attention interaction module; the first channel separation layer is also connected to the second cross-scale joint attention interaction module; the second channel separation layer is also connected to the first cross-scale joint attention interaction module.
[0007] Furthermore, the training process of the above-mentioned pavement crack detection model is as follows: obtain a pavement crack data set; perform preprocessing operations on the pavement crack data set to obtain a training set; the preprocessing operations include image enhancement operations; based on a deep supervision algorithm, the overall network structure is trained through the training set, and the weight parameters with the best evaluation indicators are saved as pre-training weights to obtain a pavement crack detection model; wherein the evaluation indicators include recall rate, accuracy, F1 score, average precision, parameter quantity, floating-point operations and frames per second; and a mixed loss is used to calculate the loss value during the training process.
[0008] Furthermore, the specific implementation process of the joint channel-space dual attention mechanism in the above-mentioned cross-scale joint attention interaction module and the joint attention expansion module is as follows: after the first convolution processing is performed on the target feature map, the global average pooling and global maximum pooling operations are used to compress the spatial information in the spatial dimension to obtain the first average pooling feature and the first maximum pooling feature; the first average pooling feature and the first maximum pooling feature are respectively subjected to the second convolution processing, and then the shared convolution processing is performed to capture the global dependency and generate two channel weights, the two channel weights are added, and the channel attention map is obtained through the sigmoid function; the target feature map is the feature map from the previous stage; the target After the feature map is processed by the third convolution, the global average pooling and global maximum pooling operations are used to compress the channel information in the channel dimension to obtain the second average pooling features and the second maximum pooling features; the second average pooling features and the second maximum pooling features are concatenated, and then a sub-network is used to generate a spatial weight with a larger receptive field, and finally a spatial attention map is obtained through a sigmoid function; wherein the sub-network includes two extended convolutions with different expansion rates; the channel attention map and the spatial attention map are recombined and matrix multiplication is performed to obtain a reshaped feature map, and the reshaped feature map is input into a depth-separable extended convolution to simulate spatial dependencies and generate a channel spatial feature map.
[0009] Furthermore, the working process of the above-mentioned cross-scale joint attention interaction module is as follows: the first low-level feature map from the encoding stage and the first high-level feature map from the decoding stage are respectively processed by the channel-spatial attention mechanism to obtain a first channel spatial feature map and a second channel spatial feature map; the first high-level feature map is calibrated using the first channel spatial feature map, and the first high-level feature map is added to obtain the second high-level feature map; the first low-level feature map is calibrated using the second channel spatial feature map, and the first low-level feature map is added to obtain the second low-level feature map; the second high-level feature map and the second low-level feature map are connected, and two depth-separable convolutional layers are used to fuse them to generate an integrated weight map; the integrated weight map is used to recalibrate the first low-level feature map and the first high-level feature map, and they are fused through a depth-separable convolutional layer to obtain a fused feature map; the fused feature map is used as the output feature map, or the fused feature map is subtracted from the feature map after average pooling itself to generate a new weight map as the output feature map.
[0010] Furthermore, the above-mentioned joint attention expansion module includes a channel-spatial attention mechanism branch and a main branch composed of three convolutional layers with different expansion rates; the working process of the joint attention expansion module is as follows: the input feature map is processed by the channel-spatial attention mechanism to obtain a third channel spatial attention map; the input feature map is processed by three convolutional layers to obtain an expanded convolution feature map; the third channel spatial attention map is element-wise multiplied with the expanded convolution feature map, the multiplication result is multiplied with the scale parameter, and the expanded convolution feature map is element-wise added to obtain the final output feature map.
[0011] Furthermore, the encoding layer divides the input feature map into three parts according to a preset channel ratio to obtain a first channel feature map, a second channel feature map and a third channel feature map; wherein, after the first channel feature map passes through the first convolution switchable normalization layer, it is added to the second channel feature map to obtain a fourth channel feature map, and the fourth channel feature map passes through the second convolution switchable normalization layer, the third convolution switchable normalization layer and the fourth convolution switchable normalization layer respectively. The output results of the second convolution switchable normalization layer and the third convolution switchable normalization layer are added, and then the results of the fourth convolution switchable normalization layer are spliced by channel to obtain a fifth channel feature map, thereby realizing multi-branch multi-semantic feature extraction and fusion; the fifth channel feature map will continue to be spliced with the third channel feature map by channel to obtain a sixth channel feature map, thereby further realizing cross-stage fusion; the sixth channel feature map passes through the SiLU activation function and the fifth convolution switchable normalization layer, and is finally added to the input feature map and then passes through the SiLU activation function to obtain the final feature map.
[0012] In the second aspect, the present application also provides a pavement crack detection device, which includes: an image acquisition module, used to acquire a pavement crack image to be detected; a detection module, used to input the pavement crack image into a preset pavement crack detection model, and output a crack detection result corresponding to the pavement crack image; wherein the pavement crack detection model is obtained by training an improved U-Net model using a deep supervision method; the improved U-Net model includes: an improved encoding layer connected with a pixel anti-recombination layer and a decoding layer connected with a pixel reconstruction layer as a sampling combination, and introduces a cross-scale joint attention interaction module and a joint attention expansion module, and the improved encoding layer includes: two three-branch convolutional layers, switchable normalization and SiLU activation function.
[0013] In a third aspect, the present application further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method described in the first aspect above.
[0014] In a fourth aspect, the present application further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method described in the first aspect above.
[0015] In the pavement crack detection method, device and electronic device provided by the present application, the pavement crack detection model is obtained by training the improved U-Net model in a deep supervision manner; the improved U-Net model includes: an improved encoding layer connected with a pixel anti-recombination layer and an improved decoding layer connected with a pixel recombination layer as a sampling combination, and introduces a cross-scale joint attention interaction module and a joint attention expansion module, and the improved encoding layer and the improved decoding layer both include: two three-branch convolutional layers, a switchable normalization layer and a SiLU activation function. First, the pavement crack image to be detected is obtained; then the pavement crack image is input into the above-mentioned pavement crack detection model, and the crack detection result corresponding to the pavement crack image is output; by performing pavement crack detection through the improved U-Net model, the features that are conducive to crack segmentation can be highlighted, and the detection accuracy of pavement cracks can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 A flow chart of a pavement crack detection method provided in an embodiment of the present application;
[0018] Figure 2 A schematic diagram of a network model provided for an embodiment of the present application;
[0019] Figure 3 A schematic diagram of a joint channel-space dual attention mechanism structure provided in an embodiment of the present application;
[0020] Figure 4 A schematic diagram of the structure of a cross-scale joint attention interaction module provided in an embodiment of the present application;
[0021] Figure 5 A schematic diagram of the structure of a joint attention expansion module provided in an embodiment of the present application;
[0022] Figure 6 A schematic diagram of an improved coding layer structure provided in an embodiment of the present application;
[0023] Figure 7 A flow chart of a model training process provided in an embodiment of the present application;
[0024] Figure 8 The crack segmentation results of various models of the CRKWH100 data set provided in an embodiment of the present application;
[0025] Fig. 9 The crack segmentation results of various models of the CrackLS315 dataset provided in the embodiment of the present application;
[0026] Fig.10 A crack segmentation result of various models of a Rain365 dataset provided in an embodiment of the present application;
[0027] Fig.11 A structural block diagram of a pavement crack detection device provided in an embodiment of the present application;
[0028] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The technical solution of the present application will be described clearly and completely below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0030] In view of various deficiencies of the model network used in the existing road crack detection, the embodiments of the present application provide a road crack detection method, device and electronic device. In this embodiment, the improved U-Net model includes: an improved encoding layer connected with a pixel anti-recombination layer and a decoding layer connected with a pixel recombination layer as a sampling combination, and introduces a cross-scale joint attention interaction module and a joint attention expansion module. The improved encoding layer includes: two three-branch convolutional layers, switchable normalization and SiLU activation function. By performing road crack detection through the improved U-Net model, features that are conducive to crack segmentation can be highlighted, and the detection accuracy of road cracks can be improved.
[0031] To facilitate understanding of this embodiment, a pavement crack detection method disclosed in an embodiment of the present application is first introduced in detail.
[0032] Figure 1 A flow chart of a pavement crack detection method provided in an embodiment of the present application, the method comprising the following steps:
[0033] Step S102, obtaining a road surface crack image to be detected;
[0034] Step S104, inputting the pavement crack image into a preset pavement crack detection model, and outputting the crack detection result corresponding to the pavement crack image; wherein the pavement crack detection model is obtained by training an improved U-Net model using a deep supervision method; the improved U-Net model includes: an improved encoding layer connected with a pixel anti-recombination layer and a decoding layer connected with a pixel recombination layer as a sampling combination, and introducing a cross-scale joint attention interaction module and a joint attention expansion module, and the improved encoding layer includes: two three-branch convolutional layers, switchable normalization and SiLU activation function.
[0035] In this embodiment, the pixel anti-recombination layer may be a PixelUnshuffle layer; and the pixel recombination layer may be a PixelShuffle layer.
[0036] In this embodiment, the cross-scale joint attention interaction module, combined with the joint channel-space dual attention mechanism, calibrates each other in a cross-scale manner, and then adaptively learns to generate a collective weight map through two depth-separable convolutions, ensuring that the module can re-optimize the input features in a more appropriate way. In this way, the fusion recalibration strategy is adopted to effectively utilize the feature information, and then the feature enhancement operation is performed on the low-contrast defect image to better highlight the crack defects.
[0037] The above-mentioned joint attention expansion module is used to capture contextual information in a larger scale range, and can focus on small defect areas through the joint channel-space dual attention mechanism.
[0038] The above-mentioned improved coding layer changes the two ordinary 3×3 convolutions in the traditional coding block into two three-branch convolutions, reducing the number of parameters without reducing the performance as much as possible, which is conducive to the deployment of actual models.
[0039] In addition, the normalization operation, activation function and sampling strategy in the traditional network model are improved. Switchable normalization is used instead of traditional batch normalization to solve the performance degradation problem of batch normalization under limited GPU memory conditions; SiLU activation function is used instead of traditional ReLU activation function to avoid the "dead" ReLU problem; pixel anti-reorganization layer and pixel reorganization layer are used instead of traditional sampling combination to avoid information loss.
[0040] The pavement crack detection provided by the embodiments of the present application can realize end-to-end pixel-level narrow crack detection, refine detail features across scales, generate accurate saliency maps, and achieve a good trade-off between performance and complexity.
[0041] The embodiment of the present application also provides another pavement crack detection method, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the model structure and training process, as well as the model working process.
[0042] First, the model structure in the embodiment of the present application is introduced. The overall network structure corresponding to the pavement crack detection model is: JAINet (Joint Attention-Guided interaction-aware network) is an improved model of the U-Net model. Figure 2 As shown in the figure, the encoder and decoder are built. Both the encoder and decoder have a 4-layer structure. Each layer is composed of improved codec blocks. The layers are connected together through pixel anti-reorganization layers or pixel reorganization layers. The first three layers of codec blocks are connected through a cross-scale joint attention interaction module, and the last layer is connected through a joint attention expansion module.
[0043] Specifically, the overall network structure corresponding to the above-mentioned pavement crack detection model includes: a first convolutional layer (CSS (512, 512, 32)), a first coding layer (C3block (512, 512, 32)), a first PixelUnshuffle layer (PixelUnshuffle (256, 256, 128)), a second coding layer (C3block (256, 256, 128)), a first channel separation layer (Channel Split2× (256, 256, 64)), a second PixelUnshuffle layer (PixelUnshuffle (128, 128, 256)), a third coding layer (C3block (128, 128, 256)), a second channel separation layer (Channel Split2× (256, 256, 64)), and a second PixelUnshuffle layer (PixelUnshuffle (128, 128, 256)). Split2×(128,128,128)), the third PixelUnshuffle layer (PixelUnshuffle(64,64,512)), the fourth encoding layer (C3block(64,64,512)), the second convolutional layer (1×1CSS(64,64,256)), the joint attention expansion module (JAD(64,64,256)), the first decoding layer (C3block(64,64,256)), the first Pixelshuffle layer (Pixelshuffle(128,128,64)), the third convolutional layer (1×1CSS(128,128,128)), the first cross-scale joint attention interaction module (CJAJ(128,128,256)), the second decoding layer (C3block(128,128,256)), the second Pi xelshuffle layer (Pixelshuffle(256,256,64)), the second cross-scale joint attention interaction module (CJAJ(256,256,128)), the third decoding layer (C3block(256,256,128)), the third Pixelshuffle layer (Pixelshuffle(512,512,32)), the third cross-scale joint attention interaction module (CJAJ(512,512,64)), the fourth decoding layer (C3block(512,512,64)), the fourth convolutional layer (CSS, 1×1Conv(512,512,1)); the first encoding layer is also connected to the third cross-scale joint attention interaction module; the first channel separation layer is also connected to the second cross-scale joint attention interaction module; the second channel separation layer is also connected to the first cross-scale joint attention interaction module.
[0044] The working process of the above model structure is as follows:
[0045] The road crack image to be detected or the road crack image in the training set is input into the network with a size of (3, 512, 512). After 1×1 convolution, a feature map with the same size as the input image and 32 channels is obtained. Then, the feature is extracted through the encoding layer to obtain a feature map of (32, 512, 512). This feature map is used as the input for feature extraction in the subsequent convolution layer and as the input for the cross-scale joint attention interaction module in the decoding stage. The specific method is to use the cross-scale joint attention interaction module to splice the feature maps of the corresponding encoder and decoder parts in the dimension direction. The usage of feature maps of subsequent sizes is similar. The sampling of the encoding part uses the pixel decomposition layer, which leads to inconsistent input and output channel numbers. Channel separation is used for the feature maps after the two encoding layers. One group is used for feature fusion in the decoding stage, and the other group is used for subsequent deeper feature extraction. This operation makes the number of input and output channels of the convolution consistent, thereby reducing the number of parameters, FLOPs and memory access costs of the model. After the second, third, and fourth encoding layers, feature maps of three sizes are obtained, respectively (128, 256, 256), (256, 128, 128), and (512, 64, 64). For the feature map of the last encoding layer, it is first converted into a feature map with 256 channels through a 1×1 convolution, and then the receptive field is enlarged through the joint attention expansion module, while focusing on the defect area. In the decoding part, due to the mechanism of changing the number of channels in the pixel reorganization layer and the additional features from the cross-scale joint attention interaction module, the decoding part can complete feature decoding without artificially changing the number of channels. The feature map output by the last decoding layer will be subjected to a 1×1 convolution to obtain a high-resolution prediction result.
[0046] Furthermore, the specific implementation process of the joint channel-space dual attention mechanism in the above cross-scale joint attention interaction module and the joint attention expansion module is as follows:
[0047] (1) After the target feature map (such as the feature map from the previous stage) is subjected to the first convolution processing, the global average pooling and global maximum pooling operations are used to compress the spatial information in the spatial dimension to obtain the first average pooling feature and the first maximum pooling feature; the first average pooling feature and the first maximum pooling feature are subjected to the second convolution processing respectively, and then the shared convolution processing is performed to capture the global dependency and generate two channel weights, the two channel weights are added, and the channel attention map is obtained through the sigmoid function; the target feature map includes:
[0048] Take the first high-level feature map of the self-decoding stage as an example, see Figure 3As shown in the figure, the first high-level feature map Fh passes through the channel attention branch and the spatial attention branch respectively to obtain the channel attention map Mc and the spatial attention map Ms, and then the two maps are fused into one map by feature map fusion. The channel attention branch aims to generate a one-dimensional channel attention map and dynamically select important features in the channel dimension. Specifically, by performing 1×1 convolution on the feature Fh, and then using global average pooling and global maximum pooling operations in the spatial dimension to compress the spatial information, the average pooling feature and the maximum pooling feature are obtained, which are denoted as F c avg and F c max . The pooled features are then fed into 1×1 convolutions, followed by shared 1×1 convolutions, to capture global dependencies and generate channel weights. Finally, the obtained channel weights are added together and the channel attention map Mc∈RC×1×1 is obtained through the sigmoid function, that is:
[0049]
[0050] Among them, σ represents the sigmoid function, F1 1×1 、F2 1×1 and F3 1×1 They represent three 1×1 convolutions respectively.
[0051] (2) After the target feature map is subjected to the third convolution, the channel information is compressed by using global average pooling and global maximum pooling operations in the channel dimension to obtain the second average pooling feature and the second maximum pooling feature; the second average pooling feature and the second maximum pooling feature are concatenated, and then a sub-network is used to generate a spatial weight with a larger receptive field, and finally a spatial attention map is obtained by a sigmoid function; wherein the sub-network includes two dilated convolutions with different dilation rates;
[0052] The first high-level feature map in the self-decoding stage is also used as an example for explanation, see Figure 3 As shown in the figure, the spatial attention branch aims to generate a two-dimensional spatial attention map that adaptively emphasizes important features in the spatial dimension. Similarly, it first performs a 1×1 convolution on the feature Fh, and then performs GAP and GMP operations on the channel dimension to compress the channel information, generating average pooling features and maximum pooling features, denoted as Fs avg and Fs max, respectively. The two pooling features are concatenated together, and then a sub-network is used to generate spatial weights with a larger receptive field. The sub-network consists of two 3×3 dilated convolutions with expansion rates of 2 and 4, respectively. Finally, the weights are obtained through the sigmoid function to generate a spatial attention map Ms∈R1×H×W. That is:
[0053]
[0054] Among them, F 3×3,2 and F 3×3,4 They represent two 3×3 dilated convolutions with rates of 2 and 4 respectively, and CAT represents the concatenation operation.
[0055] (3) The channel attention map and the spatial attention map are recombined and matrix multiplication is performed to obtain the reshaped feature map, which is input into the depth-wise separable dilated convolution to simulate the spatial dependency and generate the channel spatial feature map.
[0056] See also Figure 3 As shown in Figure 2, the feature map fusion method is to fuse the attention maps Mc and Ms of the two branches. Mc and Ms are recombined into R C×1 and R 1×N , respectively, where N = H × W, and then matrix multiplication is performed. The result is reshaped into R C×H×W , and input into a 3×3 dilated convolution with a depth-separable dilation rate = 2 to simulate spatial dependencies and generate the final channel space feature map M, i.e.
[0057]
[0058] Where D 3×3,2 represents a depthwise separable 3×3 expanded convolution with a dilation rate of 2, and represents a matrix multiplication.
[0059] Furthermore, the working process of the above-mentioned cross-scale joint attention interaction module is as follows: the first low-level feature map from the encoding stage and the first high-level feature map from the decoding stage are respectively processed by the channel-spatial attention mechanism to obtain a first channel spatial feature map and a second channel spatial feature map; the first high-level feature map is calibrated using the first channel spatial feature map, and the first high-level feature map is added to obtain the second high-level feature map; the first low-level feature map is calibrated using the second channel spatial feature map, and the first low-level feature map is added to obtain the second low-level feature map; the second low-level feature map and the second high-level feature map are connected, and two depth-separable convolutional layers are used to fuse them to generate an integrated weight map; the integrated weight map is used to recalibrate the first low-level feature map and the first high-level feature map, and they are fused through a depth-separable convolutional layer to obtain a fused feature map; the fused feature map is used as the output feature map, or the fused feature map is subtracted from the feature map after average pooling itself to generate a new weight map as the output feature map.
[0060] See also Figure 4 The input of the cross-scale joint attention interaction module comes from the corresponding low-level features fl in the encoding stage and the high-level features fh in the decoding stage. First, the channel-space attention mechanism is performed on the two inputs respectively to obtain two channel-space attention maps use calibrate fl and then add fl. Calibrate fh and then add fh. This gives fl+ and fh+. To further enhance the interaction between low-level and high-level features, we and Connect them and fuse them using two depth-wise separable convolutional layers to generate an integrated weight map W i , and finally adopt W i Recalibrate fl and fh and fuse them through a depth-wise separable convolutional layer to generate output features In order to prevent the information of significant defects from being submerged, the fused feature map is enhanced. After subtracting the average pooling Generate a new weight map to effectively purify the boundary part of the feature map.
[0061] Furthermore, the above-mentioned joint attention expansion module includes a channel-spatial attention mechanism branch and a main branch composed of three convolutional layers with different expansion rates; the working process of the joint attention expansion module is as follows: the input feature map is processed by the channel-spatial attention mechanism to obtain a third channel spatial attention map; the input feature map is processed by three convolutional layers to obtain an expanded convolution feature map; the third channel spatial attention map is element-wise multiplied with the expanded convolution feature map, the multiplication result is multiplied with the scale parameter, and the expanded convolution feature map is element-wise added to obtain the final output feature map.
[0062] See also Figure 5 The main branch of the joint attention expansion module consists of three 256-channel 3×3 convolutional layers, where the expansion [r=2^m,m=0,1,2], r is the expansion rate, and the output of this branch is Yc, which can increase the receptive field and capture a larger range of information. And a branch of the joint channel-space dual attention mechanism to generate the channel space attention map Yd, which corrects Yc and can guide Yc to focus on small defect areas. The joint channel attention map Yd is element-wise multiplied with the output Yc of the dilated convolution, and then the result is multiplied by the scale parameter α, and then added to Yc element-wise.
[0063] Furthermore, the encoding layer divides the input feature map into three parts according to a preset channel ratio to obtain a first channel feature map, a second channel feature map and a third channel feature map; wherein, after the first channel feature map passes through the first convolution switchable normalization layer, it is added to the second channel feature map to obtain a fourth channel feature map, and the fourth channel feature map passes through the second convolution switchable normalization layer, the third convolution switchable normalization layer and the fourth convolution switchable normalization layer respectively. The output results of the second convolution switchable normalization layer and the third convolution switchable normalization layer are added, and then the results of the fourth convolution switchable normalization layer are spliced by channel to obtain a fifth channel feature map, thereby realizing multi-branch multi-semantic feature extraction and fusion; the fifth channel feature map will continue to be spliced with the third channel feature map by channel to obtain a sixth channel feature map, thereby further realizing cross-stage fusion; the sixth channel feature map passes through the SiLU activation function and the fifth convolution switchable normalization layer, and is finally added to the input feature map and then passes through the SiLU activation function to obtain the final feature map; the above-mentioned entire structure forms a residual structure.
[0064] The above-mentioned convolutional switchable normalization layer refers to a convolutional layer and a switchable normalization layer connected.
[0065] See also Figure 6 , the improved encoder module changes two ordinary 3×3 convolutions into two three-branch convolutions. Taking the input with the number of channels C as an example, the module first divides the input into three channels in the ratio of 1:1:2, recorded as M, Q, and P. Among them, M is added to Q after 1×1 convolution and switchable normalization, and then passes through three branches of 1×3 convolution, 3×1 convolution and 3×3 deep convolution respectively. The outputs of 1×3 convolution and 3×1 convolution will be added, and then spliced with the 3×3 deep convolution branch by channel to obtain a feature map with the number of channels 1 / 2C, realizing multi-branch multi-semantic feature extraction and fusion. This feature map will continue to be spliced with P by channel to obtain a feature map with the number of channels C, further realizing cross-stage fusion. This feature map is then subjected to SiLU activation function, 1×1 convolution and switchable normalization, and finally added to the original input and then subjected to SiLU activation function to obtain the final feature map.
[0066] The above switchable normalization solves the performance degradation problem of batch normalization under the condition of limited GPU memory. The SiLU activation function enhances the nonlinear expression ability of the model and avoids the "dead" ReLU problem.
[0067] Based on the above feature extraction principle, the training process of the entire model is described below. Figure 7 As shown in Figure 2, the training process of the above pavement crack detection model is as follows:
[0068] (1) Obtain a pavement crack dataset; for example, CrackTree260, CRKWH100, CrackLS315, and Rain365 datasets, including the original images of crack data and manually annotated labels, where CrackTree260 is used for training, and CRKWH100, CrackLS315, and CrackLS315 datasets are used for testing.
[0069] (2) Preprocessing operations are performed on the pavement crack dataset to obtain a training set; the preprocessing operations include image enhancement operations; the image enhancement operations include flip transformation, rotation change, brightness contrast change, etc. The purpose is to simulate different shooting angles and increase the sample size.
[0070] After preprocessing, 260 valid data sets were obtained, which were divided into training sets and test sets in a ratio of 9:1.
[0071] (3) Based on the deep supervision algorithm, the overall network structure is trained through the training set, and the weight parameters with the best evaluation index are saved as pre-training weights to obtain the pavement crack detection model.
[0072] The training process actually utilizes the feature extraction principle described above. The above-mentioned deep supervision adds supervision signals to the middle layer of the network, strengthens the feature learning process, and minimizes segmentation errors.
[0073] The above evaluation indicators include recall (R), precision (P), F1 score (F1), average precision (AP), number of parameters (N Param ), floating point operations (FLOPs) and frames per second (FPS). The evaluation index formulas are as follows:
[0074]
[0075] The recall rate measures how many actual positive pixels are successfully predicted as positive pixels, where TP refers to the number of samples predicted as positive and actually positive, and FN refers to the number of samples predicted as negative but actually positive.
[0076]
[0077] The accuracy measures how many of the predicted positive pixels are successfully predicted as positive pixels, where FP refers to the number of samples predicted as positive but actually negative.
[0078]
[0079] The F1 score is the harmonic mean of recall and precision, and is used to comprehensively evaluate the performance of the model.
[0080] Nparam =C in ×K h ×K w ×C out ;
[0081] The number of parameters is an indicator of the spatial complexity of the model. Take the convolution without bias as an example, where C in and C out Respectively represent the number of input channels and output channels of convolution, K h and K w Represent the height and width of the convolution kernel respectively.
[0082] FLOPs = C in ×K h ×K w ×C out ×H×W;
[0083] Floating point operations FLOPs is an important indicator to measure the time complexity of the model. Take the convolution without bias as an example, where C in and C out Respectively represent the number of input channels and output channels of convolution, K h and K w Represent the height and width of the convolution kernel, H and W represent the height and width of the output feature map, respectively. The calculation standard of FLOPs is one multiplication and addition operation.
[0084] The number of frames per second refers to the number of image frames that the model can process during inference. The mixed loss is also used to calculate the loss value during the training process. In order to effectively describe the structural information of the defect area, the mixed loss L is introduced into the network, and the expression is:
[0085]
[0086] In the above formula, and They represent binary cross entropy (BCE) loss, intersection over union (IoU) loss, and structural similarity (SSIM) loss, respectively.
[0087] The training set is input into the model for training, and the weight parameters with the best evaluation index are selected as pre-training weights. The pre-training weights are saved, and the CRKWH100, CrackLS315 and Rain365 test pavement crack images are input into the pre-trained model to detect pavement cracks and display the results, which are compared with existing methods.
[0088] like Figure 8 , Fig. 9 , Fig.10As shown, after training 300 rounds of pavement crack images using the model detection method provided in the embodiment of the present application and other existing methods (such as UNet, SegNet, DeepCrack, EDRNet and DACNet), the prediction effect comparison chart is obtained by inputting the test images of the three test sets. It can be seen from the figure that the present invention has a better processing of the detailed analysis of pavement cracks and can achieve excellent performance even in shadows, darkness or humid environments.
[0089] As shown in Tables 1, 2, and 3, the comparison results of the model detection method provided by the embodiment of the present application and the existing method after training the pavement crack image show that compared with other existing methods, the embodiment of the present application has higher accuracy, smaller complexity and parameters, and can be trained on machines with limited resources and environment. The F1-score indicators on the three public crack data sets CRKWH100, CrackLS315, and Rain365 are 78.21%, 42.18%, and 26.54%, all of which achieve the highest scores, and Params is only 3.06M, which is much smaller than other models.
[0090] Table 1
[0091]
[0092]
[0093] Table 2
[0094]
[0095] Table 3
[0096]
[0097] In this embodiment, based on the U-Net framework, the following four points are modified: 1) Up and down sampling is not the traditional maxpooling and interpolation, but PixelUnshuffle layer 0 and PixelShuffle layer: it is very good for narrow crack recognition and will not lose information; 2) a cross-scale joint attention interaction module is proposed: it can adaptively suppress background noise in the channel and spatial dimensions, calibrate high-level features and low-level features in a cross-scale manner, and perform feature enhancement operations on low-contrast defect images; 3) a joint attention expansion module is proposed: it can cover a wider range of receptive fields, reduce the influence of interference factors, and at the same time, the dual attention mechanism of the joint channel-space can pay attention to small defect areas as much as possible. 4) Loss function: a mixture of binary cross entropy (BCE) loss, intersection over union (IoU) loss and structural similarity (SSIM) loss.
[0098] The pavement crack detection method provided in the embodiment of the present application is actually a pavement crack detection method based on joint attention mechanism and cross-scale interaction, which specifically includes the following steps: 1) obtaining crack images and performing data preprocessing to obtain a training data set; 2) based on the U-Net network framework, using switchable normalization, SiLU activation function, and replacing the traditional sampling combination with the PixelUnshuffle layer and the PixelShuffle layer, introducing a cross-scale joint attention interaction module and a joint attention expansion module, modifying the encoder module, and constructing an improved U-Net model; 3) setting evaluation indicators; 4) training the improved model with the training data set, saving the weight parameter with the best evaluation indicator as the pre-training weight, and obtaining a pavement crack detection model; 5) inputting the crack image to be detected into the pavement crack detection model, and outputting the crack detection result. In the method provided in the embodiment of the present application, the model parameters are small, which is conducive to the actual model deployment, and the accuracy rate is higher in the crack detection task.
[0099] More specific advantages of this embodiment are as follows:
[0100] 1. The cross-scale joint attention interaction module adopted in this embodiment adaptively suppresses background noise in the channel and spatial dimensions, calibrates high-level features and low-level features in a cross-scale manner, performs feature enhancement operations on low-contrast defect images, better highlights crack defects, improves the problems of incomplete road crack recognition and loss of image detail information in existing methods, and improves the accuracy of road crack segmentation.
[0101] 2. The joint attention expansion module used in this embodiment can cover a wider range of receptive fields, reduce the impact of interference factors, and at the same time, the joint channel-space dual attention mechanism pays attention to small defect areas as much as possible, focusing on detail information and more accurately identifying road cracks.
[0102] 3. The improved coding layer of this embodiment changes the two ordinary 3×3 convolutions in the traditional coding block into two three-branch convolutions, reducing the number of parameters without reducing the performance as much as possible. It can be trained on devices with limited resources, which is conducive to the deployment of actual models.
[0103] 4. The switchable normalization, SiLU activation function and new sampling strategy used in this embodiment can improve the performance of the model under limited resources, prevent the missed detection of fine cracks, and reduce the loss of crack image information.
[0104] 5. The pavement crack detection method based on joint attention mechanism and cross-scale interaction in this embodiment is trained on the CrackTree260 crack dataset and tested on the CRKWH100, CrackLS315 and Rain365 crack datasets. The F1-score values reach 80.20%, 44.44% and 27.21% respectively, which is significantly better than most existing methods and has higher segmentation accuracy.
[0105] Based on the above method embodiment, the present application embodiment also provides a road crack detection device, see Fig.11 As shown, the device includes: an image acquisition module 112, used to acquire a road crack image to be detected; a detection module 114, used to input the road crack image into a preset road crack detection model, and output a crack detection result corresponding to the road crack image; wherein the road crack detection model is obtained by training an improved U-Net model using a deep supervision method; the improved U-Net model includes: an improved encoding layer connected with a pixel anti-recombination layer and an improved decoding layer connected with a pixel recombination layer as a sampling combination, and introduces a cross-scale joint attention interaction module and a joint attention expansion module, and the improved encoding layer and the improved decoding layer both include: two three-branch convolutional layers, a switchable normalization layer and a SiLU activation function.
[0106] Furthermore, the overall network structure corresponding to the above-mentioned pavement crack detection model includes: a first convolutional layer, a first encoding layer, a first pixel anti-reorganization layer, a second encoding layer, a first channel separation layer, a second pixel anti-reorganization layer, a third encoding layer, a second channel separation layer, a third pixel anti-reorganization layer, a fourth encoding layer, a second convolutional layer, a joint attention expansion module, a first decoding layer, a first pixel reorganization layer, a third convolutional layer, a first cross-scale joint attention interaction module, a second decoding layer, a second pixel reorganization layer, a second cross-scale joint attention interaction module, a third decoding layer, a third pixel reorganization layer, a third cross-scale joint attention interaction module, a fourth decoding layer, and a fourth convolutional layer, which are connected in sequence; the first encoding layer is also connected to the third cross-scale joint attention interaction module; the first channel separation layer is also connected to the second cross-scale joint attention interaction module; the second channel separation layer is also connected to the first cross-scale joint attention interaction module.
[0107] Furthermore, the above-mentioned device also includes a model training module, which is used to execute the following training process of the pavement crack detection model: obtaining a pavement crack data set; performing a preprocessing operation on the pavement crack data set to obtain a training set; the preprocessing operation includes an image enhancement operation; based on a deep supervision algorithm, the overall network structure is trained through the training set, and the weight parameters with the best evaluation indicators are saved as pre-training weights to obtain a pavement crack detection model; wherein the evaluation indicators include recall rate, accuracy, F1 score, average precision, parameter quantity, floating-point operations and frames per second; and a mixed loss is used to calculate the loss value during the training process.
[0108] Furthermore, the above-mentioned model training module is used to execute the specific process of the joint channel-space dual attention mechanism in the cross-scale joint attention interaction module and the joint attention expansion module: after the target feature map is subjected to the first convolution processing, the spatial information is compressed by using the global average pooling and the global maximum pooling operations in the spatial dimension to obtain the first average pooling feature and the first maximum pooling feature; the first average pooling feature and the first maximum pooling feature are subjected to the second convolution processing respectively, and then the shared convolution processing is performed to capture the global dependency and generate two channel weights, the two channel weights are added, and the channel attention map is obtained by the sigmoid function; the target feature map includes: the first low-level feature map from the encoding stage or the first low-level feature map from the decoding stage The first high-level feature map of the stage; after the third convolution processing of the target feature map, the global average pooling and global maximum pooling operations are used to compress the channel information in the channel dimension to obtain the second average pooling feature and the second maximum pooling feature; the second average pooling feature and the second maximum pooling feature are spliced, and then the spatial weights with a larger receptive field are generated through the sub-network, and finally the spatial attention map is obtained through the sigmoid function; wherein the sub-network includes two extended convolutions with different expansion rates; the channel attention map and the spatial attention map are recombined and matrix multiplication operations are performed respectively to obtain the reshaped feature map, and the reshaped feature map is input into the depth-separable extended convolution to simulate the spatial dependency and generate the channel spatial feature map.
[0109] Furthermore, the above-mentioned model training module is used to execute the working process of the cross-scale joint attention interaction module: the first low-level feature map from the encoding stage and the first high-level feature map from the decoding stage are respectively processed by the channel-space attention mechanism to obtain a first channel space feature map and a second channel space feature map; the first high-level feature map is calibrated using the first channel space feature map, and the first high-level feature map is added to obtain the second high-level feature map; the first low-level feature map is calibrated using the second channel space feature map, and the first low-level feature map is added to obtain the second low-level feature map; the second low-level feature map and the second high-level feature map are connected, and two depth-separable convolutional layers are used to fuse them to generate an integrated weight map; the integrated weight map is used to recalibrate the first low-level feature map and the first high-level feature map, and they are fused through a depth-separable convolutional layer to obtain a fused feature map; the fused feature map is used as the output feature map, or the fused feature map is subtracted from the feature map after average pooling to generate a new weight map as the output feature map.
[0110] Furthermore, the above-mentioned joint attention expansion module includes a channel-spatial attention mechanism branch and a main branch composed of three convolutional layers with different expansion rates; a model training module is used to execute the working process of the joint attention expansion module: the input feature map is processed by the channel-spatial attention mechanism to obtain a third channel spatial attention map; the input feature map is processed by three convolutional layers to obtain an expanded convolution feature map; the third channel spatial attention map is element-wise multiplied with the expanded convolution feature map, the multiplication result is multiplied with the scale parameter, and the expanded convolution feature map is element-wise added to obtain the final output feature map.
[0111] Furthermore, the encoding layer divides the input feature map into three parts according to a preset channel ratio to obtain a first channel feature map, a second channel feature map and a third channel feature map; wherein, after the first channel feature map passes through the first convolution switchable normalization layer, it is added to the second channel feature map to obtain a fourth channel feature map, and the fourth channel feature map passes through the second convolution switchable normalization layer, the third convolution switchable normalization layer and the fourth convolution switchable normalization layer respectively. The output results of the second convolution switchable normalization layer and the third convolution switchable normalization layer are added, and then the results of the fourth convolution switchable normalization layer are spliced by channel to obtain a fifth channel feature map, thereby realizing multi-branch multi-semantic feature extraction and fusion; the fifth channel feature map will continue to be spliced with the third channel feature map by channel to obtain a sixth channel feature map, thereby further realizing cross-stage fusion; the sixth channel feature map passes through the SiLU activation function and the fifth convolution switchable normalization layer, and is finally added to the input feature map and then passes through the SiLU activation function to obtain the final feature map.
[0112] The device provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the embodiment of the device, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0113] The present application also provides an electronic device, such as Fig.12 As shown, it is a schematic diagram of the structure of the electronic device, wherein the electronic device includes a processor 121 and a memory 120, the memory 120 stores computer executable instructions that can be executed by the processor 121, and the processor 121 executes the computer executable instructions to implement the above method.
[0114] exist Fig.12 In the illustrated embodiment, the electronic device further includes a bus 122 and a communication interface 123 , wherein the processor 121 , the communication interface 123 and the memory 120 are connected via the bus 122 .
[0115] Among them, the memory 120 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 123 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 122 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 122 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0116] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above method. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.
[0117] The computer program products of the methods, devices, and electronic devices provided in the embodiments of the present application include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0118] Unless otherwise specifically stated, the relative steps, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0119] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0120] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0121] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A road crack detection method, characterized in that: The method comprises: Acquire a road surface crack image to be detected; Inputting the pavement crack image into a preset pavement crack detection model, and outputting a crack detection result corresponding to the pavement crack image; Among them, the pavement crack detection model is obtained by training an improved U-Net model using a deep supervision method; the improved U-Net model includes: an improved encoding layer connected with a pixel anti-recombination layer and an improved decoding layer connected with a pixel reconstruction layer as a sampling combination, and introduces a cross-scale joint attention interaction module and a joint attention expansion module, and the improved encoding layer and the improved decoding layer both include: two three-branch convolutional layers, a switchable normalization layer and a SiLU activation function.
2. The method according to claim 1, characterized in that The overall network structure corresponding to the pavement crack detection model includes: a first convolutional layer, a first encoding layer, a first pixel anti-reorganization layer, a second encoding layer, a first channel separation layer, a second pixel anti-reorganization layer, a third encoding layer, a second channel separation layer, a third pixel anti-reorganization layer, a fourth encoding layer, a second convolutional layer, a joint attention expansion module, a first decoding layer, a first pixel reorganization layer, a third convolutional layer, a first cross-scale joint attention interaction module, a second decoding layer, a second pixel reorganization layer, a second cross-scale joint attention interaction module, a third decoding layer, a third pixel reorganization layer, a third cross-scale joint attention interaction module, a fourth decoding layer, and a fourth convolutional layer, which are connected in sequence; the first encoding layer is also connected to the third cross-scale joint attention interaction module; the first channel separation layer is also connected to the second cross-scale joint attention interaction module; the second channel separation layer is also connected to the first cross-scale joint attention interaction module.
3. The method according to claim 2, characterized in that The training process of the pavement crack detection model is as follows: Obtain pavement crack dataset; Performing a preprocessing operation on the pavement crack data set to obtain a training set; the preprocessing operation includes an image enhancement operation; Based on the deep supervision algorithm, the overall network structure is trained through the training set, and the weight parameters with the best evaluation index are saved as pre-training weights to obtain a pavement crack detection model; Among them, the evaluation indicators include recall rate, accuracy, F1 score, average precision, number of parameters, number of floating-point operations and frames per second; the mixed loss is used to calculate the loss value during training.
4. The method according to claim 2, characterized in that: The specific implementation process of the joint channel-space dual attention mechanism in the cross-scale joint attention interaction module and the joint attention expansion module is as follows: After the target feature map is subjected to the first convolution processing, the spatial information is compressed by using the global average pooling and the global maximum pooling operations in the spatial dimension to obtain the first average pooling feature and the first maximum pooling feature; the first average pooling feature and the first maximum pooling feature are subjected to the second convolution processing respectively, and then the shared convolution processing is performed to capture the global dependency and generate two channel weights, the two channel weights are added, and the channel attention map is obtained by the sigmoid function; the target feature map includes: the feature map from the previous stage; After the target feature map is subjected to the third convolution processing, the channel information is compressed by using global average pooling and global maximum pooling operations in the channel dimension to obtain the second average pooling feature and the second maximum pooling feature; the second average pooling feature and the second maximum pooling feature are concatenated, and then a spatial weight with a larger receptive field is generated through a sub-network, and finally a spatial attention map is obtained through a sigmoid function; wherein the sub-network includes two extended convolutions with different expansion rates; The channel attention map and the spatial attention map are recombined and matrix multiplication is performed to obtain a reshaped feature map, and the reshaped feature map is input into a depth-separable dilated convolution to simulate spatial dependencies and generate a channel spatial feature map.
5. The method according to claim 4, characterized in that The working process of the cross-scale joint attention interaction module is as follows: The first low-level feature map from the encoding stage and the first high-level feature map from the decoding stage are processed by the channel-space attention mechanism to obtain the first channel space feature map and the second channel space feature map; Calibrate the first high-level feature map using the first channel spatial feature map, and add the first high-level feature map to obtain a second high-level feature map; calibrate the first low-level feature map using the second channel spatial feature map, and add the first low-level feature map to obtain a second low-level feature map; The second high-level feature map and the second low-level feature map are connected, and two depth-separable convolutional layers are used to fuse them to generate an integrated weight map; the first low-level feature map and the first high-level feature map are recalibrated using the integrated weight map, and they are fused through a depth-separable convolutional layer to obtain a fused feature map; The fused feature map is used as the output feature map, or the fused feature map is subtracted from the feature map after average pooling to generate a new weight map as the output feature map.
6. The method according to claim 4, characterized in that The joint attention expansion module includes a channel-spatial attention mechanism branch and a main branch consisting of three convolutional layers with different expansion rates; the working process of the joint attention expansion module is as follows: The input feature map is processed by the channel-spatial attention mechanism to obtain the third channel spatial attention map; The input feature map is processed through three convolutional layers to obtain a dilated convolutional feature map; The third channel spatial attention map is element-wise multiplied by the dilated convolution feature map, the multiplication result is multiplied by the scale parameter, and then the dilated convolution feature map is element-wise added to obtain a final output feature map.
7. The method according to claim 3, characterized in that The encoding layer divides the input feature map into three parts according to the preset channel number ratio to obtain a first channel feature map, a second channel feature map and a third channel feature map; wherein, after the first channel feature map passes through the first convolution switchable normalization layer, it is added to the second channel feature map to obtain a fourth channel feature map, and the fourth channel feature map passes through the second convolution switchable normalization layer, the third convolution switchable normalization layer and the fourth convolution switchable normalization layer respectively. The output results of the second convolution switchable normalization layer and the third convolution switchable normalization layer are added, and then the results of the fourth convolution switchable normalization layer are spliced by channel to obtain the fifth channel feature map, so as to realize multi-branch multi-semantic feature extraction and fusion; the fifth channel feature map will continue to be spliced with the third channel feature map by channel to obtain the sixth channel feature map, so as to further realize cross-stage fusion; the sixth channel feature map passes through the SiLU activation function and the fifth convolution switchable normalization layer, and finally is added to the input feature map and then passes through the SiLU activation function to output the final feature map.
8. A road crack detection device, characterized in that: The device comprises: An image acquisition module, used to acquire an image of a road crack to be detected; A detection module is used to input the pavement crack image into a preset pavement crack detection model, and output a crack detection result corresponding to the pavement crack image; wherein the pavement crack detection model is obtained by training an improved U-Net model using a deep supervision method; the improved U-Net model includes: an improved encoding layer connected with a pixel anti-recombination layer and a decoding layer connected with a pixel recombination layer as a sampling combination, and introduces a cross-scale joint attention interaction module and a joint attention expansion module, and the improved encoding layer includes: two three-branch convolutional layers, switchable normalization and SiLU activation function.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 7.
Citation Information
Cited By
Pavement crack segmentation and quantification method based on pyramid region attention
CN119559127A
Hydraulic structure crack detection method and device, electronic equipment and storage medium
CN119722677A
Hydraulic structure crack detection method, device, electronic equipment and storage medium
CN119722677B
