Carbon fiber composite material microcrack image segmentation method based on two-stage super-resolution dynamic attention network

By combining a two-stage super-resolution dynamic attention network with image preprocessing and deep learning, the problems of low computational complexity and low recognition rate in microcrack detection of carbon fiber composite materials are solved, and efficient and accurate microcrack segmentation is achieved.

CN121190768APending Publication Date: 2025-12-23DALIAN MARITIME UNIVERSITY

Patent Information

Application Number
CN202511391901.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

Existing technologies for detecting microcracks in carbon fiber composites suffer from high computational complexity, low microcrack recognition rate, and high rates of missed and false detections. In particular, it is difficult to achieve high-precision and high-efficiency microcrack segmentation in complex environments.

Method used

A method based on a two-stage super-resolution dynamic attention network is adopted, which combines image preprocessing, multi-scale sliding window scanning, morphological transformation, super-resolution reconstruction and convolutional neural network to achieve high-precision and efficient detection of microcracks.

Benefits of technology

It significantly improves the detection rate of extremely fine cracks, reduces the rate of missed and false detections, and improves processing efficiency. It is suitable for microcrack segmentation in complex noise backgrounds and has good practicality and protectability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121190768A_ABST
    Figure CN121190768A_ABST
Patent Text Reader

Abstract

The invention provides a carbon fiber composite material microcrack image segmentation method based on a two-stage super-resolution dynamic attention network, and the method comprises the steps: collecting a microscopic image of a to-be-detected carbon fiber composite material, and carrying out the preprocessing of the image, so as to improve the discrimination between a crack and a background; scanning the preprocessed image by adopting a multi-scale sliding window, carrying out microcrack feature extraction in combination with morphological Top-hat transformation, and positioning a candidate region with microcracks; cutting an image corresponding to the candidate region into sub-images, inputting the sub-images into a pre-trained super-resolution reconstruction network, and amplifying the sub-images to 2-8 times of the original size to obtain a high-resolution candidate region image; inputting the super-resolution enhanced candidate region image into a pre-trained convolutional neural network model for pixel-level crack segmentation to obtain a segmentation result of cracks in the candidate region; and mapping the segmented micro-crack region back to an original image coordinate system, marking the position and shape of the crack on the original image, and outputting a final micro-crack segmentation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of composite material structure detection technology, and more particularly to a method for microcrack image segmentation of carbon fiber composite materials based on a two-stage super-resolution dynamic attention network. Background Technology

[0002] Carbon fiber reinforced composites, due to their excellent properties such as lightweight, high strength, and fatigue resistance, have been widely used in aerospace, automotive manufacturing, and wind power. However, during manufacturing and service, these composites are prone to developing hidden damage such as microcracks. These microcracks gradually expand under load and environmental influences, reducing the material's mechanical properties and even leading to structural failure and safety accidents. Therefore, accurate detection and segmentation of microcracks within composite materials are of great significance.

[0003] Existing methods for detecting cracks in composite materials mainly fall into two categories: signal-based non-destructive testing and image-based recognition. Traditional image processing methods (such as thresholding, edge detection, and morphological analysis) can detect cracks to some extent, but due to the small size, irregular shape, and complex background texture of cracks in composite material microscopic images, these methods often struggle to balance accuracy and reliability. For example, simple thresholding can easily misclassify noise as cracks, and morphological algorithms with fixed structural elements are ill-suited to the irregular shapes of cracks; algorithms based on manual feature extraction (such as SVM classification and Random Forest) are not highly sensitive to small cracks and are easily affected by uneven image grayscale.

[0004] In recent years, deep learning has demonstrated outstanding performance in image segmentation. For example, the classic U-Net network and its improved models (U-Net++, SegNet, etc.) have been used for segmenting defects or cracks in composite materials. However, these single-stage segmentation networks still have shortcomings when applied to microcrack detection: on the one hand, to identify extremely small cracks, very high image resolution and deep features are required, which leads to high computational complexity and makes real-time application difficult; on the other hand, the subtle features of microcracks are easily lost during network downsampling, and ordinary convolutional networks struggle to capture the long and irregular shapes of cracks, easily resulting in missed detections or incomplete segmentation. In addition, most existing methods directly segment the entire image, which is inefficient for locating microcracks with pixel-level precision.

[0005] A search of existing technologies revealed that Chinese invention patent CN117132553A discloses a method for detecting surface defects in composite materials based on an improved SegNet network. This method improves segmentation accuracy by replacing SegNet's unpooling upsampling with bilinear interpolation, adding skip connections between the encoder and decoder, and introducing multi-scale semantic fusion. However, for fine cracks in complex backgrounds, this single segmentation network still suffers from low microcrack recognition rates. Furthermore, when the training data exhibits class imbalance or distribution variations, a single model struggles to fully learn all defect patterns, resulting in limited generalization performance. Therefore, existing technologies still fall short in terms of accuracy and robustness in fine-grained microcrack segmentation.

[0006] In summary, there is an urgent need for a new microcrack image segmentation method that can integrate image enhancement and deep learning techniques to improve the accuracy of microcrack recognition while taking into account computational efficiency, so as to overcome the shortcomings of existing technologies. Summary of the Invention

[0007] To address the aforementioned technical problems, this invention provides a method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network. This invention combines the advantages of image preprocessing and deep neural network segmentation, and by introducing dynamic attention mechanisms, deformable convolution, and super-resolution reconstruction, achieves high-precision and high-efficiency detection and segmentation of microcracks in CFRP composite materials, demonstrating good practicality and protectability.

[0008] The technical means employed in this invention are as follows: A method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network includes: S1. Acquire microscopic images of the carbon fiber composite material to be tested and preprocess the images to improve the distinction between cracks and background. S2. The preprocessed image is scanned using a multi-scale sliding window, and microcrack features are extracted by combining morphological Top-hat transformation to locate candidate regions where microcracks exist. S3. The image corresponding to the candidate region is cropped into a sub-image and input into a pre-trained super-resolution reconstruction network to be enlarged to 2 to 8 times the original size to obtain a high-resolution candidate region image. S4. Input the candidate region image enhanced by super-resolution into a pre-trained convolutional neural network model to perform pixel-level crack segmentation, and obtain the segmentation result of the crack in the candidate region. S5. Map the segmented microcrack regions back to the original image coordinate system, mark the crack location and shape on the original image, and output the final microcrack segmentation result.

[0009] Further, step S1 includes: S11. Acquire microscopic images of composite materials containing microcracks; S12. Denoising is performed on the composite material microscopic images acquired in step S11. Denoising is performed on the grayscale images. Gaussian filtering is performed using the following formula:

[0010] in, This represents the image after denoising. The standard deviation is Gaussian kernel, ; Window radius ; S13. Perform grayscale normalization on the denoised composite material microscopic image. Grayscale normalization is to linearly map the denoised pixel values ​​to... The interval, after removing brightness deviations under different acquisition conditions, is calculated using the following formula:

[0011] in, This represents the image after grayscale normalization. This represents the minimum grayscale value of the denoised image. This represents the maximum grayscale value of the denoised image.

[0012] S14. Perform contrast enhancement on the normalized composite material microscopic image. The contrast enhancement is performed using histogram equalization, mapping the normalized pixel intensity to new values, as follows:

[0013] in, For gray levels, The pixel intensity is The probability, This represents the number of pixels at that gray level. This represents the total number of pixels.

[0014] Further, step S2 includes: S21. Perform a white top-hat transformation on the image to obtain the preprocessed grayscale image. With structural elements Perform a morphological opening operation and then subtract it from the original image to highlight the fine bright lines (cracks). The formula is as follows:

[0015] in, This represents the image after the white cap transformation; Indicates the opening operation; ;function and These represent corrosion and expansion, respectively. S22. Slide the detection of highlighted connected regions under different scale windows as candidate regions for microcracks, and represent each candidate region with a bounding box; S23. Non-Maximum Suppression (NMS) is used to remove overlapping candidate regions to ensure that each crack corresponds to a unique candidate region.

[0016] Further, in step S23, all candidate boxes are sorted according to confidence level, and the box with the highest score is retained while other boxes with high overlap with it are suppressed to remove redundant boxes, including: After sorting all candidate boxes in descending order of score, each box is retained one by one, while boxes with excessive overlap with the retained boxes are suppressed. Given two boxes... and ,by Using area as the denominator, define the overlap ratio of the two boxes as follows:

[0017] in, Represents two boxes and The overlap rate, if Then inhibit The area; Candidate boxes and The area of ​​the intersection region; Candidate boxes ; This represents the overlap rate threshold for nonmaximum suppression.

[0018] Furthermore, in step S3, the super-resolution reconstruction network is a model with a generative adversarial network (GAN) structure, which performs edge sharpening and detail enhancement on the obtained high-resolution candidate region image to improve the clarity of microcrack details.

[0019] Further, in step S4, the convolutional neural network model adopts an encoder-decoder structure, containing multiple encoding convolutional layers and decoding convolutional layers, wherein: The encoder contains multiple deformable convolutional layers to extract microcrack features with a kernel size of 3×3 and adapts to the crack shape by learning an offset; The decoder reconstructs the image by fusing multi-scale features from the encoder through skip connections and outputs a crack segmentation map with the same size as the candidate region image.

[0020] Furthermore, the convolutional neural network includes a deformable convolutional module and a dynamic attention mechanism module, wherein: The deformable convolution module introduces a learnable sampling offset, enabling the convolution kernel to align with the slender shape of the microcrack based on the deformation of the input features, thereby improving the feature extraction capability for irregular cracks. The calculation formula is as follows:

[0021] in, Indicates position Output feature value at; For the first k Individual core weights; This indicates the position of the output pixel. For the first The relative offset of each core point on the standard grid; The deformable offset learned by the network; The dynamic attention mechanism module includes a channel attention submodule and a spatial attention submodule. The channel attention submodule performs compression-excitation processing on the sub-convolutional feature map to adaptively adjust the weights of each channel. The spatial attention submodule generates a spatial weight mask by convolving the feature map to highlight the location of the microcrack, thereby realizing the dynamic weighted fusion of the high and low layer features of the encoder.

[0022] Furthermore, in the dynamic attention mechanism module: For the input feature map Global average pooling is performed along the spatial dimension to obtain the global description vector for each channel, as follows:

[0023] in, Represents the global description vector for each channel; Represents the input feature map; Indicates altitude; Indicates width; Indicates the number of channels; Global description vector The channel weight coefficients are generated by performing two layers of dimensionality reduction to dimensionality increase mapping and applying ReLU and Sigmoid activations respectively. ,as follows:

[0024] Among them, matrix Used to compress the number of channels to ReLU activation function Introducing nonlinearity, then by Restore to the original channel dimension and use the Sigmoid function. Limit the output to the range [0,1]. The original feature map is recalibrated channel-by-channel using the generated channel weights, as follows:

[0025] in, Feature map representing channel-by-channel recalibration; Indicates the channel weight coefficient; A spatial attention mechanism is introduced, which uses convolution to extract spatial weight maps of feature maps to enhance the response at the crack location. By fusing attention at both the channel and spatial levels, dynamic weighting of features at different levels is achieved, thereby strengthening the expression of fine crack features. Encoder features and decoder features First, perform 1×1 mappings on each component, then add them together, then perform ReLU, and finally use Sigmoid to generate a spatial attention map. M The formula is as follows:

[0026]

[0027]

[0028] in, This represents the intermediate feature map after fusion; Indicate encoder features; Indicate decoder features; Indicates the convolution weights corresponding to the encoder features; This represents the convolution weights corresponding to the decoder features; Represents a spatial attention map; Indicates standard deviation; Represents the convolution weights used to generate spatial attention; This represents the feature map output by the encoder; This represents the convolution operation; This indicates element-wise multiplication.

[0029] Furthermore, the convolution operation part of the convolutional neural network model uses depthwise separable convolution instead of conventional convolution to reduce model parameters and computational cost, wherein: Depthwise separable convolution first performs spatial convolution on each channel independently, and then... Convolution is used for channel blending; Each input channel Its dedicated convolution kernel Convolution outputs feature maps of the same channel. :

[0030] in, Indicates channel The Each convolutional kernel weight; Indicates the vertical position index of the output feature map; This indicates the vertical offset index of the convolution kernel; Indicates the size of the convolution kernel; Indicates the horizontal position index of the output feature map; This indicates the horizontal offset index of the convolution kernel.

[0031] Mix all C depthwise outputs according to their weights to obtain C' output channels:

[0032] in, This indicates that pointwise convolution occurs in the input channel. and output channels The weights between them.

[0033] Then perform batch normalization and activation:

[0034] in, Indicates output channel In position eigenvalues; This indicates batch normalization operation.

[0035] Furthermore, the convolutional neural network model is trained using a labeled crack image dataset, which includes microcrack sample images of different regions, sizes, and shapes, along with their pixel-level annotations. During training, a weighted combination of cross-entropy loss and Dice loss is used as the objective function, and the Adam optimization algorithm is used to adjust the model parameters.

[0036] Compared with the prior art, the present invention has the following advantages: The two-stage framework of this invention combines macroscopic detection with fine segmentation, first coarsely locating and then precisely segmenting, avoiding the computational overhead of directly processing the entire large image at high resolution, thus greatly improving processing efficiency; at the same time, by using super-resolution enhancement and attention mechanisms, it significantly improves the detection rate of extremely fine cracks and reduces the rate of missed detection and false detection.

[0037] Therefore, the method of the present invention can still achieve excellent microcrack segmentation effect under complex noise background, which has significant technical progress and practical value. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a flowchart of the method of the present invention.

[0040] Figure 2 This is a prestressing loading device for conducting tests provided in one embodiment of the present invention; Figure 3 This is a detailed process diagram of a test specimen processing according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a deep convolutional neural network architecture provided by an embodiment of the present invention, illustrating the integration of the encoder-decoder structure, deformable convolutional module, and dynamic attention module; Figure 5 This invention provides a dynamic attention module for fusing high-dimensional and low-dimensional information in an image. Figure 6 This is a flowchart of an improved selective search algorithm provided in an embodiment of the present invention; Figure 7 This is a comparison chart of the average intersection-union ratio (mIoU) of the segmentation evaluation index between the method of this invention and existing general segmentation methods. Detailed Implementation

[0041] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0042] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products or devices.

[0043] like Figure 1As shown, this invention provides a method for microcrack image segmentation of carbon fiber composite materials based on a two-stage super-resolution dynamic attention network, comprising: S1. Acquire microscopic images of the carbon fiber composite material to be tested and preprocess the images to improve the distinction between cracks and background. S2. The preprocessed image is scanned using a multi-scale sliding window, and microcrack features are extracted by combining morphological Top-hat transformation to locate candidate regions where microcracks exist. S3. The image corresponding to the candidate region is cropped into a sub-image and input into a pre-trained super-resolution reconstruction network to be enlarged to 2 to 8 times the original size to obtain a high-resolution candidate region image. S4. Input the candidate region image enhanced by super-resolution into a pre-trained convolutional neural network model to perform pixel-level crack segmentation, and obtain the segmentation result of the crack in the candidate region. S5. Map the segmented microcrack regions back to the original image coordinate system, mark the crack location and shape on the original image, and output the final microcrack segmentation result.

[0044] In a specific implementation, as a preferred embodiment of the present invention, step S1 includes: S11. Acquire microscopic images of composite materials containing microcracks; S12. Denoising is performed on the composite material microscopic images acquired in step S11. Denoising is performed on the grayscale images. Gaussian filtering is performed using the following formula:

[0045] in, This represents the image after denoising. The standard deviation is Gaussian kernel, ; Window radius ; S13. Perform grayscale normalization on the denoised composite material microscopic image. Grayscale normalization is to linearly map the denoised pixel values ​​to... The interval, after removing brightness deviations under different acquisition conditions, is calculated using the following formula:

[0046] in, This represents the image after grayscale normalization. This represents the minimum grayscale value of the denoised image. This represents the maximum grayscale value of the denoised image.

[0047] S14. Perform contrast enhancement on the normalized composite material microscopic image. The contrast enhancement is performed using histogram equalization, mapping the normalized pixel intensity to new values, as follows:

[0048] in, The grayscale level is typically 256. The pixel intensity is The probability, This represents the number of pixels at that gray level. This represents the total number of pixels.

[0049] In a specific implementation, as a preferred embodiment of the present invention, step S2 includes: S21. Perform a white top-hat transformation on the image to obtain the preprocessed grayscale image. With structural elements Perform a morphological opening operation and then subtract it from the original image to highlight the fine bright lines (cracks). The formula is as follows:

[0050] in, This represents the image after the white cap transformation; Indicates the opening operation; ;function and These represent corrosion and expansion, respectively. S22. Slide the detection of highlighted connected regions under different scale windows as candidate regions for microcracks, and represent each candidate region with a bounding box; S23. Non-Maximum Suppression (NMS) is used to remove overlapping candidate regions to ensure that each crack corresponds to a unique candidate region.

[0051] In a specific implementation, as a preferred embodiment of the present invention, step S23 involves sorting all candidate boxes according to confidence levels, retaining the box with the highest score, and suppressing other boxes with high overlap with it to remove redundant boxes, including: After sorting all candidate boxes in descending order of score, each box is retained one by one, while boxes with excessive overlap with the retained boxes are suppressed. Given two boxes... and ,by Using area as the denominator, define the overlap ratio of the two boxes as follows:

[0052] in, Represents two boxes and The overlap rate, if Then inhibit ; Candidate boxes and The area of ​​the intersection region; Candidate boxes ; This represents the overlap rate threshold for nonmaximum suppression.

[0053] In a specific implementation, as a preferred embodiment of the present invention, in step S3, the super-resolution reconstruction network is a model with a generative adversarial network (GAN) structure, which performs edge sharpening and detail enhancement on the obtained high-resolution candidate region image to improve the clarity of microcrack details.

[0054] In a specific implementation, as a preferred embodiment of the present invention, in step S4, the convolutional neural network model adopts an encoder-decoder structure, comprising multiple encoding convolutional layers and decoding convolutional layers, wherein: The encoder contains multiple deformable convolutional layers to extract microcrack features with a kernel size of 3×3 and adapts to the crack shape by learning an offset; The decoder reconstructs the image by fusing multi-scale features from the encoder through skip connections and outputs a crack segmentation map with the same size as the candidate region image.

[0055] In a specific implementation, as a preferred embodiment of the present invention, the convolutional neural network includes a deformable convolution module and a dynamic attention mechanism module, wherein: The deformable convolution module introduces a learnable sampling offset, enabling the convolution kernel to align with the slender shape of the microcrack based on the deformation of the input features, thereby improving the feature extraction capability for irregular cracks. The calculation formula is as follows:

[0056] in, Indicates position Output feature value at; For the first k Individual core weights; This indicates the position of the output pixel. For the first The relative offset of each core point on the standard grid; The deformable offset learned by the network; The dynamic attention mechanism module includes a channel attention submodule and a spatial attention submodule. The channel attention submodule performs compression-excitation processing on the sub-convolutional feature map to adaptively adjust the weights of each channel. The spatial attention submodule generates a spatial weight mask by convolving the feature map to highlight the location of the microcrack, thereby realizing the dynamic weighted fusion of the high and low layer features of the encoder.

[0057] In a specific implementation, as a preferred embodiment of the present invention, in the dynamic attention mechanism module: For the input feature map Global average pooling is performed along the spatial dimension to obtain the global description vector for each channel, as follows:

[0058] in, Represents the global description vector for each channel; Represents the input feature map; Indicates altitude; Indicates width; Indicates the number of channels; Global description vector The channel weight coefficients are generated by performing two layers of dimensionality reduction to dimensionality increase mapping and applying ReLU and Sigmoid activations respectively. ,as follows:

[0059] Among them, matrix Used to compress the number of channels to ReLU activation function Introducing nonlinearity, then by Restore to the original channel dimension and use the Sigmoid function. Limit the output to the range [0,1]. The original feature map is recalibrated channel-by-channel using the generated channel weights, as follows:

[0060] in, Feature map representing channel-by-channel recalibration; Indicates the channel weight coefficient; A spatial attention mechanism is introduced, which uses convolution to extract spatial weight maps of feature maps to enhance the response at the crack location. By fusing attention at both the channel and spatial levels, dynamic weighting of features at different levels is achieved, thereby strengthening the expression of fine crack features. Encoder features and decoder features First, perform 1×1 mappings on each component, then add them together, then perform ReLU, and finally use Sigmoid to generate a spatial attention map. M The formula is as follows:

[0061]

[0062]

[0063] in, This represents the intermediate feature map after fusion; Indicate encoder features; Indicate decoder features; Indicates the convolution weights corresponding to the encoder features; This represents the convolution weights corresponding to the decoder features; Represents a spatial attention map; Indicates standard deviation; Represents the convolution weights used to generate spatial attention; This represents the feature map output by the encoder; This represents the convolution operation; This indicates element-wise multiplication.

[0064] In a specific implementation, as a preferred embodiment of the present invention, the convolution operation part of the convolutional neural network model uses depthwise separable convolution instead of conventional convolution to reduce model parameters and computational load, wherein: Depthwise separable convolution first performs independent spatial convolution (depthwise) on each channel, and then... Convolution performs pointwise channel blending. Each input channel Its dedicated convolution kernel Convolution outputs feature maps of the same channel. :

[0065] in, Indicates channel The Each convolutional kernel weight; Indicates the vertical position index of the output feature map; This indicates the vertical offset index of the convolution kernel; Indicates the size of the convolution kernel; Indicates the horizontal position index of the output feature map; This indicates the horizontal offset index of the convolution kernel.

[0066] Mix all C depthwise outputs according to their weights to obtain C' output channels:

[0067] in, This indicates that pointwise convolution occurs in the input channel. and output channels The weights between them.

[0068] Then perform batch normalization and activation:

[0069] in, Indicates output channel In position eigenvalues; This indicates batch normalization operation.

[0070] In this embodiment, compared to an equivalent standard convolutional network, the number of parameters is reduced by at least 20%, thereby meeting the requirements for real-time segmentation of high-resolution crack images. The convolutional layers of the network in this invention preferably use depthwise separable convolutions instead of traditional convolutions to significantly reduce the number of parameters and computational load, thereby improving model inference speed. Through the above design, the segmentation network of this invention achieves lightweight modeling while maintaining accuracy, making it suitable for real-time processing of high-resolution crack images.

[0071] In a specific implementation, as a preferred embodiment of the present invention, the convolutional neural network model is trained using a labeled crack image dataset. The training dataset includes microcrack sample images of different regions, sizes, and shapes, along with their pixel-level annotations. During training, a weighted combination of cross-entropy loss and Dice loss is used as the objective function, and the Adam optimization algorithm is used to adjust the model parameters.

[0072] Example Step 1: Image Acquisition and Preprocessing The composite material system used in this embodiment is T700 carbon fiber reinforced epoxy resin matrix composite material, and the layup method of the test specimen is as follows: Orthogonal layup, with thickness designed according to different requirements, utilizes vacuum bag forming technology to prepare composite laminates. For example... Figure 2 As shown, to achieve prestressing loading, the test specimen was designed in a dumbbell shape with a total thickness of approximately 3 mm. Before conducting low-temperature cyclic tests on composite material specimens considering prestress, the specimens need to undergo certain treatments to improve the accuracy of the test data. The specific treatment process and some test steps are as follows: Figure 3 As shown.

[0073] Microscopic image data of the composite material to be tested is acquired as the raw image. For example, high-resolution images of the internal cross-section of a CFRP composite material sample are acquired using CT scanning. In this embodiment, approximately... The image is then preprocessed to improve the discernibility of the microcracks. Specific preprocessing steps include, but are not limited to: image denoising (e.g., using median filtering or Gaussian filtering to remove background noise), grayscale normalization (to even out the distribution of image pixel values), and contrast enhancement (e.g., using histogram equalization or stretching to improve the contrast between the cracks and the background). Furthermore, a morphological white-hat transform is applied to highlight fine linear areas in the image that are brighter than the surrounding background. The size of the structuring element used in the white-hat transform is selected based on the typical width of the crack, for example, preferably... In this embodiment, a circular structural element with a diameter of 5 pixels is used to enhance bright, thin lines (potentially cracks) with a width smaller than this size. After the above preprocessing, micro-cracks in the image will appear as relatively prominent bright lines, while most of the uneven background will be suppressed.

[0074] Step 2: Extraction of candidate regions for microcracks The preprocessed image is input into the candidate region extraction module. First, based on features such as crack image texture and grayscale, small regions are generated for selective searching. Figure 4 The flowchart shown is for the improved selective search algorithm. It initially locates the crack region, and then uses a multi-scale sliding window scan to locate areas where cracks may exist. Specifically, in... Figure 1 In the candidate extraction units shown, different sizes (32) are set. 32 to 128 A sliding window of 128 pixels (two sizes are selected in this embodiment: 10...) 10 and 20 A 20-pixel window is slid across the image pixel by pixel. For each window region, the distribution characteristics of the bright pixels in the image after the white-hat transform are calculated. If there are continuous bright line segments within the window and the brightness exceeds a preset threshold, the corresponding region of the window is determined to contain micro-cracks. The threshold can be adaptively set according to the image grayscale histogram, preferably 1.5 times the average grayscale of the window. 3 times or 40 times the global maximum grayscale 60 In this embodiment, the threshold is selected as twice the average gray level of the current window or 50% of the maximum global gray level of the image. To ensure sufficient detection of weak crack signals, scanning with windows of different scales can detect cracks of different lengths and orientations: small windows detect short, fine cracks, while large windows capture the entirety of longer cracks. During the scanning process, to enhance the identification of crack continuity, this invention also employs a neighborhood connectivity enhancement algorithm: if adjacent windows on the same straight line are both determined to contain crack features, these windows are merged into a longer candidate crack region, ensuring that only one candidate region is generated for a long crack spanning multiple windows. This neighborhood enhancement processing along the crack orientation helps maintain crack integrity. After step 2, several micro-crack candidate regions are output, each represented by its bounding box coordinates in the original image. For overlapping or closely spaced candidate boxes, non-maximum suppression (NMS) can be used for optimization and merging to avoid duplicate detection. Through candidate extraction, rapid coarse localization of micro-crack locations is achieved, improving the efficiency of subsequent processing.

[0075] Step 3: Super-resolution reconstruction of candidate regions For each candidate region obtained in step 2, a sub-image of that region is cropped from the original image. Since the original microcracks may be extremely small and have blurred edges, this step performs super-resolution enhancement processing on the candidate sub-images to improve segmentation accuracy. The super-resolution reconstruction unit inputs the candidate region sub-image into a pre-trained generative adversarial network (GAN) super-resolution model for upscaling. The ESRGAN (Enhanced Generative Adversarial Network for Super-Resolution) model is used to upscale the image to four times its original size. Alternatively, upscaling by 2 times can be chosen as needed. Any multiple within the range of 8x. In this embodiment, each candidate region sub-image is magnified by 2x using ESRGAN. 4 times, outputting a high-resolution image size of approximately 256. 256 pixels. Super-resolution reconstruction effectively improves the clarity of microcracks in the candidate region, making cracks that were originally only a few pixels wide become wider and clearer, thus providing richer detail information for subsequent fine segmentation.

[0076] Step 4: Deep Learning-Based Fine Segmentation of Microcracks The candidate regions, after being enhanced by super-resolution, are sequentially fed into a deep convolutional neural network model for pixel-level crack segmentation and judgment. Figure 5 A schematic embodiment of the neural network architecture described in this invention is shown. This network adopts an encoder-decoder structure, similar to the U-Net framework, but introduces modules such as deformable convolution and dynamic attention mechanisms in key layers to improve the performance of microcrack recognition.

[0077] Specifically, the encoder extracts features step-by-step from multiple convolutional blocks. Each convolutional block includes a deformable convolutional layer and an activation layer, with the deformable convolutional kernel size preferably being 3. 3. The sampling point positions are learned and adjusted by the network based on the crack shape, thus focusing on the slender morphological features of the crack. To control model complexity, some convolutional layers use depthwise separable convolution instead of conventional convolution, that is, each channel is convolved separately before being passed through a 1-channel convolution. 1. Convolutional fusion channel information, with an equivalent convolutional kernel size of 3. 3 or 5 5 (This embodiment uses 3) 3) This significantly reduces the number of parameters and computational cost. Each layer of the encoder is followed by pooling downsampling to extract high-level semantics, but considering that microcracks are detailed information, the downsampling factor is reduced in the last two layers of the encoder, and only convolutions with a stride of 1 are used to preserve spatial resolution.

[0078] In the decoder section, to reconstruct a detailed segmentation map, convolutional blocks symmetrical to the encoder are used for progressive upsampling, and shallow features from the encoder are fused (skip connections). A dynamic attention mechanism module is inserted into the middle and final layers of the decoder to fuse multi-scale features and highlight crack regions. The attention module in this embodiment includes two sub-modules: channel attention and spatial attention. First, channel attention utilizes the Squeeze-and-Excitation (SE) mechanism to generate a compressed representation by globally averaging pooling each channel of the current feature map in the decoder. Channel weight coefficients are learned through a two-layer fully connected network, and the channel amplitudes of the feature map are then recalibrated according to these weights, thereby enhancing crack-related feature channels and suppressing irrelevant channels.

[0079] Then as Figure 6 As shown, after completing channel transformation and feature fusion, spatial attention is directly applied to the fused feature map: firstly, through a 1 1. Convolution generates a single-channel response map of the same size as the fused features, which is then mapped by a Sigmoid algorithm to obtain a spatial attention mask (size 1). Finally, the mask is multiplied element-wise with the fused features to highlight the spatial location of the crack in the image. Channel transformation, feature fusion, and spatial weight generation are tightly coupled, enabling dynamic and adaptive adjustment of the attention to different levels of features and spatial regions based on the content of the input image, achieving a true "dynamic attention" mechanism.

[0080] For example, in areas with complex textures, the attention module automatically increases the weight of crack details, making it easier for the network to distinguish cracks from the background. Finally, the decoder output layer uses a single 1-layer... The convolutional layer maps the features to a two-dimensional segmentation result, resulting in a binary segmentation map of the same size as the input candidate region, where a pixel value of 1 represents a crack and 0 represents the background. For network training, this embodiment uses a combined loss function (a weighted sum of cross-entropy loss and Dice coefficient loss) to improve the segmentation effect of imbalanced data between crack regions and background. The optimization algorithm used is Adam, with an initial learning rate of 0.001, and convergence after approximately 160 training iterations.

[0081] Step 5: Results Integration and Output In each microcrack candidate sub-image generated in step 4, a U-Net network incorporating deformable convolution is used for pixel-level crack segmentation. After training and validation, a binary crack mask for each sub-image is obtained and precisely superimposed according to the coordinates of the original image, realizing the visualization of the segmentation result in the corresponding region of the entire image. The input image and the corresponding segmentation output are clearly aligned, and the crack boundaries are accurate and coherent. The final output includes a complete crack segmentation map covering the original high-resolution image, a set of binary crack masks for each candidate region, and network performance indicators and training curves (training loss and validation set MIoU trends with Epoch), thereby verifying the stability and accuracy of the model in microcrack extraction and providing quantitative basis for subsequent algorithm optimization and damage evolution research. In this embodiment, when merging and labeling the segmentation results of multiple candidate regions on the original image, discrete noise regions with an area of ​​less than 20 pixels are filtered out, and adjacent crack regions with a distance of less than 5 pixels are connected and repaired to obtain a coherent and clean final microcrack segmentation result.

[0082] Through the above implementation steps, this invention achieves automatic and high-precision segmentation of microcracks in composite materials. In practical applications, this method demonstrates superior performance compared to existing solutions. For example, on a certain composite material micro-damage dataset, the method of this invention increases the Dice coefficient of the microcracks to 87.83. It outperformed the U-net model, which did not employ a two-stage process and attention mechanism, by approximately 11%. Meanwhile, morphological preprocessing was performed to filter out most of the background noise. Figure 7 The comparison between the method of this invention and the traditional U-Net segmentation results shows that the method of this invention is significantly superior to the prior art in terms of both completeness and accuracy of microcrack identification. Furthermore, thanks to the two-stage processing that restricts high-resolution segmentation to a small region and the application of depthwise separable convolution, the method meets the needs of efficient detection in practical engineering.

[0083] In summary, the microcrack image segmentation method provided by this invention breaks through the bottleneck of traditional methods in microcrack detection through the innovative integration of image enhancement, candidate localization, and fine segmentation using deep networks. It can automatically and quickly identify minute cracks from composite material microscopic images without human intervention, and has significant engineering application value.

[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network, characterized in that, include: S1. Acquire microscopic images of the carbon fiber composite material to be tested and preprocess the images to improve the distinction between cracks and background. S2. The preprocessed image is scanned using a multi-scale sliding window, and microcrack features are extracted by combining morphological Top-hat transformation to locate candidate regions where microcracks exist. S3. The image corresponding to the candidate region is cropped into a sub-image and input into a pre-trained super-resolution reconstruction network to be enlarged to 2 to 8 times the original size to obtain a high-resolution candidate region image. S4. Input the candidate region image enhanced by super-resolution into a pre-trained convolutional neural network model to perform pixel-level crack segmentation, and obtain the segmentation result of the crack in the candidate region. S5. Map the segmented microcrack regions back to the original image coordinate system, mark the crack location and shape on the original image, and output the final microcrack segmentation result.

2. The method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network according to claim 1, characterized in that, Step S1 includes: S11. Acquire microscopic images of composite materials containing microcracks; S12. Denoising is performed on the composite material microscopic images acquired in step S11. Denoising is performed on the grayscale images. Gaussian filtering is performed using the following formula: in, This represents the image after denoising. The standard deviation is Gaussian kernel, ; Window radius ; S13. Perform grayscale normalization on the denoised composite material microscopic image. Grayscale normalization is to linearly map the denoised pixel values ​​to... The interval, after removing brightness deviations under different acquisition conditions, is calculated using the following formula: in, This represents the image after grayscale normalization. This represents the minimum grayscale value of the denoised image. This represents the maximum grayscale value of the denoised image; S14. Perform contrast enhancement on the normalized composite material microscopic image. The contrast enhancement is performed using histogram equalization, mapping the normalized pixel intensity to new values, as follows: in, For gray levels, The pixel intensity is The probability, This represents the number of pixels at that gray level. This represents the total number of pixels.

3. The method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network according to claim 1, characterized in that, Step S2 includes: S21. Perform a white cap transform on the image to obtain the preprocessed grayscale image. With structural elements Perform a morphological opening operation and then subtract it from the original image to highlight subtle bright line features. The formula is as follows: in, This represents the image after the white cap transformation; Indicates the opening operation; ;function and These represent corrosion and expansion, respectively. S22. Slide the detection of highlighted connected regions under different scale windows as candidate regions for microcracks, and represent each candidate region with a bounding box; S23. Non-maximum suppression is used to remove overlapping candidate regions to ensure that each crack corresponds to a unique candidate region.

4. The method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network according to claim 3, characterized in that, In step S23, all candidate boxes are sorted according to confidence level, and the box with the highest score is retained while other boxes with high overlap with it are suppressed to remove redundant boxes, including: After sorting all candidate boxes in descending order of score, each box is retained one by one, while boxes with excessive overlap with the retained boxes are suppressed. Given two boxes... and ,by Using area as the denominator, define the overlap ratio of the two boxes as follows: in, Represents two boxes and The overlap rate; if Then inhibit ; Candidate boxes and The area of ​​the intersection region; Candidate boxes The area; This represents the overlap rate threshold for nonmaximum suppression.

5. The method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network according to claim 1, characterized in that, In step S3, the super-resolution reconstruction network is a generative adversarial network model that performs edge sharpening and detail enhancement on the obtained high-resolution candidate region image to improve the clarity of microcrack details.

6. The method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network according to claim 1, characterized in that, In step S4, the convolutional neural network model adopts an encoder-decoder structure, containing multiple encoding convolutional layers and decoding convolutional layers, wherein: The encoder contains multiple deformable convolutional layers to extract microcrack features with a kernel size of 3×3 and adapts to the crack shape by learning an offset; The decoder reconstructs the image by fusing multi-scale features from the encoder through skip connections and outputs a crack segmentation map with the same size as the candidate region image.

7. The method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network according to claim 6, characterized in that, The convolutional neural network includes a deformable convolutional module and a dynamic attention mechanism module, wherein: The deformable convolution module introduces a learnable sampling offset, enabling the convolution kernel to align with the slender shape of the microcrack based on the deformation of the input features, thereby improving the feature extraction capability for irregular cracks. The calculation formula is as follows: in, Indicates position Output feature value at; For the first k Individual core weights; This indicates the position of the output pixel. For the first The relative offset of each core point on the standard grid; The deformable offset learned by the network; The dynamic attention mechanism module includes a channel attention submodule and a spatial attention submodule. The channel attention submodule performs compression-excitation processing on the sub-convolutional feature map to adaptively adjust the weights of each channel. The spatial attention submodule generates a spatial weight mask by convolving the feature map to highlight the location of the microcrack, thereby realizing the dynamic weighted fusion of the high and low layer features of the encoder.

8. The method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network according to claim 7, characterized in that, In the dynamic attention mechanism module: For the input feature map Global average pooling is performed along the spatial dimension to obtain the global description vector for each channel, as follows: in, Represents the global description vector for each channel; Represents the input feature map; Indicates altitude; Indicates width; Indicates the number of channels; Global description vector The channel weight coefficients are generated by performing two layers of dimensionality reduction to dimensionality increase mapping and applying ReLU and Sigmoid activations respectively. ,as follows: Among them, matrix Used to compress the number of channels to ReLU activation function Introducing nonlinearity, then by Restore to the original channel dimension and use the Sigmoid function. Limit the output to the range [0,1]. The original feature map is recalibrated channel-by-channel using the generated channel weights, as follows: in, Feature map representing channel-by-channel recalibration; Indicates the channel weight coefficient; A spatial attention mechanism is introduced, which uses convolution to extract spatial weight maps of feature maps to enhance the response at the crack location. By fusing attention at both the channel and spatial levels, dynamic weighting of features at different levels is achieved, thereby strengthening the expression of fine crack features. Encoder features and decoder features First, perform 1×1 mappings on each component, then add them together, then perform ReLU, and finally use Sigmoid to generate a spatial attention map. M The formula is as follows: in, This represents the intermediate feature map after fusion; Indicate encoder features; Indicate decoder features; Indicates the convolution weights corresponding to the encoder features; This represents the convolution weights corresponding to the decoder features; Represents a spatial attention map; Indicates standard deviation; Represents the convolution weights used to generate spatial attention; This represents the feature map output by the encoder; This represents the convolution operation; This indicates element-wise multiplication.

9. The method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network according to claim 6, characterized in that, The convolutional neural network model uses depthwise separable convolution instead of conventional convolution in its convolutional operation part to reduce model parameters and computational cost, wherein: Depthwise separable convolution first performs spatial convolution on each channel independently, and then... Convolution is used for channel blending; Each input channel Its dedicated convolution kernel Convolution outputs feature maps of the same channel. : in, Indicates channel The Each convolutional kernel weight; Indicates the vertical position index of the output feature map; This indicates the vertical offset index of the convolution kernel; Indicates the size of the convolution kernel; Indicates the horizontal position index of the output feature map; This indicates the horizontal offset index of the convolution kernel; Mix all C depthwise outputs according to their weights to obtain C' output channels: in, This indicates that pointwise convolution occurs in the input channel. and output channels Weights between them; Then perform batch normalization and activation: in, Indicates output channel In position eigenvalues; This indicates batch normalization operation.

10. The method for image segmentation of microcracks in carbon fiber composite materials based on a two-stage super-resolution dynamic attention network according to claim 6, characterized in that, The convolutional neural network model was trained using a labeled crack image dataset, which included microcrack sample images of different regions, sizes and shapes, and their pixel-level annotations. During training, a weighted combination of cross-entropy loss and Dice loss was used as the objective function, and the Adam optimization algorithm was used to adjust the model parameters.

Citation Information

Patent Citations

  • Aviation composite material surface defect detection method based on improved SegNet segmentation network

    CN117132553A

Cited By

  • Rubber pad crack detection method based on image recognition

    CN121707999A

  • Universal single-stage sperm morphology image segmentation method and system

    CN122265329A

  • Universal single-stage sperm morphology image segmentation method and system

    CN122265329B