Hydraulic construction crack identification method, device, equipment and medium

By introducing the ECA attention mechanism in the Swin-Unet model and replacing the Swin-Transformer-Block module, the accuracy and efficiency problems of the model when dealing with small cracks or complex backgrounds are solved, achieving more efficient and accurate crack identification.

CN119963825AActive Publication Date: 2025-05-09CHINA POWER CONSTR (GUANGDONG) ENG MONITORING & TESTING TECH CO LTD +4
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510451368.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-05-09
Estimated Expiration
2045-04-11

AI Technical Summary

Technical Problem

When processing large amounts of images, existing Swin-Unet models are difficult to accurately capture and restore crack details in small cracks or complex backgrounds, and the calculation is large, resulting in slow inference speed and reduced detection accuracy and efficiency.

Method used

The ECA attention mechanism was introduced and the Swin-Transformer-Block module was replaced with the target convolution module to obtain the improved intermediate model, and the target crack recognition model was obtained through iterative training and verification.

Benefits of technology

The recognition accuracy and efficiency of the target crack recognition model are improved, local features in the crack image can be restored more effectively, and computational complexity is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963825A_ABST
    Figure CN119963825A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a hydraulic building crack recognition method, device, equipment and medium, the method comprises the steps that a to-be-detected crack image is input into a target crack recognition model to obtain a recognition result, and the target crack recognition model is determined through the following steps that based on an initial Swinin-Unet model, an ECA attention mechanism is introduced, and the recognition result is obtained; and replacing the Swindow-Transform-Block module with a target convolution module to obtain an improved intermediate model, and performing iterative training and verification on the intermediate model by using the training set and the verification set to obtain a target crack recognition model. Compared with an initial model, an ECA attention mechanism is introduced into the target crack recognition model, a Swinin-Transform-Block module is replaced with a target convolution module, and the advantages of the ECA attention mechanism and the target convolution module are combined, so that the recognition efficiency and the recognition accuracy can be improved by using the target crack model to perform crack recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image segmentation, and in particular to a method, device, equipment and medium for identifying cracks in hydraulic structures. Background Art

[0002] As the age of hydraulic structures increases, cracks become a common manifestation of aging and damage of hydraulic structures. The expansion of cracks may lead to serious structural failures and safety hazards. Therefore, the detection and repair of cracks in hydraulic structures is a key step in the safety management of hydraulic structures. The existing Swin-Unet model based on convolutional neural networks and intelligent recognition networks is applied to detect cracks in large-scale image data, in which the decoder part of the Swin-Unet model adopts Swin-Transformer-Block. However, in the actual application of the Swin-Unet model to process a large number of images, Swin-Transformer-Block is difficult to accurately capture and restore detailed features for small cracks or cracks in complex backgrounds, and Swin-Transformer-Block has a large amount of calculation, which makes the inference speed of the Swin-Unet model slow, reducing the detection accuracy and efficiency of the Swin-Unet model. Therefore, when the Swin-Unet model processes a large number of images, the existing Swin-Unet model cannot meet the requirements of efficiency and accuracy of crack detection. Summary of the invention

[0003] In order to solve the above-mentioned problems, the present application proposes a method, device, equipment and medium for identifying cracks in hydraulic structures, which can improve the accuracy and efficiency of the recognition results of crack images to be detected.

[0004] To achieve the above objectives, in a first aspect, an embodiment of the present application provides a method for identifying cracks in a hydraulic structure, the method comprising: Inputting the crack image to be detected into the target crack recognition model to obtain the recognition result of the crack image to be detected; The target crack identification model is determined by the following steps: Acquire a crack image dataset of a hydraulic structure, preprocess the crack image dataset, and divide the preprocessed crack image dataset into a training set and a validation set; Obtaining an initial Swin-Unet model, wherein the decoder of the initial Swin-Unet model includes a Swin-Transformer-Block module; Based on the initial Swin-Unet model, the ECA attention mechanism is introduced, and the Swin-Transformer-Block module is replaced with a target convolution module to obtain an improved intermediate model; The intermediate model is iteratively trained and verified using the training set and the verification set to obtain the target crack recognition model.

[0005] In a second aspect, a hydraulic structure crack identification device provided according to an embodiment of the present application includes: A first data acquisition module is used to acquire a crack image dataset of a hydraulic structure, preprocess the crack image dataset, and divide the preprocessed crack image dataset into a training set and a validation set; A second data acquisition module is used to acquire an initial Swin-Unet model, wherein the decoder of the initial Swin-Unet model includes a Swin-Transformer-Block module; A first data processing module is used to introduce an ECA attention mechanism based on the initial Swin-Unet model, and replace the Swin-Transformer-Block module with a target convolution module to obtain an improved intermediate model; A second data processing module, using the training set and the verification set to iteratively train and verify the intermediate model to obtain a target crack recognition model; The crack image to be detected is input into the target crack recognition model to obtain the recognition result of the crack image to be detected.

[0006] In a third aspect, an electronic device provided according to an embodiment of the present application includes: at least one processor; at least one memory for storing at least one program; When at least one of the programs is executed by at least one of the processors, the hydraulic structure crack identification method described in any one of the first aspects is implemented.

[0007] In a fourth aspect, a computer-readable storage medium is provided according to an embodiment of the application, storing computer-executable instructions, wherein the computer-executable instructions are used to execute the hydraulic structure crack identification method described in any one of the first aspects.

[0008] In summary, the above-mentioned embodiment of the present application inputs the crack image to be detected into the target crack recognition model to obtain the recognition result of the crack image to be detected, and the target crack recognition model is determined by the following steps: first, based on the initial Swin-Unet model, the ECA attention mechanism is introduced, and the Swin-Transformer-Block module is replaced with the target convolution module to obtain an improved intermediate model, and then the intermediate model is iteratively trained and verified using the training set and the verification set to obtain the target crack recognition model. Since the target crack recognition model introduces the ECA attention mechanism compared to the initial Swin-Unet model, it combines the advantages of the adaptive cross-channel interaction and enhanced feature representation capabilities of the ECA attention mechanism, so that the local features in the crack image can be effectively restored to improve the recognition accuracy of the target crack recognition model, and replaces the Swin-Transformer-Block module with the target convolution module, combining the advantages of the lightweight design of the target convolution module itself, so that the present application recognizes the crack image to be detected based on the target crack model, which can improve the efficiency and accuracy of the recognition result. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 A flow chart of a method for identifying cracks in hydraulic structures according to an embodiment of the present application; Figure 2 A schematic diagram of cracks in a hydraulic structure provided by an embodiment of the present application; Figure 3 A schematic diagram of an intermediate model structure of an embodiment provided in the present application; Figure 4 A flowchart of iterative training and verification of an intermediate model using a training set and a verification set according to an embodiment of the present application; Figure 5 The Head network identification result of an embodiment provided for this application belongs to the crack schematic diagram; Figure 6 A flow chart of extracting features from each crack image in a training set using a feature extraction network according to an embodiment of the present application; Figure 7 A schematic diagram of the Neck network structure of an embodiment provided in this application; Figure 8 A flowchart of an embodiment provided in the present application of using a Neck network to process each crack feature map of a crack image using an ECA attention mechanism and then inputting the result into a target convolution module for processing; Fig. 9 A schematic diagram of a feature extraction network structure of an embodiment provided in this application; Fig.10A schematic diagram of the first Swin-Transformer-Block module structure of an embodiment provided in the present application; Fig.11 A schematic diagram of the structure of a first ECA attention module according to an embodiment of the present application; Fig.12 A flow chart of performing channel weighting on a first convolutional feature map using a first ECA attention module according to an embodiment of the present application; Fig.13 A schematic diagram of the structure of a first ConvBlock module of an embodiment provided in the present application; Fig.14 A flow chart of extracting features from a fourth intermediate feature using a first ConvBlock module according to an embodiment of the present application; Fig.15 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0010] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0011] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0012] As hydraulic structures age, cracks become a common manifestation of aging and damage in hydraulic structures. The expansion of cracks may lead to serious structural failures and safety hazards. Therefore, the detection and repair of cracks in hydraulic structures is a key step in the safety management of hydraulic structures. Traditional crack detection methods rely on manual inspections and visual observations, which are inefficient, prone to missed detections, and have subjective judgment biases. Especially in complex environments, it is difficult to meet the needs of efficient and accurate detection. The existing Swin-Unet model based on convolutional neural networks and intelligent recognition networks is applied to detect cracks in large-scale image data, in which the decoder part of the Swin-Unet model adopts Swin-Transformer-Block. However, in the actual application of the Swin-Unet model to process a large number of images, Swin-Transformer-Block is difficult to accurately capture and restore detailed features for small cracks or cracks in complex backgrounds, which affects the detection accuracy of the Swin-Unet model; due to the large amount of calculation of Swin-Transformer-Block, the reasoning speed of the Swin-Unet model is slow, which reduces the detection efficiency. Therefore, when the Swin-Unet model processes a large number of images, the existing Swin-Unet model cannot meet the requirements of efficiency and accuracy of crack detection.

[0013] Based on this, an embodiment of the present application provides a method for identifying cracks in hydraulic structures, which can introduce an ECA attention mechanism and replace the Swin-Transformer-Block module with a target convolution module to obtain a target crack recognition model to improve the efficiency and accuracy of the target crack recognition model.

[0014] Figure 1 This is a flowchart of the hydraulic structure crack identification method of the present application embodiment, referring to Figure 1 As shown, the hydraulic structure crack identification method includes steps S10 to S14, which are specifically as follows: Step S10, inputting the crack image to be detected into the target crack recognition model to obtain the recognition result of the crack image to be detected; Among them, the target crack identification model is determined by the following steps: Step S11, obtaining a crack image dataset of a hydraulic structure, preprocessing the crack image dataset, and dividing the preprocessed crack image dataset into a training set and a verification set; Step S12, obtaining an initial Swin-Unet model, wherein the decoder of the initial Swin-Unet model includes a Swin-Transformer-Block module; Step S13, based on the initial Swin-Unet model, the ECA attention mechanism is introduced, and the Swin-Transformer-Block module is replaced with the target convolution module to obtain an improved intermediate model; Step S14, iteratively training and verifying the intermediate model using the training set and the verification set to obtain a target crack recognition model.

[0015] Therefore, the embodiment of the present application inputs the crack image to be detected into the target crack recognition model to obtain the recognition result of the crack image to be detected, and the target crack recognition model is determined by the following steps: first, based on the initial Swin-Unet model, the ECA attention mechanism is introduced, and the Swin-Transformer-Block module is replaced with the target convolution module to obtain an improved intermediate model, and then the intermediate model is iteratively trained and verified using the training set and the verification set to obtain the target crack recognition model. Since the target crack recognition model introduces the ECA attention mechanism compared to the initial Swin-Unet model, it combines the advantages of the adaptive cross-channel interaction and enhanced feature representation capabilities of the ECA attention mechanism, so that the local features in the crack image can be effectively restored to improve the recognition accuracy of the target crack recognition model, and replaces the Swin-Transformer-Block module with the target convolution module, combining the advantages of the lightweight design of the target convolution module itself, so that the present application recognizes the crack image to be detected based on the target crack model, which can improve the efficiency and accuracy of the recognition result.

[0016] The hydraulic structures in the embodiment of the present application may be buildings such as embankments, reservoirs, and channels. Since most hydraulic structures are located in natural environments, they may age and crack after being affected by natural environmental factors for a long time. Figure 2 As shown, cracks exist in the hydraulic structure, and the shape of the cracks is usually irregular. In the embodiment of the present application, the cracked part of the hydraulic structure can be photographed to obtain a crack image dataset of the hydraulic structure.

[0017] Since the crack image set of hydraulic structures captured in a natural environment is affected by factors such as natural light changes, rainfall, and dust, the embodiment of the present application can simulate the crack images of hydraulic structures under the influence of different factors by preprocessing the crack image data set, so as to achieve the purpose of expanding the crack image set of hydraulic structures, thereby improving the accuracy of the crack image set and improving the generalization of the target crack recognition model obtained by iterative training using the crack image set.

[0018] In some embodiments, the initial Swin-Unet model may include an encoder and a decoder, and the encoder may decompose the input crack image into multi-scale feature representations step by step, and extract local and global information at the same time, thereby obtaining multiple crack feature maps. In some embodiments, the encoder may first divide the input image into non-overlapping blocks, each block is regarded as an independent token, and these tokens are projected into a higher-dimensional feature space to obtain an embedding vector, and then learn the feature depth of the embedding vector to obtain a feature map, halve the spatial resolution of the feature map and increase the feature dimension of the feature map to 2 times. Those skilled in the art do not limit the specific implementation of the encoder, and can design the encoder based on specific needs. Exemplarily, the encoder of the initial Swin-Unet model can be implemented by VisionTransformer (ViT), convolutional neural network or CNN-Transformer, etc.

[0019] Because the Swin-Transformer-Block module of the decoder in the initial Swin-Unet model is difficult to accurately capture and restore detail features for small cracks or cracks in complex backgrounds, in addition, due to the large amount of calculation of Swin-Transformer-Block, the reasoning speed of the Swin-Unet model is slow, which reduces the accuracy and efficiency of the target crack recognition model. The embodiment of the present application introduces the ECA attention mechanism, combines the advantages of the adaptive cross-channel interaction and enhanced feature characterization capabilities of the ECA attention mechanism, so that the local features in the crack image can be effectively restored to improve the recognition accuracy of the target crack recognition model. In addition, due to the advantages of the lightweight design of the target convolution module itself, the computational complexity of the target convolution module is lower than that of the Swin-Transformer-Block module. The present application can reduce the situation where the recognition efficiency is reduced due to the large amount of calculation of the Swin-Transformer-Block module on the basis of the ECA attention mechanism, thereby improving the recognition efficiency of the target crack recognition model.

[0020] In some embodiments, reference Figure 3 As shown, the intermediate model includes a feature extraction network, a Neck network, and a Head network connected in sequence, referring to Figure 4 As shown, the intermediate model is iteratively trained and verified using the training set and the verification set to obtain the target crack recognition model, including but not limited to the following steps: Step S21, using a feature extraction network to extract features from each crack image in the training set, to obtain a plurality of crack feature maps corresponding to each crack image; Step S22, each crack feature map of the crack image is processed by the Neck network using the ECA attention mechanism and then input into the target convolution module for upsampling, feature extraction and feature splicing in sequence to obtain a target crack feature map corresponding to the crack image; Step S23, using the Head network to perform image segmentation on the target crack feature map to obtain a recognition result of the crack image to be detected; Step S24, iteratively train the recognition results and verify them based on the verification set to obtain a target crack recognition model.

[0021] Therefore, the embodiment of the present application extracts a multi-scale crack feature map from the crack image through a feature extraction network, and uses the ECA attention mechanism to enhance the feature expression of the multi-scale crack feature map. Then, the output processed by the ECA attention mechanism is upsampled through the target convolution module to restore features, extract features, and splice multi-scale features. The spliced ​​result is input into the Head network to perform image segmentation on the target crack feature map, and then iterative training and verification are performed based on the segmentation result to obtain a target crack recognition model. The above embodiment of the present application can enhance the expression of features by introducing the ECA attention mechanism, restore the resolution of the multi-scale crack feature map by upsampling, and then further extract and convert features to further enhance the expression ability of features. Finally, the multi-scale crack feature map is spliced, so as to better retain the detailed information of the target crack feature map, and improve the accuracy of the target crack recognition model.

[0022] It can be understood that the embodiment of the present application introduces the ECA attention mechanism so that the target crack recognition model can pay more attention to important information, and restore the lost information of the crack feature maps of different scales extracted by the feature extraction network through upsampling. The expression ability of the features can be guaranteed through the ECA attention mechanism and upsampling. After feature extraction of the upsampled output, the crack feature maps of different scales are spliced, which can make full use of the multi-scale crack feature map information, thereby improving the accuracy of the target crack feature recognition model.

[0023] In the embodiment of the present application, the Head network is used to perform image segmentation on the target crack feature map by setting multiple convolutional layers to generate a segmentation mask for each pixel of the target crack feature map. The output of each pixel is a probability value or a category label, which indicates whether the pixel belongs to a crack. Taking the crack detection of hydraulic structures with two categories as an example, the output value of each pixel is between 0 and 1. The output value of the pixel is greater than the preset threshold, that is, the output value of the pixel is close to 1. Figure 5 As shown in Figure 2, the Head network recognition result belongs to crack.

[0024] It is understandable that the embodiment of the present application can perform iterative training on the recognition results and verify them according to the verification set by repeating steps S21 to S24 until a preset iterative training round is reached. Specifically, the parameters of the target crack recognition model are gradually optimized using the training set based on the preset iterative training parameters to improve the performance of the model. After each iterative training, the performance of the target crack recognition model is evaluated using the verification set to ensure that the target crack recognition model not only performs well on the training set, but also maintains good generalization ability on the untrained data set (i.e., the verification set).

[0025] Exemplarily, the crack image processing batch of iterative training is set to 32, the iterative training rounds are set to 200, the optimizer used in iterative training is stochastic gradient descent, the initial learning rate of the optimizer is set to 0.01, the weight decay coefficient of the optimizer is set to 0.0005, and the image size of the input training set is 640*640. Each time, feature extraction is performed on 32 crack images to obtain multiple crack feature maps, and then the Neck network is used for feature extraction and splicing, and the splicing results are used for image segmentation using the Head network to obtain the recognition results. After verification based on the validation set, the parameters of the target crack recognition model are updated according to the initial learning rate and weight decay coefficient of the stochastic gradient descent optimizer. Repeat the above operation until the iterative training round reaches 200 times, and output the target crack recognition model at 200 times.

[0026] In some embodiments, the feature extraction network includes a Patch Partition module, a first sub-feature extraction module, and a plurality of second sub-feature extraction modules connected in sequence, referring to Figure 6 As shown, step S21 includes: Step S31, inputting the crack image into the Patch Partition module for segmentation; Step S32, input the segmented crack image to the first sub-feature extraction module and multiple second sub-feature extraction modules connected in sequence for feature extraction, and determine the feature map output by the first sub-feature extraction module and each second sub-feature extraction module as the crack feature map.

[0027] Therefore, the embodiment of the present application performs feature extraction by sequentially connecting a first sub-feature extraction module and multiple second sub-feature extraction modules, and determines the feature map output by the first sub-feature extraction module and each second sub-feature extraction module as a crack feature map, which can make full use of the multi-scale of the crack feature map and improve the generalization of the target crack recognition model.

[0028] In the embodiment of the present application, hierarchical feature extraction is performed by setting a combination of a first sub-feature extraction module and a plurality of second sub-feature extraction modules. The first sub-feature extraction module can extract low-level features, which can be edge or texture features, and the plurality of second sub-feature extraction modules can extract higher-level features, which can be the overall shape or direction of cracks in hydraulic structures. Since cracks in hydraulic structures may exhibit different characteristics due to factors such as materials and environment, the multi-scale feature extraction in the embodiment of the present application can make the target crack recognition model more robust to changes in cracks in hydraulic structures, thereby improving the generalization ability of the target crack recognition model to identify cracks in different scenarios.

[0029] In the embodiment of the present application, the feature maps output by the first sub-feature extraction module and each second sub-feature extraction module are determined as crack feature maps. The splicing of multi-scale features makes the crack feature map richer and can better describe the complexity of the cracks.

[0030] In some embodiments, the Neck network includes a first convolution module, a second convolution module, a third convolution module, a fourth convolution module, a first ECA attention module, a second ECA attention module, a third ECA attention module, a fourth ECA attention module, a first ConvBlock module, a second ConvBlock module, a third ConvBlock module, a fourth ConvBlock module, a first upsampling module, a second upsampling module, a third upsampling module, a fourth upsampling module, a first Concat splicing module, a second Concat splicing module, a third Concat splicing module, and a fourth ConvBlock module. oncat splicing module, the input end of the first convolution module is connected to the output end of the first sub-feature extraction module, the input ends of the second convolution module, the third convolution module and the fourth convolution module are respectively connected to the output ends of each second sub-feature extraction module, the crack feature map includes the first crack feature map, the second crack feature map, the third crack feature map and the fourth crack feature map, the first sub-feature extraction module outputs the first crack feature map, the number of the second sub-feature extraction modules is 3, corresponding to the first module, the second module and the third module, the first module outputs the second crack feature map, the second module outputs the third crack feature map, and the third module outputs the fourth crack feature map, refer to Figure 7 as well as Figure 8 As shown, step S22 includes: Step S41, performing channel adjustment on the fourth crack feature map through a fourth convolution module to obtain a fourth convolution feature map, and inputting the fourth convolution feature map into a fourth ECA attention module for channel weighting to obtain a fourth intermediate feature; Step S42, performing channel adjustment on the third crack feature map through a third convolution module to obtain a third convolution feature map, and inputting the third convolution feature map into a third ECA attention module for channel weighting to obtain a third intermediate feature; Step S43, performing channel adjustment on the second crack feature map through a second convolution module to obtain a second convolution feature map, and inputting the second convolution feature map into a second ECA attention module for channel weighting to obtain a second intermediate feature; Step S44, performing channel adjustment on the first crack feature map through the first convolution module to obtain a first convolution feature map, and inputting the first convolution feature map into the first ECA attention module for channel weighting to obtain a first intermediate feature; Step S45, inputting the fourth intermediate feature into the first ConvBlock module for feature extraction to obtain the first ConvBlock feature, inputting the first ConvBlock feature into the first upsampling module for upsampling to obtain the first upsampling feature, and performing feature splicing on the first upsampling feature and the third intermediate feature through the first Concat splicing module to obtain the fifth intermediate feature; Step S46, extracting the fifth intermediate feature through the second ConvBlock module in sequence to obtain a second ConvBlock feature, inputting the second ConvBlock feature into the second upsampling module for upsampling to obtain a second upsampling feature, and concatenating the second upsampling feature and the second intermediate feature through the second Concat concatenation module to obtain a sixth intermediate feature; Step S47, extracting the sixth intermediate feature through the third ConvBlock module in sequence to obtain a third ConvBlock feature, inputting the third ConvBlock feature into the third upsampling module for upsampling to obtain a third upsampling feature, and concatenating the third upsampling feature with the first intermediate feature through the third Concat concatenation module to obtain a seventh intermediate feature; Step S48, the seventh intermediate feature is sequentially subjected to feature extraction by the fourth ConvBlock module to obtain a fourth ConvBlock feature, and the fourth ConvBlock feature is input into the fourth upsampling module for upsampling to obtain a target crack feature map.

[0031] Therefore, the embodiment of the present application can improve the accuracy and efficiency of the target crack identification model in identifying cracks in hydraulic structures by performing channel adjustment, channel weighting, feature extraction, upsampling and feature splicing on the crack feature map.

[0032] In some embodiments, since the features in the fourth crack feature map are scattered in different channels, the embodiment of the present application can integrate channels through the fourth convolution module, so that the features between different channels can be fused, and the expressive power of the features can be enhanced. The fourth convolution matrix of the embodiment of the present application can perform weighted summation on each spatial position of the fourth crack feature map through a weight matrix, thereby realizing a linear combination across channels. Those skilled in the art can set the specific implementation of the fourth convolution module according to actual needs. Exemplarily, the fourth convolution module can be set to a convolution module such as a fourth 1*1 convolution module, a fourth 4*4 convolution module, or a fourth 7*7 convolution module. It can be understood that the implementation methods of the first convolution module, the second convolution module, and the third convolution module are basically the same as the implementation methods of the specific embodiments of the fourth convolution module, and will not be repeated here.

[0033] In some embodiments, the first ECA attention module can compress each channel spatial dimension of the first convolution feature map; adaptively calculate the kernel size of the one-dimensional convolution according to the channel dimension, adjust the dimension of the compressed feature map, and perform local cross-channel interaction based on the calculated one-dimensional convolution kernel, and then generate channel weights through the activation function; perform weighted calculation on the channel weights and the channels corresponding to the channel weights in the first convolution feature map to obtain the first intermediate feature. The first ECA module of the embodiment of the present application can dynamically adjust the range of local cross-channel interaction according to the channel dimension by adaptively selecting the size of the one-dimensional convolution kernel, so that high-dimensional channels can interact in a longer range, while low-dimensional channels interact in a shorter range, thereby efficiently capturing the dependencies between channels in different dimensions. It is understandable that the implementation methods of the second ECA attention module, the third ECA attention module, and the fourth ECA attention module are basically the same as the implementation methods of the specific embodiments of the first ECA attention module, and will not be repeated here.

[0034] In some embodiments, the first Concat splicing module can perform weighted addition of the channel dimensions of the first up-sampled feature and the third intermediate feature to obtain the fifth intermediate feature after splicing. In other embodiments, the first Concat splicing module can assign weights to the first up-sampled feature and the third intermediate feature respectively, and perform weighted addition of the channel dimensions of the first up-sampled feature and the third intermediate feature based on the weights to obtain the fifth intermediate feature after weighted splicing; in addition, the weights assigned to the first up-sampled feature and the third intermediate feature can be obtained by preset specific data values ​​or by learning. Those skilled in the art can set the specific values ​​of the weights according to actual needs. In the embodiment of the present application, the first Concat splicing module can obtain the fifth intermediate feature by merging the channel information of the first up-sampled feature and the third intermediate feature in the channel dimension, and can combine local details with global semantics, thereby improving the recognition accuracy and generalization ability of the target crack recognition model. It can be understood that the implementation methods of the second Concat splicing module, the third Concat splicing module and the fourth Concat splicing module are basically the same as the implementation methods of the specific embodiments of the first Concat splicing module, and will not be repeated here.

[0035] In some embodiments, the first ConvBlock module may include a plurality of convolutional layers connected in sequence, and each convolutional layer may be connected to an activation function and a normalization layer. The first ConvBlock module performs a convolution operation on the fourth intermediate feature through each convolutional layer in turn, extracts features, activates the extracted features through the activation function, and then inputs them into the normalization layer for normalization processing to obtain the first ConvBlock features. The embodiment of the present application can perform feature extraction through multiple convolutional layers, and can enhance the feature expression of the first ConvBlock. It can be understood that the implementation methods of the second ConvBlock module, the third ConvBlock module, and the fourth ConvBlock module are basically the same as the implementation methods of the specific embodiment of the first ConvBlock module, and will not be repeated here.

[0036] In some embodiments, reference Fig. 9 As shown, the first sub-feature extraction module includes a LinearEmbeding module and a Swin-Transformer-Block module connected in sequence, and the first module, the second module and the third module of the second sub-feature extraction module all include a Patch Merging module and a Swin-Transformer-Block module in sequence. Specifically, the first sub-feature extraction module of the embodiment of the present application outputs a first crack feature map, the first module outputs a second crack feature map, the second module outputs a third crack feature map, and the third module outputs a fourth crack feature map, including but not limited to the following steps: The segmented crack image to be detected is converted into an embedding vector through the Linear Embedding module; Input the embedding vector to the first Swin-Transformer-Block module to extract the first crack feature map, and input the first crack feature map to the second Swin-Transformer-Block module through the first Patch Merging module to extract the second crack feature map; The second crack feature map is input into the third Swin-Transformer-Block module through the second Patch Merging module to extract the third crack feature map; The third crack feature map is input into the fourth Swin-Transformer-Block module through the third Patch Merging module to extract the fourth crack feature map.

[0037] In the embodiment of the present application, the Swin-Transformer-Block modules in the first sub-feature extraction module and the multiple second sub-feature extraction modules include, in sequence, a first LN module, a W-MSA module, a first residual module, a second LN module, a first MLP module, a second residual module, a third LN module, a fourth LN module, a SW-MSA module, a third residual module, a second MLP module and a fourth residual module.

[0038] In the embodiment of the present application, the Patch Merging module includes a Patch division and merging module, a linear transformation module, and a shape adjustment module connected in sequence. After the Patch division and merging module divides the input feature map into multiple patches, the multiple patches are merged, and then each merged patch is mapped to a larger channel space through the linear transformation module, and finally the dimensional order of the output feature map is adjusted through the shape adjustment module.

[0039] Reference Fig.10 As shown, the first Swin-Transformer-Block module includes a first LN module, a W-MSA module, a first residual module, a second LN module, a first MLP module, a second residual module, a third LN module, a SW-MSA module, a fourth residual module, a fourth LN module, a second MLP module, and a third residual module. Taking the example of inputting the embedding vector into the first Swin-Transformer-Block module to extract the first crack feature map, it can be achieved by the following steps: The embedding vector is normalized by the first LN module and then input into the W-MSA module for self-attention calculation in the local window. The output feature map of the W-MSA module and the segmented crack image are residually connected by the first residual module to obtain the first residual map. The first residual image is normalized by the second LN module and then input into the first MLP module for nonlinear transformation and Mish activation function activation. The first residual image and the feature image output by the first MLP module are residually connected by the second residual module to obtain a second residual image. The second residual map is normalized by the third LN module and then input into the SW-MSA module for self-attention calculation between local windows. The output feature map of the SW-MSA module and the second residual map are residually connected by the third residual module to obtain the third residual map. The third residual image is normalized by the fourth LN module and then input into the second MLP module for nonlinear transformation and Mish activation function activation. The third residual image and the feature image output by the second MLP module are residually connected through the fourth residual module to obtain the first crack feature image.

[0040] The Swin-Transformer-Block module in the embodiment of the present application performs self-attention calculations within a local window through W-MSA, and performs self-attention calculations between local windows through the SW-MSA module. It can use W-MSA to enhance the expression of local features while using the SW-MSA module to communicate between different local windows while taking into account the modeling capabilities of global information. The implementation method of the second sub-feature extraction module in the embodiment of the present application is basically the same as the embodiment of inputting the embedded vector into the first Swin-Transformer-Block module to extract the first crack feature map, and will not be repeated here.

[0041] It can be understood that the first LN module performs standardization processing on the segmented crack image to normalize all the features of the downsampled feature map, so that all the features of the segmented crack image have a distribution with a mean of 0 and a standard deviation of 1, so that the gradient will not explode or disappear due to a large or small value range during the back propagation process, and the input and output distribution of the first LN module remain consistent, thereby stabilizing the training process of the entire target crack recognition model.

[0042] It can be understood that the W-MSA module divides the image into multiple non-overlapping local windows and performs self-attention calculations in each window. Since the W-MSA module performs self-attention calculations within the local window instead of calculating the entire image, the amount of calculation and memory overhead are reduced; in addition, compared to calculating the entire image, the W-MSA module can better capture local features and detail information in the image. In other embodiments, the SW-MSA module introduces a local window offset and offsets the local window according to the step size, so that overlapping areas are generated between adjacent windows, and information between different windows can be communicated, thereby enhancing the perception of global information.

[0043] It is understandable that, since the data in practical applications are usually complex nonlinear relationships, the data input into the first MLP module and the second MLP module can be mapped to a nonlinear feature space by performing nonlinear transformations in both the first MLP module and the second MLP module, thereby enhancing the stability of the gradient and thus enhancing the expression and generalization capabilities of the target crack identification model, wherein the gradient is used to guide the update direction of the target crack identification model parameters. Based on the nonlinear transformation, the Mish activation function is used for activation. Since the Mish activation function is a smooth nonlinear activation function, the output of the Mish activation function is continuous over the entire definition domain, which can further improve the stability of the gradient and thus enhance the expression and generalization capabilities of the target crack identification model.

[0044] Specifically, the calculation expression of the Mish activation function is as follows: ; ; in, is the Mish activation function, is the hyperbolic tangent function, is a natural constant, is a smooth nonlinear function, It is the input value of the Mish activation function.

[0045] In some embodiments, the structures of the second ECA attention module, the third ECA attention module, and the fourth ECA attention module are the same as the first ECA attention module; Fig.11 As shown, the first ECA attention module includes a global pooling module, a convolution module, a Sigmoid activation module, and a channel-by-channel weighting module in sequence. Fig.12 As shown, the first convolution feature map is input into the first ECA attention module for channel weighting to obtain the first intermediate feature, including but not limited to the following steps: Step S51, inputting the first convolution feature map into the global pooling module for global average pooling to obtain a first pooling feature; Step S52, extracting the first pooled feature through the first convolution module and inputting it into the Sigmoid activation module for activation, so as to obtain the attention coefficient corresponding to each channel in the first convolution feature map; Step S53, multiplying the attention coefficient by the channel corresponding to the attention coefficient through a channel-by-channel weighting module to obtain a first intermediate feature.

[0046] Therefore, in the embodiment of the present application, the first pooled feature is extracted by the first convolution module and then input into the Sigmoid activation module for activation to obtain the attention coefficient corresponding to each channel in the first convolution feature map. The attention coefficient is multiplied by the channel corresponding to the attention coefficient through the channel-by-channel weighting module to obtain the first intermediate feature, which can weight each channel of the first convolution feature map, thereby enhancing the feature expression of the first intermediate feature.

[0047] In some embodiments, global average pooling is to compress the spatial dimension of the first convolutional feature map into a single value, retain the global information of each channel and extract the feature representation at the channel level, which can reduce the computational complexity; on the basis of global average pooling, further feature extraction is performed on the features after global average pooling through feature extraction operations to learn the relationship between channels; on the basis of feature extraction, the features after feature extraction are mapped to the (0, 1) interval according to the Sigmoid activation function to generate the attention coefficient of each channel; on the basis of Sigmoid function activation, the attention coefficient is multiplied by the corresponding channel of the first convolutional feature map respectively, so as to enhance the feature expression of the first intermediate feature.

[0048] It can be understood that the implementation methods of the second ECA attention module, the third ECA attention module and the fourth ECA attention module are basically the same as the specific implementation example of the first ECA attention module, and will not be repeated here.

[0049] In some embodiments, the structures of the second ConvBlock module, the third ConvBlock module and the fourth ConvBlock module are the same as the structure of the first ConvBlock module; the first ConvBlock module sequentially includes a fifth convolution module, a first BN module, a first ReLU activation module, a sixth convolution module, a second BN module, a second ReLU activation module and a residual connection module, referring to Fig.13 as well as Fig.14 As shown, the fourth intermediate feature is input into the first ConvBlock module for feature extraction to obtain the first ConvBlock feature, including but not limited to the following steps: Step S61, extracting features and converting dimensions of the fourth intermediate features through the fifth convolution module, and then inputting the features into the first BN module for batch normalization processing; Step S62, introducing the output value of the first BN module into the ReLU activation function through the first ReLU activation module for activation; Step S63, extracting features and converting dimensions of the output value of the first ReLU activation module through the sixth convolution module, and then inputting the output value into the second BN module for batch normalization processing; Step S64, introducing the output value of the second BN module into the ReLU activation function through the second ReLU activation module for activation; Step S65, weighted calculation is performed on the fourth intermediate feature and the output value of the second ReLU activation module through the residual connection module to obtain the first ConvBlock feature.

[0050] Therefore, in the embodiment of the present application, the fourth intermediate feature is extracted and dimensionally converted by the fifth convolution module, and then input into the first BN module for batch normalization processing; the output value of the first BN module is introduced into the ReLU activation function through the first ReLU activation module for activation; the output value of the first ReLU activation module is extracted and dimensionally converted by the sixth convolution module, and then input into the second BN module for batch normalization processing; the output value of the second BN module is introduced into the ReLU activation function through the second ReLU activation module for activation; the fourth intermediate feature and the output value of the second ReLU activation module are weightedly calculated through the residual connection module to obtain the ConvBlock feature, which can enhance the feature expression of the first ConvBlock feature, and the information of the fourth intermediate feature is taken into account through the residual connection module.

[0051] Specifically, the embodiment of the present application further extracts features and converts dimensions of the fourth intermediate feature through the fifth convolution module to extract a higher-level feature representation; on the basis of feature extraction, the output value of the fifth convolution module is batch normalized to keep the gradient stable; on the basis of batch normalization, nonlinear activation is introduced through the first ReLU activation module to enhance the expression ability; the above steps are repeated, and then the fourth intermediate feature and the output value of the second ReLU activation module are weightedly calculated through the residual connection module to further maintain the stability of the gradient, so that the first ConvBlock feature takes into account the information of the first intermediate feature.

[0052] It is understandable that those skilled in the art can set the specific implementation of the fifth convolution module and the sixth convolution module according to actual needs. Exemplarily, the fifth convolution module and the sixth convolution module can be set to the fifth 3*3 convolution module and the sixth 3*3 convolution module, the fifth 4*4 convolution module and the sixth 4*4 convolution module, the fifth 7*7 convolution module and the sixth 7*7 convolution module.

[0053] It can be understood that the implementation methods of the second ConvBlock module, the third ConvBlock module and the fourth ConvBlock module are substantially the same as the specific embodiment of the first ConvBlock module, and are not described in detail herein.

[0054] In some embodiments, preprocessing the crack image dataset includes: Each crack image in the crack image data set is processed by adding Gaussian noise, changing saturation and brightness in turn; Among them, Gaussian noise satisfies the following expression: ; in, is the preset standard deviation of Gaussian noise, is a natural constant, is the default mean of Gaussian noise.

[0055] Therefore, the embodiment of the present application can simulate the crack images of hydraulic structures under the influence of different factors by adding Gaussian noise and changing the saturation and brightness of each crack image in turn, so as to improve the accuracy of the crack images.

[0056] It can be understood that the embodiment of the present application can simulate the influence of light in the natural environment on the crack image of hydraulic structure by changing the saturation and brightness, so that the crack image is closer to reality, thereby improving the accuracy of the crack image.

[0057] The embodiment of the present application uses the calculation formula of Gaussian noise to control the center position of the Gaussian noise distribution by adjusting the specific value of μ, and further controls the extension of the Gaussian noise distribution by adjusting the specific value of σ, so as to simulate the noise interference caused by the crack image under the interference of natural environmental factors. Relevant technicians in this field can set the specific value of the Gaussian noise formula according to actual needs.

[0058] The present application also provides a hydraulic structure crack identification device, comprising: The first data acquisition module is used to acquire a crack image dataset of a hydraulic structure, preprocess the crack image dataset, and divide the preprocessed crack image dataset into a training set and a verification set; A second data acquisition module is used to acquire an initial Swin-Unet model, wherein the decoder of the initial Swin-Unet model includes a Swin-Transformer-Block module; The first data processing module is used to introduce the ECA attention mechanism based on the initial Swin-Unet model and replace the Swin-Transformer-Block module with the target convolution module to obtain an improved intermediate model; The second data processing module uses the training set and the validation set to iteratively train and validate the intermediate model to obtain a target crack recognition model; The crack image to be detected is input into the target crack recognition model to obtain the recognition result of the crack image to be detected.

[0059] The specific implementation of the hydraulic structure crack identification device of the embodiment of the present application is basically the same as the specific implementation of the hydraulic structure crack identification method described above, and will not be repeated here.

[0060] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above hydraulic structure crack identification method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0061] See also Fig.15 , Fig.15 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes: The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the hydraulic structure crack identification method of the embodiment of this application; Input / output interface 903, used to implement information input and output; Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.); A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904); The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0062] In some embodiments, the embodiments of the present application further provide a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned hydraulic structure crack identification method is implemented.

[0063] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0064] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0065] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0066] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0067] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0068] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0069] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0070] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0071] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0072] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0073] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

Claims

1. A method for identifying cracks in hydraulic structures, characterized in that: The hydraulic structure crack identification method comprises: Inputting the crack image to be detected into the target crack recognition model to obtain the recognition result of the crack image to be detected; The target crack identification model is determined by the following steps: Acquire a crack image dataset of a hydraulic structure, preprocess the crack image dataset, and divide the preprocessed crack image dataset into a training set and a validation set; Obtaining an initial Swin-Unet model, wherein the decoder of the initial Swin-Unet model includes a Swin-Transformer-Block module; Based on the initial Swin-Unet model, the ECA attention mechanism is introduced, and the Swin-Transformer-Block module is replaced with a target convolution module to obtain an improved intermediate model; The intermediate model is iteratively trained and verified using the training set and the verification set to obtain the target crack recognition model.

2. The method for identifying cracks in hydraulic structures according to claim 1, characterized in that: The intermediate model includes a feature extraction network, a Neck network and a Head network connected in sequence, and the intermediate model is iteratively trained and verified using the training set and the verification set to obtain the target crack recognition model, including: Using the feature extraction network to perform feature extraction on each crack image in the training set, to obtain a plurality of crack feature maps corresponding to each crack image; Each crack feature map of the crack image is processed by the Neck network using the ECA attention mechanism and then input into the target convolution module for upsampling, feature extraction and feature splicing in sequence to obtain a target crack feature map corresponding to the crack image; Using the Head network to perform image segmentation on the target crack feature map to obtain a recognition result of the crack image to be detected; The recognition result is iteratively trained and verified according to the verification set to obtain the target crack recognition model.

3. The method for identifying cracks in hydraulic structures as claimed in claim 2, characterized in that: The feature extraction network includes a Patch Partition module, a first sub-feature extraction module and a plurality of second sub-feature extraction modules connected in sequence. The feature extraction network is used to extract features from each crack image in the training set to obtain a plurality of crack feature maps corresponding to each crack image, including: Input the crack image into the Patch Partition module for segmentation; The segmented crack image is input into the first sub-feature extraction module and a plurality of the second sub-feature extraction modules connected in sequence for feature extraction, and the feature map output by the first sub-feature extraction module and each of the second sub-feature extraction modules is determined as the crack feature map.

4. The method for identifying cracks in hydraulic structures as claimed in claim 3, characterized in that: The Neck network includes a first convolution module, a second convolution module, a third convolution module, a fourth convolution module, a first ECA attention module, a second ECA attention module, a third ECA attention module, a fourth ECA attention module, a first ConvBlock module, a second ConvBlock module, a third ConvBlock module, a fourth ConvBlock module, a first upsampling module, a second upsampling module, a third upsampling module, a fourth upsampling module, a first Concat splicing module, a second Concat splicing module, a third Concat splicing module and a fourth Concat splicing module, the input end of the first convolution module is connected to the output end of the first sub-feature extraction module, the second convolution module, the third convolution module and the fourth The input end of the convolution module is respectively connected to the output end of each of the second sub-feature extraction modules, the crack feature map includes a first crack feature map, a second crack feature map, a third crack feature map and a fourth crack feature map, the first sub-feature extraction module outputs the first crack feature map, the number of the second sub-feature extraction modules is 3, correspondingly including a first module, a second module and a third module, the first module outputs the second crack feature map, the second module outputs the third crack feature map, and the third module outputs the fourth crack feature map, each crack feature map of the crack image is processed by the Neck network using the ECA attention mechanism and then input into the target convolution module for upsampling, feature extraction and feature splicing in turn, to obtain a target crack feature map corresponding to the crack image, including: The fourth crack feature map is subjected to channel adjustment by the fourth convolution module to obtain a fourth convolution feature map, and the fourth convolution feature map is input into the fourth ECA attention module for channel weighting to obtain a fourth intermediate feature; The third crack feature map is subjected to channel adjustment by the third convolution module to obtain a third convolution feature map, and the third convolution feature map is input into the third ECA attention module for channel weighting to obtain a third intermediate feature; The second crack feature map is subjected to channel adjustment by the second convolution module to obtain a second convolution feature map, and the second convolution feature map is input into the second ECA attention module for channel weighting to obtain a second intermediate feature; Passing the first crack feature map through the first convolution module to perform channel adjustment to obtain a first convolution feature map, and inputting the first convolution feature map into the first ECA attention module for channel weighting to obtain a first intermediate feature; Input the fourth intermediate feature to the first ConvBlock module for feature extraction to obtain a first ConvBlock feature, input the first ConvBlock feature to the first upsampling module for upsampling to obtain a first upsampling feature, and perform feature splicing on the first upsampling feature and the third intermediate feature through the first Concat splicing module to obtain a fifth intermediate feature; The fifth intermediate feature is sequentially subjected to feature extraction by the second ConvBlock module to obtain a second ConvBlock feature, the second ConvBlock feature is input into the second upsampling module for upsampling to obtain a second upsampling feature, and the second upsampling feature and the second intermediate feature are feature concatenated by the second Concat concatenation module to obtain a sixth intermediate feature; The sixth intermediate feature is sequentially subjected to feature extraction by the third ConvBlock module to obtain a third ConvBlock feature, the third ConvBlock feature is input into the third upsampling module for upsampling to obtain a third upsampling feature, and the third upsampling feature and the first intermediate feature are feature concatenated by the third Concat concatenation module to obtain a seventh intermediate feature; The seventh intermediate feature is sequentially subjected to feature extraction by the fourth ConvBlock module to obtain a fourth ConvBlock feature, and the fourth ConvBlock feature is input into the fourth upsampling module for upsampling to obtain the target crack feature map.

5. The method for identifying cracks in hydraulic structures as claimed in claim 4, characterized in that: The structures of the second ECA attention module, the third ECA attention module and the fourth ECA attention module are the same as the structure of the first ECA attention module. The first ECA attention module includes a global pooling module, a convolution module, a Sigmoid activation module and a channel-by-channel weighting module in sequence. The first convolution feature map is input into the first ECA attention module for channel weighting to obtain a first intermediate feature, including: Inputting the first convolution feature map into the global pooling module for global average pooling to obtain a first pooling feature; The first pooling feature is extracted by the convolution module and then input into the Sigmoid activation module for activation to obtain the attention coefficient corresponding to each channel in the first convolution feature map; The attention coefficient is multiplied by the channel corresponding to the attention coefficient through the channel-by-channel weighting module to obtain the first intermediate feature.

6. The method for identifying cracks in hydraulic structures as claimed in claim 4, characterized in that: The structures of the second ConvBlock module, the third ConvBlock module and the fourth ConvBlock module are the same as the structure of the first ConvBlock module. The first ConvBlock module includes a fifth convolution module, a first BN module, a first ReLU activation module, a sixth convolution module, a second BN module, a second ReLU activation module and a residual connection module. The fourth intermediate feature is input into the first ConvBlock module for feature extraction to obtain the first ConvBlock feature, including: The fourth intermediate feature is extracted and dimensionally converted by the fifth convolution module and then input into the first BN module for batch normalization processing; The output value of the first BN module is introduced into the ReLU activation function through the first ReLU activation module for activation; The output value of the first ReLU activation module is subjected to feature extraction and dimension conversion by the sixth convolution module and then input into the second BN module for batch normalization processing; The output value of the second BN module is introduced into the ReLU activation function through the second ReLU activation module for activation; The fourth intermediate feature and the output value of the second ReLU activation module are weightedly calculated through the residual connection module to obtain the first ConvBlock feature.

7. The method for identifying cracks in hydraulic structures according to claim 1, characterized in that: The preprocessing of the crack image data set includes: Adding Gaussian noise, changing saturation and brightness to each crack image in the crack image data set in turn; Wherein, the Gaussian noise satisfies the following expression: ; in, is the preset standard deviation of Gaussian noise, is a natural constant, is the default mean of Gaussian noise.

8. A hydraulic structure crack identification device, characterized in that: include: A first data acquisition module is used to acquire a crack image dataset of a hydraulic structure, preprocess the crack image dataset, and divide the preprocessed crack image dataset into a training set and a validation set; A second data acquisition module is used to acquire an initial Swin-Unet model, wherein the decoder of the initial Swin-Unet model includes a Swin-Transformer-Block module; A first data processing module is used to introduce an ECA attention mechanism based on the initial Swin-Unet model, and replace the Swin-Transformer-Block module with a target convolution module to obtain an improved intermediate model; A second data processing module, using the training set and the verification set to iteratively train and verify the intermediate model to obtain a target crack recognition model; The crack image to be detected is input into the target crack recognition model to obtain the recognition result of the crack image to be detected.

9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When at least one of the programs is executed by at least one of the processors, the hydraulic structure crack identification method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing computer-executable instructions, characterized in that: The computer executable instructions are used to execute the hydraulic structure crack identification method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for quickly positioning and identifying fine cracks of tunnel lining

    CN119360385A

  • Pavement crack detection method and system

    CN119579546A

  • Self-attention-based method for detecting defective area of color-textured fabric

    WO2023070911A1