Target defect detection training model, method and system based on improved YOLOv5 algorithm

By improving the YOLOv5 algorithm, multi-scale convolution operation, attention mechanism and pyramid pooling are introduced, which solves the problem of insufficient detection accuracy of small target defects of fan blades in complex backgrounds, and achieves higher detection accuracy and lower missed detection error rate.

CN119516172APending Publication Date: 2025-02-25GUANGZHOU DEV ELECTRIC POWER TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411665079.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The prior art has insufficient detection accuracy for small target defects of fan blades under complex backgrounds, and has high missed detection and error detection rates, making it difficult to adapt to the complexity of the real world with high dynamic and low contrast visual scenes.

Method used

Improve the YOLOv5 algorithm, introduce multi-scale convolution operations, multiple attention mechanisms, and pyramid pooling, and build SAConv, PSA, CoordAtt and PPM modules to improve the model's recognition ability of multi-scale targets and detection accuracy in complex scenarios.

Benefits of technology

The detection accuracy of small target defects in complex scenarios is significantly improved, the missed detection and error detection rates are reduced, and the model's detection ability of small targets and complex texture defects in the fan blade is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516172A_ABST
    Figure CN119516172A_ABST
Patent Text Reader

Abstract

The invention provides a target defect detection training model, method and system based on an improved YOLOv5 algorithm. The model comprises an input module, a SAConv module, a PSA module, a CoordAtt module, a PPM module and an output module. Wherein the input module is used for receiving a target processing image; the SAConv module is used for performing feature extraction on a target processing image through a multi-scale switchable cavity convolution operation to obtain a first feature map; the PSA module is used for performing feature fusion on the first feature map through a fusion polarization self-attention mechanism to obtain a second feature map; the CoordAtt module is used for performing coordinate attention weighting on the second feature map through a coordinate attention mechanism to obtain a third feature map; the PPM module is used for performing multi-scale target detection and recognition on the third feature map through pyramid pooling to obtain a defect detection result; and the output module is used for outputting and feeding back a defect detection result. According to the invention, the YOLOv5 is improved, so that the detection precision of small target defects in a complex scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of target detection, and in particular to a target defect detection training model, method and system based on an improved YOLOv5 algorithm. Background Art

[0002] In recent years, with the continuous growth of global energy demand, the transformation of traditional energy structure has become increasingly urgent. Wind power generation has rapidly emerged as an important force in global energy supply with its clean and renewable advantages. As a key component of wind turbines, the operating status of wind turbine blades has a significant impact on power generation efficiency. However, since wind turbines are usually deployed in remote and harsh areas and are challenged by extreme weather conditions for a long time, wind turbine blades are prone to various defects. Therefore, regular and efficient inspection and testing of wind turbine blades to timely discover and eliminate potential hidden dangers are of vital importance to ensure the safe and stable operation of wind turbines, reduce operation and maintenance costs, and reduce power generation losses.

[0003] At present, defect detection of wind turbine blades mainly relies on traditional manual inspection methods. However, with the continuous increase in the size of wind turbine blades, especially in complex background scenes, the efficiency and accuracy of traditional methods in detecting small defects have been greatly reduced. In recent years, although computer vision technology, such as deep learning models based on convolutional neural networks (CNN) and regional convolutional neural networks (R-CNN), has been widely used in defect detection of wind turbine blades, these models are often greatly affected by the environment when dealing with complex environmental factors such as motion blur, illumination changes, and background noise. They usually need to be trained in a clear and well-controlled environment, focus more on global feature extraction, and are easily affected by various background interferences. Especially when the color and texture of the wind turbine blade are similar to the background, the algorithm cannot effectively distinguish between the target and the background, the generalization ability is insufficient, and the local features of the blade defects cannot be accurately captured, resulting in frequent missed detection and false detection problems in complex backgrounds. It is difficult to adapt to the complex high-dynamic and low-contrast visual scenes in the real world, resulting in insufficient detection accuracy; and wind turbine blade defects are usually presented as small targets, such as cracks, wear, etc. These defects account for a small proportion of the blade surface and are easily masked by background noise. The existing model has limited feature extraction capabilities for small targets. When the target size is small, the downsampling operation of the convolutional layer will cause the loss of small target feature information. This structural limitation makes it difficult for the existing algorithm to fully characterize the detailed features of these defects when detecting small targets, resulting in a decrease in detection accuracy and unable to meet the requirements of defect detection in practical applications. Therefore, a more accurate detection method is urgently needed. Summary of the invention

[0004] The present invention aims to provide a target defect detection training model, method and system based on an improved YOLOv5 algorithm to solve the above technical problems, improve the detection accuracy of small target defects in complex scenarios, and reduce missed detection and false detection rates.

[0005] In order to solve the above technical problems, the present invention provides a target defect detection training model based on an improved YOLOv5 algorithm, the model comprising: an input module, a SAConv module, a PSA module, a CoordAtt module, a PPM module, and an output module; wherein:

[0006] The input module is used to receive the target processing image;

[0007] The SAConv module is used to extract features of the target processed image through a multi-scale switchable dilated convolution operation to obtain a first feature map;

[0008] The PSA module is used to perform feature fusion on the first feature map by fusing the polarized self-attention mechanism to obtain a second feature map;

[0009] The CoordAtt module is used to perform coordinate attention weighting on the second feature map through a coordinate attention mechanism to obtain a third feature map;

[0010] The PPM module is used to perform multi-scale target detection and recognition on the third feature map through pyramid pooling to obtain defect detection results;

[0011] The output module is used to output and feedback defect detection results.

[0012] In the above scheme, by improving the YOLOv5 model, introducing multi-scale convolution operations, multiple attention mechanisms and pyramid pooling, the performance of the model is further improved, the ability to recognize multi-scale targets is improved, the detection accuracy of small target defects in complex scenes is improved, and the missed detection and false detection rates are reduced. Furthermore, the SAConv module includes a multi-scale convolution submodule and a reduction optimization submodule, wherein: the multi-scale convolution submodule is used to perform multi-scale convolution operations on the target processing image based on several preset void rates and in combination with preset corresponding convolution kernels to generate a multi-scale feature map; the reduction optimization submodule is used to fuse and splice the multi-scale feature maps through the concat operation, and reduce the number of channels based on the preset reduction convolution to obtain the first feature map.

[0013] The above scheme introduces multi-scale convolution operations by constructing the SAConv module and adopts a variety of different void rates for convolution operations, which can capture the target features of large, medium and small scales respectively and realize the multi-scale receptive field. The multi-scale feature maps are fused and the number of channels is reduced, which improves the model's perception ability of multi-scale targets while avoiding excessive computational overhead.

[0014] Furthermore, the PSA module includes a channel self-attention submodule, a spatial sub-attention submodule and a fusion submodule, wherein: the channel self-attention submodule is used to process the first feature map through global average pooling, compress the spatial information of each channel into a single scalar, and output the weight of each channel through a preset fully connected layer and an activation layer to obtain channel attention information; the spatial sub-attention submodule is used to process the first feature map through global average pooling, and through a preset fully connected layer, use a sigmoid function to determine the weight of each spatial position in the first feature map to obtain spatial attention information; the fusion submodule is used to weightedly fuse the channel attention information and the spatial attention information to obtain merged attention information, so as to perform feature re-adjustment on the first feature map based on the merged attention information to obtain the second feature map.

[0015] The above scheme adopts the PSA module to integrate the polarized attention mechanism to accurately capture and process the correlation information between feature maps through channel and spatial branches, further improving the model's ability to learn and identify defect features in complex data sets.

[0016] Furthermore, the CoordAtt module includes a coordinate information embedding submodule, a coordinate attention generation submodule and an attention weighting submodule, wherein: the coordinate information embedding submodule is used to use 2D global pooling to sample the input second feature map along the horizontal and vertical dimensions respectively, and preset corresponding pooling kernels for coordinate encoding to obtain a horizontally aggregated feature map and a vertically aggregated feature map; the coordinate attention generation submodule is used to cascade the horizontally aggregated feature map and the vertically aggregated feature map into an overall feature map through a concat operation, and input them into a preset convolution transformation function to obtain an intermediate feature tensor, and split it into a horizontal feature tensor and a vertical feature tensor based on the intermediate feature tensor; the attention weighting submodule is used to use two independent preset convolution operations to process the horizontal feature tensor and the vertical feature tensor respectively, to generate horizontal attention weights and vertical attention weights respectively, and obtain the coordinate attention weight based on the horizontal attention weight and the vertical attention weight to obtain a third feature map.

[0017] The above scheme introduces the coordinate attention mechanism through the CoordAtt module to enhance the model's perception of target position information by embedding coordinate information, especially to improve the positioning accuracy of small target defects in complex scenarios.

[0018] Furthermore, the PPM module includes a pooling submodule and a fusion submodule, wherein: the pooling submodule is used to perform pooling operations on the third feature map in an adaptive average pooling manner based on several pooling kernels of different sizes to obtain several pooling feature maps; the fusion submodule is used to reduce the number of channels of the several pooling feature maps through a preset reduction convolution, and upsample them to a preset sampling size through bilinear interpolation to obtain several upsampled pooling feature maps, and use a concat operation to merge the several upsampled pooling feature maps to obtain a composite feature map, so as to perform target detection and recognition and obtain defect detection results.

[0019] The above scheme introduces pyramid pooling through the PPM module to further enhance the model's detection capability for multi-scale targets and ensure that defects of wind turbine blades of various scales can be identified. In particular, when dealing with defects with large scale variations in wind turbine blades, such as large-area defects such as corrosion, it can show better performance and higher accuracy. It not only optimizes the actual application effect of the model, but also improves the adaptability and robustness of the model in complex environments, and significantly enhances the multi-scale detection capability of the YOLOv5 model.

[0020] The present invention proposes a target defect detection training model based on the improved YOLOv5 algorithm, which introduces multi-scale convolution operations, multiple attention mechanisms and pyramid pooling through the functions of each module in the model to achieve high-precision defect detection, and can quickly and accurately identify and classify various defect types on wind turbine blades.

[0021] The present invention provides a target defect detection method based on an improved YOLOv5 algorithm, which is applied to a target defect detection training model based on an improved YOLOv5 algorithm provided by the above scheme, and comprises the following steps:

[0022] Constructing a data set based on the fan blade image, inputting the data set into the target defect detection training model, performing model training, obtaining the trained YOLOv5 model, and obtaining the current detection image based on the data set;

[0023] Based on the trained YOLOv5 model, defect detection is performed on the current detection image to obtain the defect detection result.

[0024] The above solution constructs a data set to train the improved target defect detection training model, and performs defect detection based on the trained YOLOv5 model. Combining the self-made data set and advanced detection algorithms, it not only achieves refined defect identification, but also obtains detection results containing detailed defect information, providing a basis for subsequent maintenance and repair.

[0025] Furthermore, the step constructs a data set based on the fan blade image to input the data set into the target defect detection training model, perform model training, obtain the trained YOLOv5 model, and obtain the current detection image based on the data set, including: performing image preprocessing on the collected fan blade image based on the CLAHE algorithm, and performing data enhancement on the preprocessed image based on a preset geometric transformation method, a preset image adjustment method, and a preset noise processing method to construct a data set, and obtain the current detection image based on the data set; inputting the data set into the target defect detection training model, performing model training, and obtaining the trained YOLOv5 model.

[0026] The above scheme processes and enhances the collected wind turbine blade images by using the CLAHE algorithm to enhance local contrast, highlight defect features, and ensure the accuracy and consistency of the data.

[0027] Furthermore, the step performs defect detection on the current detection image based on the trained YOLOv5 model to obtain a defect detection result, including: receiving the current detection image; performing feature extraction on the current detection image through a multi-scale switchable hole convolution operation based on the SAConv module to obtain a first feature map; performing feature fusion on the first feature map through a fused polarization self-attention mechanism based on the PSA module to obtain a second feature map; performing coordinate attention weighting on the second feature map through a coordinate attention mechanism based on the CoordAtt module to obtain a third feature map; performing multi-scale target detection and recognition on the third feature map through pyramid pooling based on the PPM module to obtain a defect detection result; and outputting feedback defect detection results.

[0028] In the above scheme, the response of the model at different scales is optimized by fusing multi-scale switchable dilated convolutions; the polarized self-attention mechanism is introduced to enhance the focus on the key features of defects, effectively reduce the interference of background noise, improve the robustness of the model under complex lighting and dynamic backgrounds, and reduce missed detection and false detection rates; the introduction of the coordinate attention mechanism can accurately handle the positioning problem of small target defects and improve the model's perception and detection capabilities for subtle defects; combined with the multi-scale feature extraction capability of pyramid pooling, it ensures that the model can still maintain a high level of detection accuracy when facing targets of different sizes, which is particularly suitable for identifying small defects such as cracks and wear on blades. The ability to detect defects in complex backgrounds has been significantly improved, and the ability to detect small targets and complex texture defects on wind turbine blades has been strengthened.

[0029] The present invention provides a target defect detection method based on an improved YOLOv5 algorithm. On the basis of a traditional YOLOv5 architecture, a multi-scale switchable dilated convolution module is integrated with a polarization self-attention mechanism, a coordinate attention mechanism and a pyramid pooling module are introduced, and a data set is constructed for training. Image preprocessing and data enhancement are performed before image detection to ensure accurate response to defects of different scales, enhance the model's attention to key features, significantly reduce interference information in complex backgrounds, improve the model's detection accuracy in complex scenes, and enhance the detection capability of small targets and complex texture defects on wind turbine blades.

[0030] The present invention also provides a target defect detection system based on an improved YOLOv5 algorithm, which is used to adopt a target defect detection training model based on the improved YOLOv5 algorithm to implement a target defect detection method based on the improved YOLOv5 algorithm, including:

[0031] A data preprocessing unit, used to construct a data set based on the fan blade image, input the data set into the target defect detection training model, perform model training, obtain the trained YOLOv5 model, and obtain the current detection image based on the data set;

[0032] The target defect detection unit is used to perform defect detection on the current detection image based on the trained YOLOv5 model to obtain the defect detection result.

[0033] In the above scheme, the system constructs a data set through the data preprocessing unit to train the improved target defect detection training model, and performs defect detection based on the trained YOLOv5 model through the target defect detection unit. Combining the self-made data set and advanced detection algorithms, refined defect identification is achieved, and detection results containing detailed defect information are obtained, providing a basis for subsequent maintenance and repair.

[0034] Furthermore, the target defect detection unit includes: an image input subunit, which is used to receive the current detection image; a feature extraction subunit, which is used to extract features of the current detection image through a multi-scale switchable hole convolution operation based on the SAConv module to obtain a first feature map; a feature fusion subunit, which is used to fuse the first feature map through a fused polarization self-attention mechanism based on the PSA module to obtain a second feature map; an attention weighting subunit, which is used to perform coordinate attention weighting on the second feature map through a coordinate attention mechanism based on the CoordAtt module to obtain a third feature map; a detection and recognition subunit, which is used to perform multi-scale target detection and recognition on the third feature map through pyramid pooling based on the PPM module to obtain a defect detection result; and a result output subunit, which is used to output feedback defect detection results.

[0035] In the above scheme, by integrating multi-scale switchable void convolution and polarization self-attention mechanism, introducing coordinate attention mechanism and pyramid pooling module, the system's defect detection capability in complex background is significantly improved: SAConv can adaptively adjust the void rate and optimize the model's response at different scales, especially small targets in complex background; PSA module enhances the focus on key features of defects, effectively reduces the interference of background noise, improves the robustness of the model in complex lighting and dynamic background, reduces missed detection and false detection rates, and enhances the detection capability of small targets and complex texture defects on wind turbine blades; CoordAtt can accurately handle the positioning problem of small target defects and improve the model's perception and detection capability of subtle defects; combined with PPM's multi-scale feature extraction capability, it ensures that the model can still maintain a high level of detection accuracy when facing targets of different sizes, which is particularly suitable for identifying small defects such as cracks and wear on blades.

[0036] The present invention provides a target defect detection system based on the improved YOLOv5 algorithm. The system structure is simple. Through the interaction between various units, an improved detection model based on the YOLOv5 algorithm is constructed. Multi-scale convolution operations, multiple attention mechanisms and pyramid pooling are introduced to perform defect detection, thereby achieving high-precision defect detection, and being able to quickly and accurately identify and classify various defect types on wind turbine blades. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of a target defect detection training model based on an improved YOLOv5 algorithm provided in one embodiment of the present invention;

[0038] Figure 2 A schematic diagram of the structure of a SAConv module provided in one embodiment of the present invention;

[0039] Figure 3 A schematic diagram of a PSA module structure provided by an embodiment of the present invention;

[0040] Figure 4 A CoordAtt schematic diagram provided for an embodiment of the present invention;

[0041] Figure 5 A schematic diagram of a PPM module structure provided by an embodiment of the present invention;

[0042] Figure 6 A schematic diagram of a target defect detection process based on an improved YOLOv5 algorithm provided by an embodiment of the present invention;

[0043] Figure 7 A schematic diagram of a YOLOv5 model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] Embodiment 1:

[0046] This embodiment provides a target defect detection training model based on an improved YOLOv5 algorithm, such as Figure 1 As shown, the model includes: input module, SAConv module, PSA module, CoordAtt module, PPM module, output module; among which:

[0047] The input module is used to receive the target processing image;

[0048] The SAConv module is used to extract features of the target processed image through a multi-scale switchable dilated convolution operation to obtain a first feature map;

[0049] The PSA module is used to perform feature fusion on the first feature map by fusing the polarized self-attention mechanism to obtain a second feature map;

[0050] The CoordAtt module is used to perform coordinate attention weighting on the second feature map through a coordinate attention mechanism to obtain a third feature map;

[0051] The PPM module is used to perform multi-scale target detection and recognition on the third feature map through pyramid pooling to obtain defect detection results;

[0052] The output module is used to output and feedback defect detection results.

[0053] The above embodiment improves the YOLOv5 model by introducing multi-scale convolution operations, multiple attention mechanisms and pyramid pooling, thereby further improving the performance of the model, improving the ability to recognize multi-scale targets, improving the detection accuracy of small target defects in complex scenarios, and reducing missed detection and false detection rates.

[0054] Optionally, the SAConv module includes a multi-scale convolution sub-module and a reduction optimization sub-module, wherein: the multi-scale convolution sub-module is used to perform multi-scale convolution operations on the target processing image based on several preset void rates and in combination with preset corresponding convolution kernels to generate a multi-scale feature map; the reduction optimization sub-module is used to fuse and splice the multi-scale feature maps through a concat operation, and reduce the number of channels based on the preset reduction convolution to obtain a first feature map.

[0055] In the specific implementation process, in order to achieve multi-scale receptive fields, the multi-scale convolution submodule first selects three different atrous rates for convolution (Conv) operations: an atrous rate of 1 is used to capture the detailed features of small targets, an atrous rate of 2 is used to moderately expand the receptive field and capture medium-scale targets, and an atrous rate of 4 is used to expand the receptive field and capture large-scale defects and contextual information. Under different atrous rates, convolution kernels of different sizes are designed: small targets use a standard 3x3 convolution kernel combined with an atrous rate of 1, medium targets use a 3x3 convolution kernel combined with an atrous rate of 2, and large-scale targets use a 5x5 convolution kernel combined with an atrous rate of 4 to ensure that more background information is captured. Next, three convolution operations with different atrous rates are applied to the input target processing image, and each atrous rate corresponds to an independent convolution operation to generate a multi-scale feature map. After the convolution operation, three groups of multi-scale feature maps are generated, each group representing the information captured under different receptive fields. Finally, the reduction optimization submodule concatenates the multi-scale feature maps from convolutions with different dilation rates through a concat operation to obtain a composite feature map that integrates multi-scale information, and uses a 1x1 convolution to reduce the number of channels of the fused feature map to obtain the first feature map to avoid excessive computational overhead.

[0056] In the specific implementation process, the designed SAConv module needs to be integrated into the YOLOv5 model to replace the original convolution layer. The specific steps are as follows: First, select the position of the deep convolution layer in the backbone network (Backbone) of the YOLOv5 model to integrate the SAConv module. Usually, the convolution layer with higher semantic information in the feature map is selected to enhance the multi-scale feature extraction capability. Then, replace the original MPConv (Max-Pooling Convolution) layer of YOLOv5 with the designed SAConv module, so that the model has multi-scale receptive field capabilities in the feature extraction stage. In the replacement process, the convolution operation with a fixed receptive field used in YOLOv5 is replaced with the multi-void rate convolution operation of SAConv, specifically: in each original convolution operation position, it is replaced with three convolution operations with different void rates, and their outputs are fused through the concat operation. Finally, after integrating SAConv, the void ratio and convolution kernel size are optimized. By adjusting the range of void ratio (such as r = 1, 2, 4) and combining specific convolution kernel sizes (such as 3x3 and 5x5), the optimal parameters suitable for wind turbine blade defect detection are found to ensure the best detection effect of multi-scale targets. The SAConv structure is as follows: Figure 2As shown in the figure, the input target processing image is subjected to global average pooling (Global AvgPool) and convolution operations by Pre-Global Context, and then average pooling (AvgPool) by Switchable Atrous Convolution (SAConv), and then convolution operations are performed with different hole rates to obtain multi-scale feature maps. Finally, global average pooling and convolution operations are performed by Post-Global Context to complete fusion and channel reduction.

[0057] Optionally, the PSA module includes a channel self-attention submodule, a spatial sub-attention submodule and a fusion submodule, wherein: the channel self-attention submodule is used to process the first feature map through global average pooling, compress the spatial information of each channel into a single scalar, and output the weight of each channel through a preset fully connected layer and an activation layer to obtain channel attention information; the spatial sub-attention submodule is used to process the first feature map through global average pooling, and through a preset fully connected layer, use a sigmoid function to determine the weight of each spatial position in the first feature map to obtain spatial attention information; the fusion submodule is used to weightedly fuse the channel attention information and the spatial attention information to obtain merged attention information, so as to perform feature re-adjustment on the first feature map based on the merged attention information to obtain the second feature map.

[0058] In the specific implementation process, firstly, the polarized self-attention mechanism module is integrated at a suitable position in the YOLOv5 model. The PSA module is usually inserted after the deep convolutional layer of feature extraction, especially after the output of each residual block or the merging point of the feature pyramid network (FPN). The feature maps at these positions are rich in semantic information and suitable for in-depth feature re-adjustment. Then the PSA module is designed. The PSA module contains two main parts: the channel attention branch and the spatial attention branch. Finally, the PSA module is fused: the designed PSA module is integrated into the selected position of YOLOv5. Finally, the parameters are optimized and integrated into the network: the parameters in the PSA module are adjusted, and the number of neurons in the middle fully connected layer is usually set to a certain proportion of the number of input channels (such as 1 / 16) to reduce the computational complexity and prevent overfitting. That is, after the module design is completed, the configuration of the PSA module is added to the network configuration file of YOLOv5 to ensure that the module is correctly instantiated and trained in the network. During the training process, these parameters are fine-tuned to ensure that the PSA module can effectively enhance the model's ability to recognize defects in wind turbine blades.

[0059] In the specific implementation process, the PSA module is as follows Figure 3As shown in the figure, after the input feature map (here is the first feature map), it is processed by the channel self-attention branch and the spatial self-attention branch. The channel attention and spatial attention will be multiplied by the first feature map respectively: the channel attention is processed by global average pooling to compress the spatial information of each channel into a single scalar, and then passes through a scaled fully connected layer and ReLU activation layer, after convolution, reshaping (Reshape), activation (Softmax), and finally through a LayerNorm Sigmoid activation layer to output the weight of each channel; spatial attention also starts from Global Pooling, then passes through a fully connected layer, after convolution, reshaping, activation, etc., and finally through the Reshape Sigmoid layer using the sigmoid function to determine the importance of each spatial position. The importance of each channel and each spatial position in the feature map is adjusted separately, and then the two adjustments are weighted summed to merge the channel and spatial attention information, and the feature map is output (the output here is the second feature map). The channel branch, spatial branch and fusion process satisfy the following formula:

[0060] (1) Channel branch, A ch (X)∈R C×1×1 :

[0061]

[0062] (2) Space branch, A sp (X)∈R 1×H×W :

[0063] A sp (X) = F SG [σ3(F SM (σ1(F GP (W q (X))))×σ2(W v (X)))+

[0064]

[0065] (3) The outputs of the two branches are first subjected to channel attention, then spatial attention, and finally fused in parallel to achieve in-depth feature re-adjustment based on the first feature map and obtain attention information:

[0066] PSA p (X) = Z ch +Z sp =A ch (X)⊙ ch X+A sp (X)⊙ sp X

[0067] Where: A ch (X) represents the channel attention branch, σ1 and σ2 represent different sigmoid functions; A sp (X) represents the spatial attention branch, W and H are the width and height of the input feature, σ1, σ2, σ3 represent different sigmoid functions, and F SG represents the first feature map, F GP (X) represents the output spatial attention, i and j are used to determine the position of the feature points; PSA p (X) indicates the merged attention information.

[0068] Optionally, the CoordAtt module includes a coordinate information embedding submodule, a coordinate attention generation submodule and an attention weighting submodule, wherein: the coordinate information embedding submodule is used to use 2D global pooling to sample the input second feature map along the horizontal and vertical dimensions respectively, and preset corresponding pooling kernels for coordinate encoding to obtain a horizontally aggregated feature map and a vertically aggregated feature map; the coordinate attention generation submodule is used to cascade the horizontally aggregated feature map and the vertically aggregated feature map into an overall feature map through a concat operation, and input them into a preset convolution transformation function to obtain an intermediate feature tensor, and split it into a horizontal feature tensor and a vertical feature tensor based on the intermediate feature tensor; the attention weighting submodule is used to use two independent preset convolution operations to process the horizontal feature tensor and the vertical feature tensor respectively, to generate horizontal attention weights and vertical attention weights respectively, and obtain the coordinate attention weight based on the horizontal attention weights and the vertical attention weights to obtain a third feature map.

[0069] In the specific implementation process, the design purpose of the CoordAtt module is to enhance the model's ability to locate small targets and complex texture defects, especially in complex environments such as wind turbine blades. CoordAtt (coordinate attention mechanism) Figure 4 As shown, it is divided into 4 steps:

[0070] (1) Coordinate information embedding, that is, the coordinate information embedding submodule captures long-distance dependencies and retains precise location information. Using 2D global pooling (Avg Pool), the input 2D feature map (here is the second feature map) is encoded along the horizontal (H direction) and vertical (W direction) dimensions after the Residual layer, as shown below:

[0071] Horizontal coordinate encoding: For each channel, a pooling kernel with a shape of (H, 1) is used to encode along the horizontal direction, specifically satisfying the following formula:

[0072]

[0073] Where: represents the horizontal coordinate encoding, i represents the coordinates of the feature point, and h represents the height of the input feature;

[0074] For vertical coordinate encoding, a pooling kernel with a shape of (1, W) is used for each channel to encode along the vertical direction, specifically satisfying the following formula:

[0075]

[0076] Where: represents the vertical coordinate encoding, j represents the coordinates of the feature point, and w represents the width of the input feature;

[0077] (2) Coordinate attention generation, that is, the coordinate attention generation submodule performs a concat operation on the aggregated feature maps in the horizontal and vertical directions, cascades them into an overall feature map, and then inputs them into a 1×1 convolution transformation function through BatchNom and Non-linear to obtain an intermediate feature tensor, and then splits it into a horizontal feature tensor and a vertical feature tensor based on the intermediate feature tensor, specifically satisfying the following formula:

[0078] f=δ(F1(z h ,z w ))

[0079] Where: f represents the intermediate feature, δ represents the activation function, F1 represents the 1×1 convolution transformation function, z h Represents the aggregated feature map in the horizontal direction, z w Represents the aggregated feature map in the vertical direction;

[0080] (3) Feature remapping, that is, the attention weighted submodule uses two independent 1×1 convolution operations to process the horizontal feature f respectively. h and vertical feature f w , transform them back to tensors with the same number of channels as the input feature map, and finally generate the attention weights g in the horizontal and vertical directions respectively h and g w , specifically satisfying the following formula:

[0081] g h =σ(F h (f h ))

[0082] g w =σ(F w (f w ))

[0083] Where: σ represents the activation function, F h 、F w represents the convolution transformation function, f h represents the horizontal feature, fw Represents vertical features, g h It represents the output of the horizontal feature after the convolution transformation function and the activation function, g w Represents the output of the vertical feature after the convolution transformation function and activation function;

[0084] (4) Attention weight generation, that is, the attention weighted submodule will output g h and g w Expand them and use them as attention weights respectively, and the output formula of the coordinate attention block is expressed as:

[0085]

[0086] Where: y c (i, j) represents the coordinate attention block, i and j are used to determine the coordinates of the feature points;

[0087] Finally, the second feature map is weighted by Re-weight learning and the third feature map is output.

[0088] In the specific implementation process, after designing the CoordAtt module, it is integrated into the Neck layer of the YOLOv5 model. The specific integration steps are as follows: First, in the Neck layer (feature pyramid network FPN) of the YOLOv5 model, select a suitable position to insert the CoordAtt module. It is usually placed at the position after feature fusion to enhance the model's perception of target position information. It is mainly used to process small target defects and subtle texture defects in complex scenes. Then, the designed CoordAtt module is embedded in the feature pyramid network of the Neck layer so that it can pay attention to the coordinates of each second feature map during the feature fusion process. In FPN, each layer of feature maps after the CoordAtt module can more effectively capture the position and size characteristics of the target, thereby improving the model's detection accuracy for small targets. Finally, by adjusting the 1×1 convolution kernel size and weight generation method in CoordAtt, it is ensured that it is suitable for the wind turbine blade defect detection task, especially when detecting smaller defects, it can be more accurately positioned. By tuning the module parameters through experiments and monitoring the false alarm rate and missed detection rate of the model, we can ensure that the CoordAtt module performs optimally in complex scenarios.

[0089] Optionally, the PPM module includes a pooling submodule and a fusion submodule, wherein: the pooling submodule is used to perform pooling operations on the third feature map in an adaptive average pooling manner based on several pooling kernels of different sizes to obtain several pooling feature maps; the fusion submodule is used to reduce the number of channels of the several pooling feature maps through a preset reduction convolution, and upsample them to a preset sampling size through bilinear interpolation to obtain several upsampled pooling feature maps, and use a concat operation to merge the several upsampled pooling feature maps to obtain a composite feature map, so as to perform target detection and recognition and obtain defect detection results.

[0090] In the specific implementation process, in order to enhance the detection capability of the YOLOv5 model in processing defects of various scales in the wind turbine blade data set, especially for large-scale corrosion defects, the pyramid pooling module (PPM) is integrated into the YOLOv5 backbone network to reduce missed detection and improve detection accuracy by better utilizing multi-scale information. The PPM structure is as follows Figure 5 As shown in the figure, first, in the configuration file of the model, based on the rich semantic information and large receptive field of the feature map of the model output layer, the output layer of the last CSP module is selected as the embedding position of PPM; next, the PPM module is designed to include four pooling kernels of different sizes: 1×1, 2×2, 3×3, and 6×6. The pooling operation (pool) of each size uses adaptive average pooling to capture the key feature information of each scale without losing important details; the number of channels of the output of each scale is reduced, and 1×1 convolution is used to reduce the depth of each pooling output to reduce the subsequent computational burden; then, all resized feature maps are upsampled (UpSample) to the same size as the largest feature map through bilinear interpolation, ensuring that feature maps of different sizes can be effectively fused at the same scale; then, the concat operation is used to merge these feature maps into a unified composite feature map, integrating information from the most subtle to the broadest receptive field; finally, the designed PPM module is integrated into the YOLOv5 network to ensure that the newly added module is seamlessly connected to the original architecture, and the parameters of the PPM module are fine-tuned, including adjusting the number of filters and step size of the 1×1 convolution to optimize performance and efficiency.

[0091] This embodiment proposes a target defect detection training model based on the improved YOLOv5 algorithm, which introduces multi-scale convolution operations, multiple attention mechanisms and pyramid pooling through the functions of each module in the model to achieve high-precision defect detection, and can quickly and accurately identify and classify various defect types on wind turbine blades.

[0092] Embodiment 2:

[0093] This embodiment provides a target defect detection method based on an improved YOLOv5 algorithm. The method is applied to a target defect detection training model based on an improved YOLOv5 algorithm provided in the above solution, and includes the following steps:

[0094] Constructing a data set based on the fan blade image, inputting the data set into the target defect detection training model, performing model training, obtaining the trained YOLOv5 model, and obtaining the current detection image based on the data set;

[0095] Based on the trained YOLOv5 model, defect detection is performed on the current detection image to obtain the defect detection result.

[0096] This embodiment constructs a data set to train the improved target defect detection training model, and performs defect detection based on the trained YOLOv5 model. Combining the self-made data set and advanced detection algorithms, it not only achieves refined defect identification, but also can obtain detection results containing detailed defect information, providing a basis for subsequent maintenance and repair.

[0097] Optionally, the step constructs a data set based on the fan blade image, inputs the data set into the target defect detection training model, performs model training, obtains the trained YOLOv5 model, and obtains the current detection image based on the data set, including: performing image preprocessing on the collected fan blade image based on the CLAHE algorithm, and performing data enhancement on the preprocessed image based on a preset geometric transformation method, a preset image adjustment method, and a preset noise processing method to construct a data set, and obtains the current detection image based on the data set; inputs the data set into the target defect detection training model, performs model training, and obtains the trained YOLOv5 model.

[0098] In the specific implementation process, before defect detection of wind turbine blades, the collected wind turbine blade image data is preprocessed based on the contrast-limited adaptive histogram equalization algorithm (CLAHE) to improve the visibility of defects and optimize the subsequent detection efficiency. The collected wind turbine blade image data is a wind turbine blade target detection dataset obtained by drone aerial photography in actual scenes. First, the image is divided into small blocks (the size of tiles is 8x8); then histogram equalization is applied independently to each small block, and contrast enhancement is performed in each area. In order to avoid excessive noise in each small area, contrast limitation is used to avoid excessive contrast during histogram equalization. For any histogram interval above the specified contrast limit, the additional pixels will be evenly distributed to other intervals; finally, the bilinear interpolation algorithm is used to eliminate visible defects at the block boundaries, and the blocks are interpolated according to the corresponding values ​​of adjacent blocks, providing high-quality input data for subsequent defect detection steps.

[0099] In the specific implementation process, the wind turbine blade target detection dataset is systematically enhanced, that is, the pre-processed images are enhanced based on the preset geometric transformation method, the preset image adjustment method and the preset noise processing method to simulate the conditions that may be encountered in various actual operating environments and enhance the generalization ability and robustness of the model: first, the pre-processed images are subjected to random geometric transformations, including random rotation (±30 degrees), horizontal and vertical flipping, and scaling (0.8 to 1.2 times). These transformations simulate the different perspectives and size changes that the wind turbine blades may present in actual operation due to different installation angles and wind forces; then, the brightness and contrast of the image are adjusted. To simulate different lighting conditions from dawn to dusk, the brightness is adjusted within the range of ±20% of the original brightness, and the contrast is adjusted by ±15% on the original basis. This step ensures that the model can accurately identify defects under various lighting conditions. To further enhance the robustness of the model to environmental noise, Gaussian noise is added to the image to simulate the image noise introduced by equipment vibration or environmental factors (such as high wind speed) during actual shooting. By applying different degrees of Gaussian blur (the blur kernel size ranges from 3x3 to 5x5), the inaccurate focus caused by the rapid movement of the drone or the influence of wind speed is simulated to ensure that the model can effectively detect defects in slightly to moderately blurred images.

[0100] In the specific implementation process, after completing data processing and data set construction, the improved YOLOv5 model is used for training. First, the hyperparameters of the model need to be configured, including learning rate, batch size, and number of iterations. The processed wind turbine blade target detection dataset is divided into a training set and a validation set to ensure that the model can perform effective generalization evaluation during the training process. During the entire network training process, the loss function and accuracy are monitored, and the performance of the model is monitored to adjust the hyperparameters to ensure that the model achieves the best performance in defect detection tasks and optimize the actual application effect of the model. Special attention is paid to whether the model's detection ability for large-scale defects has been improved, ensuring that structural improvements can effectively reduce missed detections and improve overall defect detection accuracy.

[0101] Optionally, the step performs defect detection on the current detection image based on the trained YOLOv5 model to obtain a defect detection result, including: receiving the current detection image; performing feature extraction on the current detection image through a multi-scale switchable hole convolution operation based on the SAConv module to obtain a first feature map; performing feature fusion on the first feature map through a fused polarization self-attention mechanism based on the PSA module to obtain a second feature map; performing coordinate attention weighting on the second feature map through a coordinate attention mechanism based on the CoordAtt module to obtain a third feature map; performing multi-scale target detection and recognition on the third feature map through pyramid pooling based on the PPM module to obtain a defect detection result; and outputting feedback defect detection results.

[0102] In the specific implementation process, after the training is completed, the trained YOLOv5 model is used to detect defects in the newly collected wind turbine blade images. The model will analyze the current detection image, and the system can quickly identify potential defects, output the location, category and coordinates of the bounding box of the defect, and provide necessary support for the maintenance of the wind turbine. In addition, based on the analysis and feedback of the defect detection results, the parameter configuration and network structure of the model are adjusted to further improve the detection performance. This may include redesigning the attention mechanism, adjusting the parameters of the pyramid pooling module, or performing more training iterations on the data set. By continuously optimizing the model, its adaptability and robustness in various complex environments are ensured, thereby improving the overall effect of wind turbine blade defect detection.

[0103] This embodiment optimizes the response of the model at different scales by fusing multi-scale switchable dilated convolutions; introduces a polarized self-attention mechanism to enhance attention to key features of defects, effectively reduces interference from background noise, improves the robustness of the model under complex lighting and dynamic backgrounds, and reduces missed detection and false detection rates; introduces a coordinate attention mechanism to accurately handle the positioning of small target defects, and improves the model's perception and detection capabilities for subtle defects; combines the multi-scale feature extraction capabilities of pyramid pooling to ensure that the model can still maintain a high level of detection accuracy when facing targets of different sizes, and is particularly suitable for identifying small-sized defects such as cracks and wear on blades. The ability to detect defects in complex backgrounds has been significantly improved, and the ability to detect small targets and complex texture defects on wind turbine blades has been strengthened.

[0104] In the specific implementation process, the defect detection method for wind turbine blades based on the improved YOLOv5 algorithm provided in this embodiment can also use traditional image processing methods combined with simple machine learning algorithms for defect detection. For example, cracks and structural defects are identified by edge detection algorithms, and then defect classification is performed in combination with support vector machines (SVM). This method can provide a more economical solution when computing resources are limited.

[0105] The present embodiment provides a target defect detection method based on an improved YOLOv5 algorithm. On the basis of a traditional YOLOv5 architecture, a multi-scale switchable hole convolution module is integrated with a polarization self-attention mechanism, a coordinate attention mechanism and a pyramid pooling module are introduced, and a data set is constructed for training. Image preprocessing and data enhancement are performed before image detection to ensure accurate response to defects of different scales, enhance the model's attention to key features, significantly reduce interference information in complex backgrounds, improve the model's detection accuracy in complex scenes, and enhance the detection capability of small targets and complex texture defects on wind turbine blades.

[0106] Embodiment three:

[0107] This embodiment provides a target defect detection system based on an improved YOLOv5 algorithm, which is used to adopt a target defect detection training model based on the improved YOLOv5 algorithm to implement a target defect detection method based on the improved YOLOv5 algorithm, including:

[0108] A data preprocessing unit, used to construct a data set based on the fan blade image, input the data set into the target defect detection training model, perform model training, obtain the trained YOLOv5 model, and obtain the current detection image based on the data set;

[0109] The target defect detection unit is used to perform defect detection on the current detection image based on the trained YOLOv5 model to obtain the defect detection result.

[0110] The system provided in this embodiment constructs a data set through a data preprocessing unit to train the improved target defect detection training model, and performs defect detection based on the trained YOLOv5 model through a target defect detection unit. By combining a self-made data set and advanced detection algorithms, refined defect identification is achieved, and detection results containing detailed defect information are obtained, providing a basis for subsequent maintenance and repair.

[0111] Optionally, the target defect detection unit includes: an image input subunit, used to receive a current detection image; a feature extraction subunit, used to perform feature extraction on the current detection image through a multi-scale switchable hole convolution operation based on the SAConv module to obtain a first feature map; a feature fusion subunit, used to perform feature fusion on the first feature map based on the PSA module through a fused polarization self-attention mechanism to obtain a second feature map; an attention weighting subunit, used to perform coordinate attention weighting on the second feature map through a coordinate attention mechanism based on the CoordAtt module to obtain a third feature map; a detection and recognition subunit, used to perform multi-scale target detection and recognition on the third feature map through pyramid pooling based on the PPM module to obtain a defect detection result; and a result output subunit, used to output feedback defect detection results.

[0112] In the specific implementation process, the target defect detection unit in this embodiment is the trained YOLOv5 model. The improved YOLOv5 algorithm can accurately identify subtle defects (such as cracks, corrosion, sand holes, etc.) on wind turbine blades in an environment with large background noise, drastic light changes or high wind speed. This technical solution can be widely used in automated inspections of wind farms, real-time monitoring of wind turbine operating status, timely detection of potential blade damage, and prevention of major equipment failures. In addition, it can also provide support for intelligent maintenance of wind farms, optimize maintenance plans and response times, reduce operation and maintenance costs, and improve the overall operating efficiency and safety of wind farms. In particular, when wind farms are deployed in remote areas or areas with extreme natural conditions, the application of this embodiment can significantly enhance the monitoring and maintenance of wind turbine blades and ensure the continuity and stability of energy production.

[0113] The present embodiment provides a target defect detection system based on an improved YOLOv5 algorithm. The system has a simple structure. Through the interaction between various units, an improved detection model based on the YOLOv5 algorithm is constructed. Multi-scale convolution operations, multiple attention mechanisms, and pyramid pooling are introduced to perform defect detection, thereby achieving high-precision defect detection, and being able to quickly and accurately identify and classify various defect types on wind turbine blades.

[0114] Embodiment 4:

[0115] This embodiment also provides a target defect detection process based on the improved YOLOv5 algorithm, such as Figure 6 As shown, it includes the following processes:

[0116] start;

[0117] UAV aerial photography collects target processing images;

[0118] Perform image preprocessing and data enhancement on the target processing image based on the CLAHE algorithm to obtain the original feature map;

[0119] YOLOv5 feature extraction: The SAConv module is embedded in the Backbone layer of YOLOv5 to extract features from the original feature map based on a multi-scale switchable dilated convolution operation to obtain the first feature map;

[0120] YOLOv5 feature fusion: The PSA module is embedded in the FPN layer of YOLOv5 to fuse the first feature map through the polarized self-attention mechanism of the fusion channel branch and the spatial branch to obtain the second feature map;

[0121] Embed CoordAtt module: The CoordAtt module is embedded in the YOLOv5 backbone network to perform coordinate attention weighting on the second feature map through the coordinate attention mechanism to obtain the third feature map;

[0122] Object detection and recognition: The PPM module is embedded in the YOLOv5 backbone network to perform multi-scale object detection and recognition on the third feature map through pyramid pooling to obtain defect detection results;

[0123] Optimize the model and adjust the parameters of the improved YOLOv5;

[0124] Conduct result analysis and output defect detection results;

[0125] Finish.

[0126] In the specific implementation process, the YOLOv5 model structure is as follows Figure 7 As shown in the figure, it includes a backbone network, a path aggregation network and an output module. The backbone network includes Focus, several CBS, CSP, and SPPF; the path aggregation network contains several CBS, upsampling layers, Concat, and CSP; the output module outputs through Conv (such as y1, y2, and y3 in the figure). The preprocessing module inputs the original feature map into the Focus of the backbone network after image preprocessing, cropping, and scaling.

[0127] In the specific implementation process, the process provided in this embodiment first pre-processes the target processing image collected by drone aerial photography, and uses the CLAHE algorithm to process the self-made YOLOv5 target defect detection data set to enhance the local contrast and highlight the defect features. The pre-processed image is manually and semi-automatically annotated through the annotation tool to ensure the accuracy and consistency of the data; then YOLOv5 is improved, and the SAConv module is embedded. Through convolution operations with different void rates (1, 2, 4), small, medium and large-scale target features are captured respectively, and multi-scale feature maps are fused to enhance the model's perception of multi-scale targets; PSA (self-attention mechanism) is integrated into the backbone network of YOLOv5, and the correlation information between feature maps is accurately captured and processed through channel and spatial branches, further improving the model's ability to perceive complex At the same time, CoordAtt (coordinate attention mechanism) is introduced in the Neck layer to enhance the model's perception of target location information by embedding coordinate information, especially to improve the positioning accuracy of small target defects in complex scenarios; in addition, the model's detection capability for multi-scale targets is further enhanced by embedding PPM (pyramid pooling module) to ensure that wind turbine blade defects of various scales can be identified; finally, the optimized YOLOv5 model realizes high-precision defect detection, which can quickly and accurately identify and classify various defect types on wind turbine blades. Combined with self-made datasets and advanced detection algorithms, the model not only realizes refined defect recognition, but also can automatically generate a test report containing detailed defect information, providing a basis for subsequent maintenance and repair, and continuously optimizing the model according to the test results.

[0128] The process proposed in this embodiment pre-processes the data set by adopting a restricted contrast adaptive equalization algorithm to reduce the impact of factors such as complex background and motion blur on the quality of the data set, and improves the detection capability of the YOLOv5 model: introduces multi-scale switchable hole convolution, and processes targets of different scales by adjusting the hole rate, so that the model can flexibly capture defect features from small to large; introduces a polarization self-attention mechanism in the backbone network, so that the model can pay more attention to the blade defect features, ignore minor background features, and improve the recognition and positioning capabilities of target defects; introduces a coordinate attention mechanism in the feature pyramid network to optimize the model's processing capabilities for complex textures and small target defects; finally, introduces a pyramid pooling module at the end of the backbone network to improve the recognition capability of multi-scale targets, further improve the performance of the model, and help improve inspection efficiency.

[0129] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A target defect detection training model based on an improved YOLOv5 algorithm, characterized in that: include: Input module, SAConv module, PSA module, CoordAtt module, PPM module, output module; among them: The input module is used to receive the target processing image; The SAConv module is used to extract features of the target processed image through a multi-scale switchable dilated convolution operation to obtain a first feature map; The PSA module is used to perform feature fusion on the first feature map by fusing the polarized self-attention mechanism to obtain a second feature map; The CoordAtt module is used to perform coordinate attention weighting on the second feature map through a coordinate attention mechanism to obtain a third feature map; The PPM module is used to perform multi-scale target detection and recognition on the third feature map through pyramid pooling to obtain defect detection results; The output module is used to output and feedback defect detection results.

2. According to claim 1, a target defect detection training model based on an improved YOLOv5 algorithm is characterized in that: The SAConv module includes a multi-scale convolution submodule and a reduction optimization submodule, wherein: The multi-scale convolution submodule is used to perform multi-scale convolution operations on the target processing image based on several preset void rates and in combination with preset corresponding convolution kernels to generate a multi-scale feature map; The reduction optimization submodule is used to fuse and splice multi-scale feature maps through a concat operation, and reduce the number of channels based on a preset reduction convolution to obtain a first feature map.

3. The target defect detection training model based on the improved YOLOv5 algorithm according to claim 1, characterized in that: The PSA module includes a channel self-attention submodule, a spatial sub-attention submodule and a fusion submodule, wherein: The channel self-attention submodule is used to process the first feature map through global average pooling, compress the spatial information of each channel into a single scalar, and output the weight of each channel through a preset fully connected layer and an activation layer to obtain channel attention information; The spatial sub-attention submodule is used to process the first feature map by global average pooling, and to determine the weight of each spatial position in the first feature map by using a sigmoid function through a preset fully connected layer to obtain spatial attention information; The fusion submodule is used to perform weighted fusion of the channel attention information and the spatial attention information to obtain merged attention information, so as to re-adjust the features of the first feature map based on the merged attention information to obtain the second feature map.

4. The target defect detection training model based on the improved YOLOv5 algorithm according to claim 1, characterized in that: The CoordAtt module includes a coordinate information embedding submodule, a coordinate attention generation submodule and an attention weighting submodule, wherein: The coordinate information embedding submodule is used to use 2D global pooling to sample the input second feature map along the horizontal and vertical dimensions respectively and preset corresponding pooling kernels for coordinate encoding to obtain a horizontally aggregated feature map and a vertically aggregated feature map; The coordinate attention generation submodule is used to concatenate the horizontal aggregation feature map and the vertical aggregation feature map into an overall feature map through a concat operation, and input it into a preset convolution transformation function to obtain an intermediate feature tensor, and split it into a horizontal feature tensor and a vertical feature tensor based on the intermediate feature tensor; The attention weighting submodule is used to use two independent preset convolution operations to process the horizontal feature tensor and the vertical feature tensor respectively to generate horizontal attention weights and vertical attention weights respectively, and obtain coordinate attention weights based on the horizontal attention weights and the vertical attention weights to obtain a third feature map.

5. The target defect detection training model based on the improved YOLOv5 algorithm according to claim 1, characterized in that: The PPM module includes a pooling submodule and a fusion submodule, wherein: The pooling submodule is used to perform a pooling operation on the third feature map in an adaptive average pooling manner based on a plurality of pooling kernels of different sizes, to obtain a plurality of pooling feature maps; The fusion submodule is used to reduce the number of channels of several pooled feature maps through a preset reduction convolution, and upsample them to a preset sampling size through bilinear interpolation to obtain several upsampled pooled feature maps, and use the concat operation to merge the several upsampled pooled feature maps to obtain a composite feature map for target detection and recognition, and to obtain defect detection results.

6. A target defect detection method based on an improved YOLOv5 algorithm, characterized in that: The method is applied to a target defect detection training model based on an improved YOLOv5 algorithm as described in any one of claims 1 to 5, comprising the following steps: Constructing a data set based on the fan blade image, inputting the data set into the target defect detection training model, performing model training, obtaining the trained YOLOv5 model, and obtaining the current detection image based on the data set; Based on the trained YOLOv5 model, defect detection is performed on the current detection image to obtain the defect detection result.

7. The target defect detection method based on the improved YOLOv5 algorithm according to claim 6 is characterized in that: The step of constructing a data set based on the fan blade image, inputting the data set into the target defect detection training model, performing model training, obtaining a trained YOLOv5 model, and obtaining a current detection image based on the data set includes: Perform image preprocessing on the collected wind turbine blade images based on the CLAHE algorithm, perform data enhancement on the preprocessed images based on a preset geometric transformation method, a preset image adjustment method, and a preset noise processing method to construct a data set, and obtain a current detection image based on the data set; The data set is input into the target defect detection training model to perform model training and obtain the trained YOLOv5 model.

8. The target defect detection method based on the improved YOLOv5 algorithm according to claim 6 is characterized in that: The defect detection is performed on the current detection image based on the trained YOLOv5 model to obtain the defect detection result, including: Receive the current detection image; Based on the SAConv module, a multi-scale switchable hole convolution operation is performed on the current detection image to obtain a first feature map; Based on the PSA module, the first feature map is subjected to feature fusion by fusing the polarized self-attention mechanism to obtain a second feature map; Based on the CoordAtt module, the coordinate attention weighting is performed on the second feature map through the coordinate attention mechanism to obtain the third feature map; Based on the PPM module, multi-scale target detection and recognition are performed on the third feature map through pyramid pooling to obtain defect detection results; Output feedback defect detection results.

9. A target defect detection system based on an improved YOLOv5 algorithm, characterized in that: The method is used to adopt the target defect detection training model based on the improved YOLOv5 algorithm as described in any one of claims 1 to 5 to implement the target defect detection method based on the improved YOLOv5 algorithm as described in any one of claims 6 to 8, comprising: A data preprocessing unit, used to construct a data set based on the fan blade image, input the data set into the target defect detection training model, perform model training, obtain the trained YOLOv5 model, and obtain the current detection image based on the data set; The target defect detection unit is used to perform defect detection on the current detection image based on the trained YOLOv5 model to obtain the defect detection result.

10. The target defect detection system based on the improved YOLOv5 algorithm according to claim 9, characterized in that: The target defect detection unit is used to perform defect detection on the current detection image based on the trained YOLOv5 model to obtain the defect detection result, including: An image input subunit, used for receiving a current detection image; A feature extraction subunit, used to extract features of the current detection image through a multi-scale switchable hole convolution operation based on the SAConv module to obtain a first feature map; A feature fusion subunit, used to perform feature fusion on the first feature map based on the PSA module by fusing the polarized self-attention mechanism to obtain a second feature map; An attention weighting subunit, used for performing coordinate attention weighting on the second feature map through a coordinate attention mechanism based on the CoordAtt module to obtain a third feature map; The detection and recognition subunit is used to perform multi-scale target detection and recognition on the third feature map through pyramid pooling based on the PPM module to obtain defect detection results; The result output subunit is used to output and feedback defect detection results.

Citation Information

Cited By

  • Sound barrier defect detection method and device, electronic equipment and storage medium

    CN120198432A

  • Crop disease and pest segmentation detection method based on TVFNet network model

    CN120543554A

  • Cable surface defect accurate identification method and device for cable cutting machine

    CN120890974A

  • Pavement crack segmentation algorithm based on YOLO11

    CN121236375A

  • Water surface target detection method based on dynamic characteristic modulation

    CN122090043A