A defect detection method for a preform of an aeroengine fan blade
The YOLOv9 network with multi-scale defect attention enhances defect detection in three-dimensional woven carbon fiber materials, addressing inefficiencies in current methods and meeting aerospace industry standards for precision and automation.
Patent Information
- Application Number
- CN202510541631.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-04-28
AI Technical Summary
The prior art cannot realize real-time, high-precision and automated detection of defects in carbon fiber yarns and woven prefabricated bodies on three-dimensional woven production lines, and it is difficult to meet the high efficiency and high precision requirements of the aerospace industry.
The YOLOv9 network is used to combine the multi-scale defect attention mechanism, and through real-time image acquisition, preprocessing, multi-scale feature extraction and significant center of gravity offset elimination mechanism, a defect perception decoupling detection module is built to achieve high-precision detection of defect location and size.
Real-time, high-precision and automated detection of defects in carbon fiber yarns and woven prefabricated bodies has been achieved, and the quality control capability of the prefabricated body production line of aero engine fan blades has been significantly improved, and the strict production standards of the aviation industry have been met.
Smart Images

Figure CN120070436B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional braided composite material detection, and particularly to a method for detecting defects in a preform of an aero-engine fan blade. Background Art
[0002] In recent years, with the rapid development of the aerospace industry, the demand for high-strength, high-stiffness, and lightweight structural materials has become increasingly urgent. Carbon fiber composite materials are widely used in the manufacturing process of key components such as aero-engine fan blades, aircraft wings, rocket fairings, and satellite structural parts due to their excellent specific strength, specific stiffness, and fatigue resistance. The three-dimensional weaving technology has become one of the important methods for manufacturing fan blade preforms due to its good mechanical properties and structural controllability, and is widely used in the manufacturing of complex three-dimensional structural parts such as aero-engine fan blades, aero-engine casings, and composite skins. However, in the three-dimensional weaving technology, the interlaced structure of the yarns is complex and the number of yarns is large, which easily causes defects during the conveying process such as fuzz, lint, and looseness, as well as defects during the weaving process such as knotting, broken yarn, and floating yarn. These defects seriously affect the mechanical properties and safety of the components.
[0003] At present, manual visual inspection of defects is widely used in industrial production lines. This method has low detection efficiency, and the results are greatly affected by the subjective judgment of the operators, making it difficult to meet the strict requirements of the aerospace industry for high efficiency, high precision, and automated production. Therefore, it is of great practical significance and urgency to develop a real-time, automated, and high-precision defect detection technology applicable to three-dimensional weaving production lines. Summary of the Invention
[0004] Aiming at the deficiencies of the prior art, the present invention provides a method for detecting defects in a preform of an aero-engine fan blade, which solves the technical problem that traditional methods cannot perform real-time detection of carbon fiber yarns and defects in woven preforms in a three-dimensional weaving production line.
[0005] To solve the above technical problems, the present invention provides the following technical solution: A method for detecting defects in a preform of an aero-engine fan blade, the method comprising the following steps:
[0006] Real-time collect the original images of the carbon fiber yarn conveying and the surface of the woven preform, and perform preprocessing on the original images to obtain clear and low-noise preprocessed images;
[0007] Based on the YOLOv9 network and combined with a multi-scale defect attention mechanism, perform feature extraction on the preprocessed images to obtain a multi-scale feature map containing global features and local features;
[0008] Construct a defect-aware decoupled detection module for decomposing the defect detection task into two subtasks of position modeling and size estimation, and obtain initial candidate boxes based on multi-scale feature maps ;
[0009] Adopt a saliency centroid offset elimination mechanism for the initial candidate boxes to optimize and obtain a set of defect results , including defect position coordinates, size parameters, and category information.
[0010] Furthermore, the preprocessing of the original image includes:
[0011] Convert the original image into a single-channel grayscale image with a grayscale value range of 0 to 255;
[0012] According to the relationship between the average gray level of the local area where the current pixel is located and the global average gray level of the grayscale image dynamically adjust the gray level of the current pixel to generate an enhanced pixel gray level and obtain an enhanced image ;
[0013] Perform noise reduction processing on the enhanced image using median filtering to obtain a preprocessed image.
[0014] Furthermore, the dynamic adjustment of the gray level of the current pixel , the expression is:
[0015] ;
[0016] where is the maximum gray level within the local window; is a positive enhancement adjustment factor used to control the enhancement intensity;
[0017] , that is, when the local area brightness is lower than the overall brightness, enhance the brightness of the dark area through the logarithmic function to make the defects hidden in the low-gray background more prominent;
[0018] , that is, when the local and overall brightness are the same, keep the gray level unchanged;
[0019] , that is, when the local area brightness is higher than the overall brightness, compress the gray level range of the highlighted pixels to make the light-colored defects easier to identify.
[0020] Furthermore, the multi-scale defect attention mechanism is:
[0021] The channel attention part first performs global average pooling on the spatial regions of each channel to extract the channel-level response intensity. The calculation formula is as follows:
[0022] ;
[0023] where, represents the response value of the -th channel at the pixel position ; respectively represent the height and width of the feature map ; represents the global average response value of the -th channel, which serves as the basis for the channel attention weight;
[0024] Then, the calculated global average response value of each channel is input into the attention generation network composed of two fully connected layers. The network structure sequentially includes:
[0025] A dimensionality reduction fully connected layer with a size of , and the ReLU activation function is used, is the dimensionality reduction ratio, is the number of channels of the fully connected layer;
[0026] An upsampling fully connected layer with a size of , and the channel attention weight vector is generated through activation by the Sigmoid function, that is:
[0027] ;
[0028] where, and are the weights of the dimensionality reduction and upsampling fully connected layers respectively; and are the corresponding biases; is the ReLU activation function; is the Sigmoid activation function;
[0029] Finally, the generated channel attention weight vector is used to perform per-channel feature recalibration on each channel in the network feature map , that is:
[0030] ;
[0031] where, is the multi-scale feature map enhanced by the channel attention mechanism; is the feature map of the -th channel.
[0032] Furthermore, the defect perception decoupling detection module outputs initial candidate bounding boxes , including:
[0033] A location prediction sub-task that builds a central probability heatmap representing the confidence of each pixel as the center of a defect based on multi-scale feature maps , and uses a Sigmoid cross-entropy loss function with a positive and negative sample balance factor during the training phase to obtain the predicted defect center points and predicted sizes ;
[0034] A size estimation sub-task that separately constructs a size regression network for the predicted defect center positions. This network outputs the width and height of each predicted defect center point and uses a loss function to optimize the regression error of the predicted sizes . The expression of the loss function is:
[0035] ;
[0036] where , are the width and height of the th true defect respectively; , are the width and height predicted by the central probability heatmap ; is the regression loss of the size estimation sub-task; is the total number of valid candidate defect center points;
[0037] During the network inference phase, perform a local maximum extraction operation on the central probability heatmap to obtain the set of predicted defect center points ;
[0038] For the position of each predicted defect center point, read its predicted width and height in the corresponding central probability heatmap to form the initial candidate bounding box .
[0039] Furthermore, the expression of the loss function is:
[0040] ;
[0041] where is the true label of pixel ; is the pixel The heatmap response value, representing the confidence of the defect center; is the Sigmoid function; is the foreground balance coefficient; is the total number of pixels participating in supervision.
[0042] Furthermore, the initial candidate box is optimized, including:
[0043] Confidence focus weight calculation. A confidence focus weight for extracting the peak of the center heatmap is introduced into the center probability heatmap to evaluate the significance and confidence strength of the initial candidate box. The expression is:
[0044] ;
[0045] where is the heatmap response value of pixel representing the confidence of the defect center; is the size response value corresponding to pixel to enhance the weight of the significant center point; is the size enhancement factor, a positive real number, controlling the significance amplification;
[0046] Geometric distance penalty term calculation. Based on the traditional non-maximum suppression algorithm, a geometric distance penalty term is introduced to avoid duplicate pseudo-boxes caused by the deviation of the center of gravity. The expression is:
[0047] ;
[0048] where , are the center point positions of the initial candidate boxes and ; is the center point position , the Euclidean distance between them; is the intersection over union between the initial candidate boxes and ; is the geometric penalty distance, used to dynamically adjust the retention order of overlapping boxes in the non-maximum suppression algorithm;
[0049] Candidate box optimization and screening. All candidate boxes are initially sorted according to the confidence focus weight , and then the geometric distance penalty term is used to dynamically adjust the sorting order of the candidate boxes;
[0050] Defect result set The generation includes the central position coordinates of each defect , the predicted size of each defect , as well as the corresponding defect category information and comprehensive confidence score .
[0051] Furthermore, in the optimization and screening of the candidate boxes, it includes:
[0052] First, retain the candidate box with the highest confidence focus weight ;
[0053] Gradually check the geometric distance penalty term between the candidate box with the second-highest weight and the retained box , and if there is a relatively high penalty value and the intersection over union is higher than the threshold, discard the candidate box;
[0054] Loop through the above steps until all candidate boxes are evaluated to obtain the final optimized set of defect results .
[0055] By means of the above technical solution, the present invention provides a method for detecting defects in a preform of an aeroengine fan blade, which has at least the following beneficial effects:
[0056] 1. The present invention can achieve real-time, high-precision, and automated detection of defects in carbon fiber yarns and woven preforms, significantly improving the quality control ability of the production line of aeroengine fan blade preforms and meeting the strict production standards of the aviation industry.
[0057] 2. The present invention realizes automated, real-time, and high-precision defect detection through precise image acquisition, efficient image preprocessing, and precise design and optimization of deep learning algorithms, significantly improving the detection efficiency and quality assurance of the production line of carbon fiber woven blade preforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The drawings described herein are used to provide a further understanding of the present application, form a part of the present application, and the schematic embodiments and descriptions thereof are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0059] Figure 1 is a flowchart of the defect detection method in the present invention;
[0060] Figure 2 is a schematic diagram of the installation positions of the yarn defect real-time detection device and the preform defect real-time detection device in the present invention;
[0061] Figure 3 is a network structure diagram of the preform defect detection model with multi-scale feature fusion in the present invention;
[0062] Figure 4 This is the network structure diagram of the multi-scale defect attention mechanism in the present invention. Specific implementation manner
[0063] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners. Thereby, the implementation process of how this application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.
[0064] This embodiment proposes a defect detection method for the preform of an aero-engine fan blade, which uses a defect detection algorithm for real-time identification. Among them, a multi-scale defect attention mechanism is integrated to improve the identification performance of small-scale defects, and a feature reconstruction detection head and loss function dedicated to the defect detection of yarns and preforms are designed to further improve the defect location and classification accuracy. High-precision, high-real-time, and automated defect detection is achieved, meeting the requirements of the aviation industrial production line. As Figure 1 shown, this method includes the following steps:
[0065] S1. Design and set up a high-precision image acquisition device to collect the original images of the carbon fiber yarn conveying and the surface of the woven preform in real time, and preprocess the original images to obtain clear and low-noise preprocessed images. In this embodiment, by setting up a high-precision image acquisition device at the specified detection positions of the carbon fiber yarn conveying device and the weaving equipment, as Figure 2 shown. It includes an industrial camera, a high-resolution lens, a multi-light source illumination device, and a multi-degree-of-freedom adjustment bracket, which are used to obtain high-resolution surface images generated during the carbon fiber yarn conveying and preform weaving processes in real time. The specific process of preprocessing the original images includes the following steps:
[0066] S11. Convert the original image into a single-channel grayscale image, and the grayscale value range is from 0 to 255. There are several common grayscale conversion methods, such as the average value method, the weighted average method, or using existing library functions.
[0067] S12. To improve the contrast between the defect area and the background and enhance the detailed information of the image, the image enhancement method used is based on an adaptive contrast enhancement model of local and global grayscale differences. Its core idea is: according to the average grayscale of the local area where the current pixel is located and the global average grayscale of the grayscale image the relationship between them, dynamically adjust the grayscale value of the current pixel , generate the enhanced pixel grayscale value to obtain the enhanced image This method has the advantages of strong self - adaptability, significant non - linear enhancement effect, and strong ability to adapt to light changes. It is particularly suitable for enhancing the saliency of tiny defect features in yarn and woven preform images. The specific form of its enhancement function is as follows:
[0068] ;
[0069] Among them, is the maximum gray value within the local window; is a positive enhancement adjustment factor used to control the enhancement intensity. According to different gray - scale distribution relationships, the enhancement strategies are as follows:
[0070] , that is, when the local area brightness is lower than the overall brightness, the brightness of the dark area is enhanced through the logarithmic function, making the defects hidden in the low - gray - scale background more prominent;
[0071] , that is, when the local and overall brightness are the same, the gray value remains unchanged;
[0072] , that is, when the local area brightness is higher than the overall brightness, the gray - scale range of the highlighted pixels is compressed, making light - colored defects (such as floating yarns, broken yarns) more easily recognizable.
[0073] S13. Perform noise reduction processing on the enhanced image using median filtering to obtain a pre - processed image. In this embodiment, an adaptive local gray - scale contrast enhancement and noise reduction method is used to pre - process the original image, obtaining a clear and low - noise pre - processed image, which can further reduce noise interference and ensure that the defect features are prominent and clear.
[0074] S2. Based on the YOLOv9 network and combined with a multi - scale defect attention mechanism, perform feature extraction on the pre - processed image to obtain a multi - scale feature map containing global and local features. The network structure is shown in Figure 3(a), Figure 3 where the solid lines represent the feature transfer direction, and the dashed lines represent the cross - scale feature fusion path. Specifically, the YOLOv9 network structure used in this embodiment includes a backbone network, a feature pyramid network, and three feature output layers at different scales. The backbone network consists of multiple convolutional layers and C2f feature extraction modules, responsible for gradually extracting high - level features from the original image, generating three feature maps denoted as , , ( for tiny defects such as yarn breakage or preform breakage, for larger defects such as yarn tufts or preform knots), and their spatial resolutions correspond to 1 / 8, 1 / 16, and 1 / 32 of the original image respectively. These multi - scale feature maps are used for subsequent defect feature analysis.
[0075] This embodiment uses the YOLOv9 network structure as the basic architecture and combines a multi-scale defect attention mechanism to improve the feature extraction efficiency and sensitivity to small-scale defects. The integrated multi-scale defect attention mechanism specifically includes a channel attention module. The network structure is shown in Figure 4, and its purpose is to highlight the channel information sensitive to defects in the feature map and suppress the interference of unimportant background features. Specifically as follows:
[0076] Extract global features and local features from the network feature map Perform a global average pooling operation on the spatial region of each channel in the feature map to extract the channel-level response intensity. The calculation formula is as follows:
[0077] ;
[0078] Among them, represents the response value of the th channel at the pixel position ; respectively represent the height and width of the feature map ; represents the global average response value of the th channel, which is used as the basis for the channel attention weight. This mechanism dynamically measures the sensitivity of different channels to defect features by calculating the global average response value of each channel, and assigns higher weights to high-response channels in subsequent feature fusion, thereby highlighting defect features, suppressing redundant background information, and improving the recognition accuracy and robustness of small-scale defects.
[0079] Then, input the calculated global average response value of each channel into the attention generation network composed of two fully connected layers. The network structure includes in sequence:
[0080] A dimensionality reduction fully connected layer with a size of (where is the dimensionality reduction ratio, is the number of channels of the fully connected layer, and in this embodiment, is taken), and the ReLU activation function is used.
[0081] An upsampling fully connected layer with a size of is activated by the Sigmoid function to generate the channel attention weight vector , that is:
[0082] ;
[0083] Among them, and are the weights of the dimensionality reduction and dimensionality increase fully connected layers respectively; and are the corresponding biases; is the ReLU activation function; is the Sigmoid activation function;
[0084] Finally, using the generated channel attention weight vector to perform channel-by-channel feature recalibration on each channel in the network feature map , that is:
[0085] ;
[0086] Among them, is the multi-scale feature map enhanced by the channel attention mechanism; is the feature map of the th channel.
[0087] The specific implementation details of the above multi-scale defect attention mechanism are as Figure 4 shown, including a feature partitioning module, a 1×1 branch and a 3×3 branch module, as well as a cross-space learning module. Specific dimension information and operation processes are marked in each part of the figure.
[0088] S3. Construct a defect-aware decoupled detection module for decomposing the defect detection task into two subtasks of position modeling and size estimation. The network structure is as Figure 3 shown in (b) of. And obtain the initial candidate box based on the multi-scale feature map, and then adopt a multi-scale guidance mechanism to fuse features to improve the defect localization and classification accuracy. To further improve the defect detection accuracy, the present invention introduces a defect-aware decoupled detection module on the basis of the traditional YOLOv9 network, decomposes the localization and classification tasks into two subtasks of center point prediction and size estimation, and then adopts a multi-scale guidance mechanism to fuse features, effectively avoiding the mutual interference between the two, and significantly improving the defect localization and classification accuracy. Therefore, on the basis of the multi-scale feature map extracted by the YOLOv9 network, the present invention designs a defect-aware decoupled detection module, the structure of which includes a position prediction branch, a size estimation branch and an attention feature fusion unit. The attention feature fusion unit integrates local space and context information through a residual attention structure, avoids task interference, and improves the convergence efficiency of size prediction.
[0089] S31. Position prediction subtask. Based on the multi-scale feature map, establish a central probability heat map representing the confidence of each pixel as the center of the defect, and adopt a Sigmoid cross-entropy loss function with a positive and negative sample balance factor in the training stage to obtain the predicted defect center point and the predicted size The loss function has the following expression:
[0090] ;
[0091] where is the true label of the pixel ; is the heatmap response value of the pixel indicating the defect center confidence; is the Sigmoid function; is the foreground balance coefficient; is the total number of pixels participating in supervision;
[0092] S32. Size estimation subtask: A size regression network is separately constructed for the predicted defect center position, and this network outputs the width and height of each predicted defect center point. The loss function is used to optimize the regression error of the predicted size . The loss function has the following expression:
[0093] ;
[0094] where , are respectively the width and height of the th true defect; , are the width and height predicted by the center probability heatmap ; is the regression loss of the size estimation subtask; is the total number of valid candidate defect center points;
[0095] S33. In the network inference stage, a local maximum extraction operation is performed on the center probability heatmap to obtain the set of predicted defect center points ;
[0096] S34. For the position of each predicted defect center point, its predicted width and height are read from the corresponding center probability heatmap to form the initial candidate bounding box for the subsequent post - processing process.
[0097] S4. The initial candidate bounding box is optimized using the saliency centroid shift elimination mechanism to obtain the set of defect results , the network structure is shown in (c) of Figure 3, including defect location coordinates, size parameters and category information. The initial candidate boxes are optimized by using the significant center of gravity offset elimination mechanism combined with the distance-guided non-maximum suppression algorithm to effectively eliminate overlapping candidate boxes and false positive boxes. The specific steps are as follows:
[0098] S41, confidence focus weight calculation, in the center probability heat map The confidence focus weight for extracting the center heatmap peak is introduced in , used to evaluate the saliency and confidence of the initial candidate box, the expression is:
[0099] ;
[0100] in, Pixel The heat map response value of represents the confidence of the defect center; Pixel The corresponding size response value increases the weight of significant center points; is the size enhancement factor, which is a positive real number and controls the significance amplification. Through this step, the weight of the defect center with larger size or more obvious is significantly increased, and the background noise interference is reduced.
[0101] S42, calculation of geometric distance penalty term. In order to avoid pseudo-frame duplication caused by deviation of the prediction center, a geometric distance penalty term is introduced on the basis of the traditional non-maximum suppression algorithm to avoid pseudo-frame duplication caused by deviation of the center of gravity. , the expression is:
[0102] ;
[0103] in, , is the initial candidate box and The center point position; Center point position , The Euclidean distance between is the initial candidate box and The intersection-and-union ratio between them; It is the geometric penalty distance, which is used to dynamically adjust the retention order of overlapping boxes in the non-maximum suppression algorithm;
[0104] S43, candidate box optimization and screening. All candidate boxes are optimized and screened according to the confidence focus weight. Perform a preliminary sort and then use the geometric distance penalty Dynamically adjust the sorting order of candidate boxes. The specific process is as follows:
[0105] First, retain the confidence focus weight The candidate box with the highest weight;
[0106] Gradually check the geometric distance penalty term between the candidate box with the second-highest weight and the retained box , if there is a relatively high penalty value and the intersection over union is higher than the threshold, discard the candidate box;
[0107] Loop through the above steps until all candidate boxes are evaluated to obtain the final optimized set of defect results ;
[0108] S44. Generation of the set of defect results. After the above optimization steps, the final set of defect results output , specifically including the central position coordinates of each defect , the predicted size of each defect , and the corresponding defect category information and comprehensive confidence score . The set is defined as follows:
[0109] ;
[0110] Among them, is the total number of defects detected after optimization.
[0111] S5. The detection module finally outputs the optimized set of defect results , specifically including the following structured information to ensure the clarity and traceability of the quality inspection results:
[0112] (1) Defect location coordinates , which is defined as the significant response peak position corresponding to the defect in the central probability heat map , representing the specific center point position of the defect in the image.
[0113] (2) Defect size estimation information , the predicted width and height directly output by the feature regression network in the size estimation subtask, used to clearly identify the spatial range of each defect.
[0114] (3) Defect category information , identifying the type of each defect through a pre-trained classification network, and the specific categories include but are not limited to common defect types in the production of woven preforms for aeroengine fan blades, such as hair filaments, hair balls, looseness, knots, broken yarns, floating yarns, etc.
[0115] (4) Confidence score : The comprehensive index combines the response value of the central probability heat map and the significant response value of the size estimation , which is used to objectively evaluate the reliability and significance of each defect prediction result, and its calculation formula is as follows:
[0116] ;
[0117] Where, is the weight coefficient, which is used to adjust the contribution ratio of the center response value and the size response value, and the range is from 0 to 1; represents the maximum value of all size response values in the current detection batch to ensure the unity of the scale.
[0118] (5) Structured detection log with automatic archiving:
[0119] The detection log automatically records all structured data of this detection task, including: total defect quantity statistics, defect spatial distribution heat map, maximum and minimum defect size statistics, prediction error statistics, category distribution statistics, and supports historical data query and production process optimization feedback.
[0120] The present invention can realize real-time, high-precision and automatic detection of defects in carbon fiber yarns and woven preforms, significantly improve the quality control ability of the preform production line for aeroengine fan blades, and meet the strict production standards of the aviation industry.
[0121] Those of ordinary skill in the art can understand that all or part of the steps in implementing the method of the above embodiments can be completed by instructing relevant hardware through a program. Therefore, this application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0122] The above embodiments have introduced the present invention in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A defect detection method for a preform of an aeroengine fan blade, characterized in that, The method includes the following steps: Collect the original images of the carbon fiber yarn conveying and the surface of the woven preform in real time, and preprocess the original images to obtain clear and low-noise preprocessed images; Based on the YOLOv9 network and combined with the multi-scale attention mechanism, extract features from the preprocessed images to obtain multi-scale feature maps containing global features and local features; Construct a defect-aware decoupled detection module for decomposing the defect detection task into two subtasks of location modeling and size estimation, and obtain initial candidate boxes based on multi-scale feature maps ; Adopt a significant centroid offset elimination mechanism for the initial candidate bounding boxes to optimize and obtain a set of defect results , including defect position coordinates, size parameters, and category information; The defect perception decoupling detection module outputs an initial candidate box , including: The position prediction subtask establishes a central probability heatmap based on multi-scale feature maps to represent the confidence of each pixel as the center of a defect. During the training phase, a Sigmoid cross-entropy loss function with a positive and negative sample balancing factor is used to obtain the predicted center points of the defects and the predicted sizes. ; For the size estimation subtask, a size regression network is separately constructed for the predicted defect center positions, and the network outputs the width and height of each predicted defect center point. The loss function is used to optimize the regression error of the predicted size. The expression of the loss function is as follows: ; Among them, and are the width and height of the th real defect, respectively; and are the width and height predicted by the central probability heat map ; is the regression loss of the size estimation subtask; is the total number of valid candidate defect center points. During the network inference stage, for the central probability heatmap perform a local maximum extraction operation to obtain a set of predicted defect center points ; For the position of each predicted defect center point, read its predicted width from the corresponding center probability heat map and height to form an initial candidate bounding box ; The optimization of the initial candidate box includes: Confidence Focus Weight Calculation, introducing confidence focus weights for extracting the peak of the center heat map in the center probability heat map to evaluate the saliency and confidence strength of the initial candidate bounding boxes, and the expression is: to evaluate the saliency and confidence strength of the initial candidate bounding boxes, and the expression is: ; Among them, is the heat map response value of the pixel , representing the defect center confidence; is the size response value corresponding to the pixel , enhancing the weight of the significant center point; is the size enhancement factor, which is a positive real number and controls the significance amplification; Calculation of geometric distance penalty term. Based on the traditional non-maximum suppression algorithm, a geometric distance penalty term is introduced to avoid duplicate pseudo-boxes caused by the deviation of the center of gravity. , and the expression is: ; Among them, , are the center point positions of the initial candidate boxes and ; is the center point position , the Euclidean distance between; is the intersection over union between the initial candidate box and ; is the geometric penalty distance, which is used to dynamically adjust the retention order of overlapping boxes in the non-maximum suppression algorithm; Optimization and screening of candidate boxes, and preliminary sorting of all candidate boxes according to the confidence focusing weight Then, use the geometric distance penalty term to dynamically adjust the sorting order of candidate boxes; Defect result set is generated, including the central position coordinates of each defect , the predicted size of each defect , as well as the corresponding defect category information and comprehensive confidence score .
2. The defect detection method according to claim 1, wherein The preprocessing of the original images includes: Convert the original images into single-channel grayscale images with the gray value range from 0 to 255; According to the average gray level of the local area where the current pixel is located and the global average gray level of the grayscale image to dynamically adjust the gray level value of the current pixel and generate the enhanced pixel gray level value to obtain the enhanced image ; For the enhanced image Median filtering is used for noise reduction to obtain a preprocessed image.
3. The defect detection method according to claim 2, wherein dynamically adjust the gray value of the current pixel , and the expression is: ; Among them, is the maximum gray value within the local window; is a positive enhancement adjustment factor used to control the enhancement intensity; , that is, when the brightness of the local area is lower than the overall brightness, the brightness of the dark area is enhanced through the logarithmic function to make the defects hidden in the low-gray background more prominent; , that is, when the local and overall brightness are the same, the gray value remains unchanged; , that is, when the local area brightness is higher than the overall brightness, by compressing the gray range of the highlighted pixels, it makes the light-colored defects easier to be recognized.
4. The defect detection method according to claim 1, wherein The multi-scale attention mechanism is: The channel attention part first performs global average pooling operations on the spatial regions of each channel to extract the channel-level response intensity, and the calculation formula is as follows: ; Among them, represents the response value of the th channel at the pixel position ; respectively represent the height and width of the feature map ; represents the global average response value of the th channel, which is used as the basis for the channel attention weight; Then, the calculated global average response value of each channel is input into an attention generation network composed of two fully connected layers, and the network structure sequentially includes: A dimensionality reduction fully connected layer with a size of , and the ReLU activation function is used. is the dimensionality reduction ratio, is the number of channels of the fully connected layer; A dimensionality-increasing fully-connected layer with a size of is activated by the Sigmoid function to generate a channel attention weight vector , that is: ; Among them, and are the weights of the dimensionality reduction and dimensionality increase fully connected layers respectively; and are the corresponding biases; is the ReLU activation function; is the Sigmoid activation function; Finally, the generated channel attention weight vector is used to perform channel-by-channel feature recalibration on each channel in the network feature map , that is: ; Among them, is the multi-scale feature map enhanced by the channel attention mechanism; is the feature map of the th channel.
5. The defect detection method according to claim 1, characterized in that, The loss function has the following expression: ; wherein, is the true label of the pixel ; is the heatmap response value of the pixel , representing the confidence of the defect center; is the Sigmoid function; is the foreground balance coefficient; is the total number of pixels participating in supervision.
6. The defect detection method according to claim 1, characterized in that In the optimization and screening of the candidate boxes, it includes: First, retain the confidence focus weights The highest candidate bounding box; Gradually check the geometric distance penalty term between the candidate box with the second highest weight and the reserved box If there is a relatively high penalty value and the intersection over union is higher than the threshold, discard the candidate box; Loop and execute the above steps until all candidate boxes are evaluated, and obtain the final optimized set of defect results .
Citation Information
Patent Citations
Textile fabric product defect detection method and system
CN119290896A
Improved sewer internal defect detection method and system based on YOLOv11
CN119540725A