Small sample crack identification method and system based on transfer learning
Patent Information
- Application Number
- CN202511100950.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-11-14
AI Technical Summary
Existing technologies for crack identification under small sample conditions suffer from low identification accuracy, insufficient generalization ability, and lack of crack severity assessment. In particular, in crack identification, the general attention mechanism has limited ability to perceive linear cracks, data augmentation methods cannot effectively change the underlying texture dependency relationship between cracks and background, and there is a lack of deep coupling and collaborative optimization between modules.
A transfer learning-based approach is adopted, combining an adaptive crack perception attention module, a feature-level linear modulation layer, and a Gaussian Naive Bayes classifier. Realistic crack images are generated through CycleGAN data augmentation, crack features are captured using multi-directional asymmetric convolution kernels, and a meta-learning staged training strategy is combined to achieve efficient crack identification and severity assessment.
It improves the accuracy and generalization ability of crack identification, enabling accurate identification of cracks and assessment of their severity with small samples. Through adaptive mechanisms and high-fidelity data enhancement, it significantly improves the robustness and efficiency of the model and provides interpretable evaluation results.
Smart Images

Figure CN120953811A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of crack recognition technology, specifically to a few-sample crack recognition method and system based on transfer learning. Background Technology
[0002] Cracks exist in a wide variety of structures, such as roads, buildings, and bridges. The presence of cracks can significantly degrade the performance of a structure, making it unable to meet design and usage requirements. Therefore, timely detection of cracks is crucial. Addressing cracks as early as possible can prevent further deterioration of structural performance, while also reducing the difficulty and cost of treatment.
[0003] Traditional crack identification methods rely on manual labor, which is obviously too costly in terms of both manpower and time. With technological advancements, automated crack assessment methods have emerged, overcoming the shortcomings of manual methods. Automated methods mainly consist of three parts: data acquisition, crack detection, and crack diagnosis. Data acquisition primarily involves collecting data, providing image data as input for crack detection methods. Crack detection checks for cracks in the acquired images, minimizing human intervention and providing helpful information for crack diagnosis. Crack diagnosis further determines the optimal repair timing and method based on the crack information.
[0004] With the rapid development of artificial intelligence technology, machine learning has become a very popular method due to its excellent performance in various tasks. Traditional machine learning requires a predefined feature extraction stage to reduce data complexity and expose data patterns to the algorithm, which to some extent limits the performance of machine learning algorithms. As a subset of machine learning, deep learning uses multi-layered neural networks, which can automatically complete learning during the training phase and can obtain models with stronger generalization and greater robustness.
[0005] To obtain a deep neural network with strong generalization capabilities, it needs to be trained on a large amount of data, which places significant demands on hardware and datasets. On the one hand, not all domains have access to large amounts of high-quality data, and labeling and partitioning large datasets is time-consuming. Few-shot learning offers a method to achieve a certain level of generalization ability using only a small number of samples. On the other hand, to address the data dependency and high training costs of neural networks, transfer learning transfers knowledge from one domain to another, resolving this dependency issue. In few-shot learning, key factors for successful knowledge transfer from the source domain to the target domain include limited training data, domain variation, and task modification. Using such pre-trained models to extract features can significantly alleviate the data pressure of few-shot learning. To adapt the model to the target domain task, network parameters are typically frozen, and the parameters of the classifier layer are updated on the training set, resulting in a model with generalization capabilities in the target domain.
[0006] Current crack recognition technologies still suffer from low accuracy, insufficient generalization ability, and a lack of crack severity assessment under small sample conditions. Some scholars have conducted comparative analyses of the performance of different backbone networks, such as VGG and ResNet, in crack recognition, demonstrating the potential of deep neural networks. However, existing methods still face significant challenges in small sample scenarios. First, while general attention mechanisms (such as CBAM and SE-Net) can improve feature saliency, their designs are mostly geared towards planar or blocky targets. For thin, continuous, and low-contrast linear topologies like cracks, their perceptual ability is limited, and they struggle to effectively suppress interference from similar textures in the background. Second, conventional data augmentation (such as flipping and cropping) cannot alter the underlying texture dependency between cracks and the background, leading to background overfitting in small sample conditions. For example, the model might only learn to identify cracks on specific asphalt pavements but fail to generalize to concrete bridge decks. Finally, existing technologies typically treat feature extraction, attention augmentation, and classification decisions as simple cascades of independent modules, lacking consideration for deep coupling and collaborative optimization between modules, thus limiting the upper limit of overall performance. Summary of the Invention
[0007] This invention provides a method and system for identifying small-sample cracks based on transfer learning, in order to solve the problems of low identification accuracy, insufficient generalization ability, and lack of crack severity assessment in the prior art.
[0008] According to the first aspect, one embodiment provides a few-sample crack identification method based on transfer learning, the method comprising: Collect crack images and construct training and testing sets; A crack recognition network model is constructed, which includes a pre-trained MobileNetV4 backbone network module with a feature-level linear modulation layer, an adaptive crack perception attention module located at the front end of the backbone network module, and a Gaussian Naive Bayes classifier located at the back end of the backbone network module. The crack image is input into the adaptive crack perception attention module, and the attention map is output. The obtained attention map is used to modulate the original input crack image to generate a modulated image; The modulated image is input into the backbone network module for feature extraction to obtain deep features; The extracted depth features are input into a Gaussian Naive Bayes classifier, which outputs crack identification results. Based on the crack identification results, the severity of the identified cracks is assessed.
[0009] Furthermore, crack images were acquired, and training and testing sets were constructed, specifically including: The original crack image samples were preprocessed, and the dataset was divided into training and test sets according to the proportion. The training set was used to fine-tune the model loaded with pre-trained weight parameters, and the test set was used to test the performance of the fine-tuned model.
[0010] Furthermore, crack images are acquired, and training and testing sets are constructed, specifically including: Data augmentation is performed on the constructed recurrent generative adversarial network model to expand the training set data; The recurrent generative adversarial network model includes two generators, G_A2B and G_B2A, and two discriminators, D_A and D_B. Generator G_A2B is used to transform an image in a crack-free image domain into an image in a cracked image domain, while generator G_B2A performs the opposite transformation to G_A2B. The network model is trained end-to-end using adversarial loss and recurrent consistency loss. When expanding the training data, crack-free images from the training set are input into the trained generator G_A2B to generate a batch of synthetic images that retain the original background but have realistic cracks added. The resulting synthetic image samples are then added to the training set.
[0011] Furthermore, the crack image is input into the adaptive crack perception attention module, and an attention map is output, specifically including: The adaptive crack perception attention module includes multiple parallel asymmetric convolutional kernels, a fusion convolutional layer, and a context modulation module. The multiple parallel asymmetric convolutional kernels are used to capture linear crack features in different directions from the input multi-channel image, including a 1×N convolutional kernel for detecting horizontal cracks, an N×1 convolutional kernel for detecting vertical cracks, and an oblique convolutional kernel for detecting cracks at different angles. The fusion convolutional layer is used to fuse the output features of the multiple asymmetric convolutional kernels and generate a preliminary attention map. The context modulation module is used to utilize the global context features output by the backbone network module to modulate the preliminary attention map through a fully connected layer to generate the final attention map.
[0012] Furthermore, the obtained attention map is used to modulate the original input crack image to generate a modulated image, specifically including: The final attention map is restored to the original image channel number through a projection convolutional layer. Then, the output is multiplied element-wise with the original input crack image to obtain the modulated image.
[0013] Furthermore, the modulated image is input into the backbone network module for feature extraction to obtain deep features, specifically including: The backbone network module uses MobileNetV4 as the basic feature extractor and loads it into pre-trained weights; feature-level linear modulation layers are integrated into specific convolutional blocks of MobileNetV4; the feature-level linear modulation layers receive the input feature maps from the previous layer. and execute the output feature map The affine transformation operation; the affine transformation parameters γ and β are used as learnable parameters of the model and are optimized during the fine-tuning stage.
[0014] Furthermore, a staged training method based on meta-learning is used to fine-tune the model, including: In each iteration, the support set and query set are obtained by resampling from the training set; Configure the class mean and covariance matrix of the Gaussian Naive Bayes classifier using the support set of samples and their deep features; The classification loss and severity assessment loss are calculated using the query set, and the parameters of the adaptive crack perception attention module and the affine transformation parameters γ and β of the feature-level linear modulation layer in the backbone network module are jointly optimized by backpropagation.
[0015] Furthermore, based on the crack identification results, the severity of the identified cracks is assessed, specifically including: For images identified as having cracks, extract their corresponding attention maps; The extracted attention map is thresholded to obtain a binary mask of the crack; The binary mask of the crack is skeletonized, and the average width of the crack is estimated by calculating the mean of the distance transformation on the skeleton pixels. Calculate the area and length of cracks using a binary mask based on the cracks; The final crack severity score is obtained by weighted summation of the crack area, length, and average width.
[0016] According to a second aspect, one embodiment provides a few-sample crack identification system based on transfer learning, the system comprising: The dataset building module is used to collect crack images and build training and test sets; The model building module is used to build a crack recognition network model, which includes a pre-trained MobileNetV4 backbone network module with a feature-level linear modulation layer, an adaptive crack perception attention module located at the front end of the backbone network module, and a Gaussian Naive Bayes classifier located at the back end of the backbone network module. Crack detection module, used for: The crack image is input into the adaptive crack perception attention module, and the attention map is output. The obtained attention map is used to modulate the original input crack image to generate a modulated image; The modulated image is input into the backbone network module for feature extraction to obtain deep features; The extracted depth features are input into a Gaussian Naive Bayes classifier, which outputs crack identification results. The crack severity assessment module is used to assess the severity of identified cracks based on the crack identification results.
[0017] According to three aspects, one embodiment provides an electronic device, the device comprising: a processor and a memory; The memory is used to store one or more program instructions; The processor is configured to run one or more program instructions to perform the steps of a few-sample crack identification method based on transfer learning as described in any of the preceding claims.
[0018] According to a fourth aspect, one embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a few-sample crack identification method based on transfer learning as described in any of the preceding claims.
[0019] This invention provides a few-sample crack identification method and system based on transfer learning, which has the following beneficial effects: 1) Innovative input signal pre-modulation: Unlike traditional attention methods that weight signals at the feature layer, this invention modulates the original RGB signal at the image input end using a crack-aware attention map. This "pre-enhancement" mechanism ensures that the subsequent feature extraction network receives a more significant input signal from the crack region from the outset, improving the signal-to-noise ratio from the source—a feature not found in existing technologies.
[0020] 2) The attention module designed in this invention, with the help of a dedicated crack geometry perception attention, can efficiently and accurately capture the geometric features of cracks such as their linearity and orientation by paralleling multiple asymmetric convolution kernels in different directions, making it more targeted and effective than general attention modules.
[0021] 3) This invention combines two complementary adaptive mechanisms to achieve a dual adaptive mechanism working collaboratively. Spatial adaptation is achieved through an attention module, dynamically enhancing crack regions at different locations in the image; channel adaptation is achieved through a FiLM layer, adjusting the feature channel responses within the network according to task characteristics. The two mechanisms work together to achieve fast and efficient adaptation to tasks with small sample sizes.
[0022] 4) The CycleGAN data augmentation technology used in this invention provides high-fidelity data augmentation, which can generate synthetic images that retain the original scene content but add realistic crack textures, effectively decoupling the background and cracks and greatly improving the robustness of the model. Attached Figure Description
[0023] Figure 1 A flowchart illustrating a few-sample crack identification method based on transfer learning, as provided in one embodiment of the present invention; Figure 2 A flowchart illustrating a specific implementation of a few-sample crack identification method based on transfer learning, as provided in one embodiment of the present invention; Figure 3 This is a partial sample of the dataset used in a few-sample crack identification method based on transfer learning provided in one embodiment of the present invention; Figure 4 This is a flowchart illustrating the data augmentation process in a few-sample crack identification method based on transfer learning, as provided in one embodiment of the present invention. Figure 5 This is a flowchart of the adaptive crack perception attention module in a few-sample crack identification method based on transfer learning, provided in one embodiment of the present invention. Figure 6 This is a schematic diagram illustrating the attention map and severity score visualization used to interpret crack severity estimation in a few-sample crack identification method based on transfer learning, provided as an embodiment of the present invention. Figure 7The diagram shows the ResNetV2 network structure in a few-sample crack identification method based on transfer learning, as provided in an embodiment of the present invention. Detailed Implementation
[0024] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of the invention. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to the present invention are not shown or described in the specification. This is to avoid obscuring the core parts of the invention with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.
[0025] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.
[0026] The first embodiment of this invention provides a few-sample crack identification method based on transfer learning. The following is in conjunction with... Figure 1 and Figure 2 Please provide a detailed explanation.
[0027] like Figure 1 As shown, in step S100, crack images are acquired, and training and testing sets are constructed.
[0028] The above steps specifically include: like Figure 3 As shown, this example uses images of cracks in brick facades as the dataset. All dataset samples are stored by category, loaded through a code framework, and preprocessed (e.g., normalization) and divided into training and test sets according to a set ratio. The training set is used to fine-tune the model with pre-trained weights, while the test set is used to test the performance of the fine-tuned model. The dataset also provides methods to obtain a batch of images from both the training and test sets after loading, facilitating subsequent network fine-tuning and testing.
[0029] Furthermore, to fundamentally address the background overfitting problem in few-shot learning, this embodiment employs a specific data augmentation technique based on Recurrent Generative Adversarial Networks (CycleGAN). For example... Figure 4 As shown, the specific steps include: a) Construct and train a CycleGAN model containing two generators, G_A2B and G_B2A, and two discriminators, D_A and D_B. Generator G_A2B transforms an image in a crack-free image domain (domain A) into an image in a cracked image domain (domain B), while G_B2A performs the reverse transformation. The generators employ an encoder-decoder structure with multiple residual blocks to preserve image details. b) The network is trained end-to-end using adversarial loss and cycle consistency loss. Cycle consistency loss ensures that the image can be restored to its original state after two transformations (e.g., A->B->A), thus preserving the content information of the original image. c) When expanding the training data, input the crack-free images in the training set into the trained generator G_A2B to generate a batch of synthetic images that retain the original background but add realistic cracks, and add these high-quality synthetic samples to the training set.
[0030] like Figure 1 As shown, in step S200, a crack recognition network model is constructed. The crack recognition network model includes a pre-trained MobileNetV4 backbone network module with an integrated feature-level linear modulation layer, an adaptive crack perception attention module located at the front end of the backbone network module, and a Gaussian Naive Bayes classifier located at the back end of the backbone network module.
[0031] The above steps specifically include: In this embodiment, the crack recognition network model uses a pre-trained MobileNetV4 network adapted with a FiLM layer as the feature extraction backbone, coupled with an adaptive crack perception attention module at the front end and a Gaussian Naive Bayes (GNB) classifier at the back end.
[0032] like Figure 1 As shown, in step S300, the crack image is input to the adaptive crack perception attention module and an attention map is output.
[0033] The above steps specifically include: Adaptive crack perception attention module: as attached Figure 5 As shown, this module is specifically designed to detect the slender geometric features of cracks. Its implementation details are as follows: a) Parallel asymmetric convolution kernels: Multiple sets of convolution kernels are connected in parallel inside the module, including a 1×7 convolution kernel for responding to horizontal cracks, a 7×1 convolution kernel for responding to vertical cracks, and a standard 3×3 convolution kernel, etc., which convolve the input three-channel RGB image to capture linear features of different directions and scales.
[0034] b) Feature fusion and attention map generation: The outputs of the above multiple convolutional kernels are concatenated along the channel dimension and fused through a 1×1 convolutional layer to reduce the multi-channel features to a single-channel preliminary attention map.
[0035] c) Context Modulation: To further improve performance, global feature vectors can be extracted from the ends of the backbone network, and a modulation signal can be generated through a fully connected layer. This signal is then added to the initial attention map to achieve context modulation based on the global content of the image, resulting in the final attention map. The attention modulation parameters are derived from this final attention map.
[0036] like Figure 1 As shown, in step S400, the obtained attention map is used to modulate the original input crack image to generate a modulated image.
[0037] The above steps specifically include: Input signal modulation: The final attention map is passed through another 1×1 projective convolutional layer to restore its channel count to 3, and then the result is multiplied element-wise with the original input RGB image. In this way, the signal intensity of the regions in the original image that the attention module considers to have cracks is enhanced before being fed into the backbone network, achieving effective pre-modulation of the input signal.
[0038] like Figure 1 As shown, in step S500, the modulated image is input to the backbone network module for feature extraction to obtain deep features.
[0039] The above steps specifically include: Backbone network module: The backbone network uses the efficient MobileNetV4 as the basic feature extractor and loads pre-trained weights on large-scale datasets such as ImageNet.
[0040] In certain convolutional blocks of MobileNetV4 (such as the UniversalInvertedBottleneckBlock), feature-level linear modulation (FiLM) layers are integrated. The FiLM layer receives the feature map from the previous layer. and execute The affine transformation operation is performed. The affine transformation parameters γ and β are used as learnable parameters of the model and are optimized during the fine-tuning stage, enabling the backbone network to adaptively adjust the response intensity of its internal feature channels according to specific small-sample crack recognition tasks.
[0041] like Figure 1 As shown, in step S600, the extracted depth features are input into the Gaussian Naive Bayes classifier, and the crack identification result is output.
[0042] The above steps specifically include: Gaussian Naive Bayes (GNB) Classifier: The final deep features extracted from the backbone network are input into the GNB classifier. The GNB classifier is chosen because the deep features generated after modulation by the adaptive crack-aware attention module and the FiLM layer exhibit a more compact, approximately Gaussian distributed cluster structure in the feature space. Compared to traditional linear classifiers, the GNB classifier has fewer parameters and can directly estimate the mean and covariance of the class distribution from the data, making it very suitable for few-shot learning scenarios.
[0043] The crack recognition network model constructed in this embodiment is tested and trained as follows: 1) Model fine-tuning A meta-learning-based episodic training strategy is used to fine-tune the model. The main steps are as follows: a) Task resampling: In each training iteration, a "task" is constructed by randomly sampling from the training set containing the original samples and CycleGAN-generated samples. This task contains a support set and a query set.
[0044] b) Parameter Optimization: The class mean and covariance matrix of the GNB classifier are configured using samples and their features from the support set. Then, the loss is calculated using the query set, and the learnable parameters of the adaptive crack-aware attention module and the affine transformation parameters γ and β of the FiLM layer are jointly optimized via backpropagation. Through sufficient iterations, the model learns the ability to quickly adapt to new tasks.
[0045] 2) Model Function and Evaluation The trained model is used for inference and provides interpretable evaluation results. The main function of the model is to identify cracks. Images from the test set are input into the fine-tuned model, and the output of the GNB classifier is the crack identification result (cracked / no crack).
[0046] like Figure 1 As shown, in step S700, the severity of the identified cracks is assessed based on the crack identification results.
[0047] The above steps specifically include: This embodiment also provides an interpretable crack severity assessment. To provide more engineering-valued output, this embodiment also includes a severity estimation algorithm, the specific steps of which include: a) Extracting attention maps: For images identified as having cracks, obtain their corresponding final attention maps. b) Computational geometric features: i. Threshold the attention map to obtain a binarized crack mask. ii. Area: Directly calculate the number of white pixels in the mask. iii. Length: Calculated using algorithms such as cv2.arcLength on the mask contour. iv. Average Width: This is a crucial and more robust metric. First, a skeletonization algorithm (such as cv2.ximgproc.thinning) is applied to the binary mask to extract the centerline of the crack; then, the distance transform map of the original mask is calculated; finally, the mean of the distance transform values at the centerline pixel location is calculated and multiplied by 2 to obtain the average width of the crack. c) Severity Score Generation and Visualization: Normalized features such as area, length, and average width are weighted and summed according to preset weights (e.g., {Area: 0.4, Length: 0.4, Width: 0.2}) to obtain a quantified severity score ranging from [0, 1]. Simultaneously, the original image, attention heatmap, binary mask, and severity score are visualized side-by-side, providing users with intuitive decision-making support. Figure 6 As shown.
[0048] To compare the performance of the embodiments of this invention with other models, the backbone network was modified using the same framework and dataset as follows: Figure 7 The results were compared with ResNetV2 that introduced the FiLM layer, and the best test results were selected, as shown in the table below: Table 1 Performance under different backbone networks
[0049] MobileNetV4-Patched is an example of this invention. It can be seen that the proposed method has higher evaluation metrics and time efficiency than using ResNetV2 as the backbone network. However, due to the introduction of attention and data augmentation methods, its efficiency is not as high as using MobileNetV4Small as the backbone network. Nevertheless, all metrics demonstrate the high efficiency of this invention example (it is worth noting that the time mentioned in the table refers to the time spent in the fine-tuning stage at iteration number 700 when using different neural networks as the backbone network). This fully demonstrates the effectiveness of the adaptive crack-aware attention module and input signal premodulation mechanism in this invention. This mechanism enhances the crack signal at the input, enabling the subsequent FiLM network to perform feature fitting more efficiently, thereby achieving a synergistic gain effect of 1+1>2.
[0050] Furthermore, MobileNetV4-Patched supports crack severity assessment, with an average predicted severity of 0.57, close to the average true severity of 0.53, and a mean squared error (MSE) of 0.29, indicating relatively accurate severity estimation. Severity assessment calculates weighted scores by extracting geometric features (such as area, length, and width) from the attention map, providing a basis for quantitative analysis of crack hazard levels. This is something the other two models cannot provide, and it outperforms traditional models.
[0051] Therefore, this invention systematically solves the three major challenges of accuracy, generalization, and interpretability in small-sample crack identification by employing a deeply coupled architecture of input signal premodulation and feature-level adaptation, combined with dedicated crack-sensing attention, high-fidelity CycleGAN data augmentation, and interpretability evaluation based on deep geometric analysis. Experimental data demonstrate that the method proposed in this invention significantly outperforms existing technologies in all performance metrics, representing a significant technological advancement in this field.
[0052] Corresponding to the aforementioned method for identifying few-shot cracks based on transfer learning, this invention also discloses a system for identifying few-shot cracks based on transfer learning, which specifically includes: The dataset building module is used to collect crack images and build training and test sets; The model building module is used to build a crack recognition network model, which includes a pre-trained MobileNetV4 backbone network module with a feature-level linear modulation layer, an adaptive crack perception attention module located at the front end of the backbone network module, and a Gaussian Naive Bayes classifier located at the back end of the backbone network module. Crack detection module, used for: The crack image is input into the adaptive crack perception attention module, and the attention map is output. The obtained attention map is used to modulate the original input crack image to generate a modulated image; The modulated image is input into the backbone network module for feature extraction to obtain deep features; The extracted depth features are input into a Gaussian Naive Bayes classifier, which outputs crack identification results. The crack severity assessment module is used to assess the severity of identified cracks based on the crack identification results.
[0053] It should be noted that for a detailed description of the few-sample crack identification system based on transfer learning provided in the embodiments of the present invention, please refer to the relevant description of the few-sample crack identification method based on transfer learning provided in the embodiments of the present invention, which will not be repeated here.
[0054] In addition, embodiments of the present invention also provide an electronic device, the device comprising: a processor and a memory; the memory being used to store one or more program instructions; the processor being used to execute one or more program instructions to perform the steps of a few-sample crack identification method based on transfer learning as described in any of the preceding embodiments.
[0055] It should be noted that for a detailed description of an electronic device provided in the embodiments of the present invention, please refer to the relevant description of a few-sample crack identification method based on transfer learning provided in the embodiments of this application, which will not be repeated here.
[0056] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of a few-sample crack identification method based on transfer learning as described in any of the preceding embodiments.
[0057] It should be noted that for a detailed description of the computer-readable storage medium provided in the embodiments of the present invention, please refer to the relevant description of the small sample crack identification method based on transfer learning provided in the embodiments of this application, which will not be repeated here.
[0058] The above examples illustrate the present invention only to aid in understanding it and are not intended to limit the scope of the invention. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the principles of this invention.
Claims
1. A few-sample crack identification method based on transfer learning, characterized in that, The method includes: Collect crack images and construct training and testing sets; A crack recognition network model is constructed, which includes a pre-trained MobileNetV4 backbone network module with a feature-level linear modulation layer, an adaptive crack perception attention module located at the front end of the backbone network module, and a Gaussian Naive Bayes classifier located at the back end of the backbone network module. The crack image is input into the adaptive crack perception attention module, and the attention map is output. The obtained attention map is used to modulate the original input crack image to generate a modulated image; The modulated image is input into the backbone network module for feature extraction to obtain deep features; The extracted depth features are input into a Gaussian Naive Bayes classifier, which outputs crack identification results. Based on the crack identification results, the severity of the identified cracks is assessed.
2. The few-sample crack identification method based on transfer learning as described in claim 1, characterized in that, Acquire crack images and construct training and testing sets, specifically including: The original crack image samples were preprocessed, and the dataset was divided into training and test sets according to the proportion. The training set was used to fine-tune the model loaded with pre-trained weight parameters, and the test set was used to test the performance of the fine-tuned model.
3. The few-sample crack identification method based on transfer learning as described in claim 2, characterized in that, Acquire crack images and construct training and testing sets, specifically including: Data augmentation is performed on the constructed recurrent generative adversarial network model to expand the training set data; The recurrent generative adversarial network model includes two generators, G_A2B and G_B2A, and two discriminators, D_A and D_B. Generator G_A2B is used to transform an image in a crack-free image domain into an image in a cracked image domain, while generator G_B2A performs the opposite transformation to G_A2B. The network model is trained end-to-end using adversarial loss and recurrent consistency loss. When expanding the training data, crack-free images from the training set are input into the trained generator G_A2B to generate a batch of synthetic images that retain the original background but have realistic cracks added. The resulting synthetic image samples are then added to the training set.
4. The few-sample crack identification method based on transfer learning as described in claim 1, characterized in that, The crack image is input into the adaptive crack-aware attention module, and the output attention map includes: The adaptive crack perception attention module includes multiple parallel asymmetric convolutional kernels, a fusion convolutional layer, and a context modulation module. The multiple parallel asymmetric convolutional kernels are used to capture linear crack features in different directions from the input multi-channel image, including a 1×N convolutional kernel for detecting horizontal cracks, an N×1 convolutional kernel for detecting vertical cracks, and an oblique convolutional kernel for detecting cracks at different angles. The fusion convolutional layer is used to fuse the output features of the multiple asymmetric convolutional kernels and generate a preliminary attention map. The context modulation module is used to utilize the global context features output by the backbone network module to modulate the preliminary attention map through a fully connected layer to generate the final attention map.
5. The few-sample crack identification method based on transfer learning as described in claim 4, characterized in that, The obtained attention map is used to modulate the original input crack image to generate a modulated image, specifically including: The final attention map is restored to the original image channel number through a projection convolutional layer. Then, the output is multiplied element-wise with the original input crack image to obtain the modulated image.
6. The few-sample crack identification method based on transfer learning as described in claim 1, characterized in that, The modulated image is input into the backbone network module for feature extraction to obtain deep features, specifically including: The backbone network module uses MobileNetV4 as the basic feature extractor and loads it into pre-trained weights; feature-level linear modulation layers are integrated into specific convolutional blocks of MobileNetV4; the feature-level linear modulation layers receive the input feature maps from the previous layer. and execute the output feature map The affine transformation operation; the affine transformation parameters γ and β are used as learnable parameters of the model and are optimized during the fine-tuning stage.
7. The few-sample crack identification method based on transfer learning as described in claim 6, characterized in that, A staged training method based on meta-learning is used to fine-tune the model, including: In each iteration, the support set and query set are obtained by resampling from the training set; Configure the class mean and covariance matrix of the Gaussian Naive Bayes classifier using the support set of samples and their deep features; The classification loss and severity assessment loss are calculated using the query set, and the parameters of the adaptive crack perception attention module and the affine transformation parameters γ and β of the feature-level linear modulation layer in the backbone network module are jointly optimized by backpropagation.
8. The method for identifying small-sample cracks based on transfer learning as described in claim 1, characterized in that, Based on the crack identification results, the severity of the identified cracks is assessed, specifically including: For images identified as having cracks, extract their corresponding attention maps; The extracted attention map is thresholded to obtain a binary mask of the crack; The binary mask of the crack is skeletonized, and the average width of the crack is estimated by calculating the mean of the distance transformation on the skeleton pixels. Calculate the area and length of cracks using a binary mask based on the cracks; The final crack severity score is obtained by weighted summation of the crack area, length, and average width.
9. A few-sample crack identification system based on transfer learning, characterized in that, The system includes: The dataset building module is used to collect crack images and build training and test sets; The model building module is used to build a crack recognition network model, which includes a pre-trained MobileNetV4 backbone network module with a feature-level linear modulation layer, an adaptive crack perception attention module located at the front end of the backbone network module, and a Gaussian Naive Bayes classifier located at the back end of the backbone network module. Crack detection module, used for: The crack image is input into the adaptive crack perception attention module, and the attention map is output. The obtained attention map is used to modulate the original input crack image to generate a modulated image; The modulated image is input into the backbone network module for feature extraction to obtain deep features; The extracted depth features are input into a Gaussian Naive Bayes classifier, which outputs crack identification results. The crack severity assessment module is used to assess the severity of identified cracks based on the crack identification results.
10. An electronic device, characterized in that, The device includes: a processor and a memory; The memory is used to store one or more program instructions; The processor is configured to run one or more program instructions to perform the steps of a few-sample crack identification method based on transfer learning as described in any one of claims 1 to 8.
Citation Information
Cited By
Engineering structure crack intelligent identification method and system
CN122176534A
Intelligent identification method and system for cracks of engineering structures
CN122176534B
