Fan surface defect detection method, device and equipment based on lightweight PC-EMA algorithm and storage medium

By introducing the lightweight PC-EMA algorithm and multi-scale feature extraction module into the YOLOv8n model, the problem of slow detection of surface defects in wind turbines and the inability to detect internal defects is solved, and efficient and accurate wind turbine defect detection is achieved.

CN118691573APending Publication Date: 2024-09-24BEIHUA UNIV

Patent Information

Application Number
CN202410791745.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Existing wind turbine surface defect detection methods have problems such as too slow detection speed, inability to effectively detect internal defects, and difficulty in extracting defect features in complex environments, resulting in inaccurate maintenance and waste of resources.

Method used

The YOLOv8n wind turbine defect detection model based on the lightweight PC-EMA algorithm is used. By inserting the PC-EMA module and SPPF module into the backbone network, combined with the GSConv and VoVGSCSP modules, multi-scale feature extraction and lightweight detection heads are designed to optimize losses. function to improve detection efficiency and accuracy.

Benefits of technology

It achieves fast and accurate detection of fan surface and internal defects, reduces model complexity and reasoning time, improves detection speed and accuracy, and reduces resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691573A
    Figure CN118691573A
Patent Text Reader

Abstract

The invention relates to the technical field of fan surface detection, in particular to a fan surface defect detection method, device and equipment based on a lightweight PC-EMA algorithm and a storage medium, and the method comprises the following steps: S1, collecting fan surface defect images, and constructing a fan surface defect image data set; s2, constructing a YOLOv8n and PConv-EMA fusion model, namely sequentially setting five layers of CBS modules from the input end in the backbone network, respectively inserting a PC-EMA module behind the second layer of CBS module and the third layer of CBS module, the third layer of CBS module and the fourth layer of CBS module, the fourth layer of CBS module and the fifth layer of CBS module and the fifth layer of CBS module, and setting an SPPF module behind the last PC-EMA module; the invention provides a light-weight YOLOv8n target detection algorithm and a detection method of the light-weight YOLOv8n target. The model complexity is greatly reduced; a residual module in YOLOv8n is improved, a PConv module and an EMA module are integrated, a residual module for multi-scale feature extraction is designed, the feature expression ability of channel attention is enhanced, and multi-scale feature information can be effectively captured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fan surface detection, and in particular to a fan surface defect detection method, device, equipment and storage medium based on a lightweight PC-EMA algorithm. Background Art

[0002] The existing infrared and ultrasonic detection methods have high detection accuracy and can detect deep and internal defects of wind turbines. However, their disadvantages are that they cannot meet the needs of outdoor real-time detection, the detection process is complicated and costly, and the detection effect of wind turbine surface defects is very poor. The existing wind turbine surface defect detection method is to use drones to remotely fly and shoot wind turbine surface sample images, transmit the sample images to the background, and then use the target detection algorithm for detection, positioning and identification. The current wind turbine defect detection method based on deep learning has the following problems: most algorithms with high detection accuracy have high model calculation complexity, which will cause the detection speed to be too slow when embedded in drone equipment, greatly reducing the detection efficiency. Although the deep learning detection method has high real-time detection, the detection defects are limited to surface defects and cannot effectively detect internal defects. Therefore, various detection methods are insufficient at this stage.

[0003] When the target is in a complex environment, the above algorithms often have difficulty in effectively extracting defect features of wind turbines; the network model cannot integrate multi-scale target features, and the target detection accuracy is insufficient; incorrect defect detection will cause maintenance personnel to use the wrong materials to repair wind turbine defects; short-term defects will be exposed again, and the defect area will also expand accordingly, wasting resources and manpower; currently, there are not many studies on the application of YOLOv8n in UAV system detection of wind turbines. In view of the real-time performance of UAVs in wind turbine defect detection tasks, the accuracy and detection speed of the model still have room for improvement;

[0004] In summary, how to design a lightweight, real-time and efficient YOLOv8n wind turbine defect detection model based on attention mechanism, multi-scale feature fusion, optimized detection head and loss function has become a problem to be solved. Summary of the invention

[0005] The purpose of the present invention is to provide a fan surface defect detection method, device, equipment and storage medium based on a lightweight PC-EMA algorithm to solve the problem that the high calculation complexity of the prior art model leads to slow detection speed, inability to effectively detect internal defects, and waste of resources and manpower.

[0006] In order to achieve the above objectives, the following technical solutions are provided:

[0007] A method for detecting fan surface defects based on a lightweight PC-EMA algorithm comprises the following steps:

[0008] S1: Collect fan surface defect images and build a fan surface defect image dataset;

[0009] S2: Build the YOLOv8n and PConv-EMA fusion model, including:

[0010] In the backbone network, five layers of CBS modules are arranged in sequence from the input end, and a PC-EMA module is inserted after the second layer CBS module and the third layer CBS module, the third layer CBS module and the fourth layer CBS module, the fourth layer CBS module and the fifth layer CBS module, and the fifth layer CBS module, and an SPPF module is arranged after the last PC-EMA module;

[0011] The CBS module is used to extract low-level features of the image, stabilize and accelerate training, and improve the expressiveness of the model. The PC-EMA module is used to improve the expressiveness of features through multi-scale features and local context enhancement. The SPPF module is used to capture features of different scales.

[0012] The PC-EMA modules arranged in sequence from the input end are a first-layer PC-EMA module, a second-layer PC-EMA module, a third-layer PC-EMA module, and a fourth-layer PC-EMA module;

[0013] In the neck network, the ordinary convolutional layer in the original YOLOv8n model is replaced with the GSConv module, and the C2f module is replaced with the VoVGSCSP module; as the neck network of the new fusion model;

[0014] In the head network, the detection head in the original YOLOv8n model is replaced with the PConv Head detection head; it serves as the head network of the new fusion model;

[0015] S3: Use the surface defect images of the fan to train the YOLOv8n and PConv-EMA fusion model;

[0016] S4: Input the surface defect image of the fan to be detected into the trained YOLOv8n and PConv-EMA fusion model to obtain the fan surface defect detection result.

[0017] Preferably, the wind turbine surface defect image dataset is divided into a training set, a validation set and a test set in a ratio of 8:1:1.

[0018] Preferably, the PC-EMA module consists of 1 PConv layer, two 1×1Conv layers and an EMA attention module;

[0019] The CBS module consists of a normal convolution layer, a BN layer, and a Si LU layer;

[0020] In the PC-EMA module, a Split operation is first performed to divide the input feature map into two branches, one of which directly enters the Concat operation, while the other enters a certain number of PC-EMA block bottleneck layers and outputs feature maps with the same number of channels. Finally, the features are merged through the Concat operation;

[0021] The PC-EMA block bottleneck layer includes 1 PConv layer, two 1×1Conv layers and an EMA attention module;

[0022] The PConv Head detection head is composed of the two 3×3Conv layers in the original YOLOv8n detection head replaced by the Pconv convolution layer, and the classification and regression branches are merged.

[0023] Preferably, after the feature map output by the SPPF module in the backbone network, the feature map output by the PC-EMA module between the third-layer CBS module and the fourth-layer CBS module, and the feature map output by the PC-EMA module between the fourth-layer CBS module and the fifth-layer CBS module enter the neck network, at least one Concat operation is performed on each of them.

[0024] Preferably, in the neck network, the feature map output by the SPPF module is first upsampled, the upsampled feature map is spliced ​​with the feature map output by the third-layer PC-EMA module, and then enters the first-layer VoVGSCSP module for processing, the processed feature map is upsampled again, the upsampled feature map is spliced ​​with the feature map output by the second-layer PC-EMA module, and then enters the second-layer VoVGSCSP module for processing after splicing, the processed feature maps are respectively placed in the corresponding PConv Head detection head, and downsampled through GSConv, the downsampled feature map is spliced ​​with the feature map output by the first-layer VoVGSCSP module, and then enters the third-layer VoVGSCSP module for processing after splicing, the processed feature maps are respectively placed in the corresponding PConv Head detection head, and downsampled through GSConv, the downsampled feature map is spliced ​​with the feature map output by the SPPF module, and then enters the fourth-layer VoVGSCSP module for processing after splicing, and then placed in the corresponding PConv Head detection head.

[0025] The present invention also provides a fan surface defect detection device based on a lightweight PC-EMA algorithm, which is applied to the fan surface defect detection method based on a lightweight PC-EMA algorithm, comprising:

[0026] An object detection unit, used to obtain a fan surface defect image and construct a fan surface defect image data set;

[0027] Model building unit, used to build the YOLOv8n and PConv-EMA fusion model;

[0028] A processing unit, used for processing the fan surface defect image;

[0029] Training unit, used to train the YOLOv8n and PConv-EMA fusion model;

[0030] The output unit is used to output the detection result.

[0031] The present invention also provides a fan surface defect detection device based on a lightweight PC-EMA algorithm, the device comprising: a processor and a memory storing computer program instructions;

[0032] When the processor executes the computer program instructions, the fan surface defect detection method based on the lightweight PC-EMA algorithm is implemented.

[0033] The present invention also provides a computer-readable storage medium,

[0034] The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the fan surface defect detection method based on the lightweight PC-EMA algorithm is implemented.

[0035] The beneficial effects of the present invention are:

[0036] 1. The present invention proposes a lightweight YOLOv8n target detection algorithm; the model complexity of the algorithm is greatly reduced; firstly, the residual module in YOLOv8n is improved, the PConv and EMA modules are integrated, and a residual module for multi-scale feature extraction is designed, which enhances the feature expression ability of channel attention and can effectively capture multi-scale feature information; in the neck network, GSConv and VoVGSCSP are used to reduce the inference time and coordinate the relationship between the complexity and accuracy of the model; in the detection head part, the classification head and the detection head are merged, and the PConv Head detection head is designed, which uses PConv convolution to greatly reduce the number of model parameters and improve the detection speed of the model with minimal impact on the accuracy; finally, Wise-I oU, i.e., Wise-I oU v3, is used as the bounding box regression loss to make the model pay more attention to common quality samples, thereby improving the positioning ability and accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a network structure diagram of the YOLOv8n and PConv-EMA fusion model of the present invention;

[0038] Figure 2 It is the structure diagram of EMA model;

[0039] Figure 3 This is the bottleneck layer structure diagram of the original YOLOv8n;

[0040] Figure 4 It is the bottleneck layer structure diagram of PC-EMA of the present invention;

[0041] Figure 5 This is the network structure diagram of GSConv;

[0042] Figure 6 This is the network structure diagram of VoVGSCSP;

[0043] Figure 7 This is the original YOLOv8n detection head structure diagram;

[0044] Figure 8 It is the structural diagram of the PConv Head detection head of the present invention;

[0045] Fig. 9 Defect target diagram for each location of wind turbine (A) Hub (B) Tower (C) Wind vane (D) Yaw system (E) Blade;

[0046] Fig.10 A flowchart for screening and annotating the data set images of the present invention;

[0047] Fig.11 This is a comparison chart of model testing results. DETAILED DESCRIPTION

[0048] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions of the schematic diagrams 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.

[0049] like Figure 1-11 As shown,

[0050] A method for detecting fan surface defects based on a lightweight PC-EMA algorithm comprises the following steps:

[0051] S1: Collect fan surface defect images and build a fan surface defect image dataset;

[0052] S2: Build the YOLOv8n and PConv-EMA fusion model, including:

[0053] In the backbone network, five layers of CBS modules are arranged in sequence from the input end, and a PC-EMA module is inserted after the second layer CBS module and the third layer CBS module, the third layer CBS module and the fourth layer CBS module, the fourth layer CBS module and the fifth layer CBS module, and the fifth layer CBS module, and an SPPF module is arranged after the last PC-EMA module;

[0054] The CBS module is used to extract low-level features of the image, stabilize and accelerate training, and improve the expressiveness of the model. The PC-EMA module is used to improve the expressiveness of features through multi-scale features and local context enhancement. The SPPF module is used to capture features of different scales.

[0055] The PC-EMA modules arranged in sequence from the input end are a first-layer PC-EMA module, a second-layer PC-EMA module, a third-layer PC-EMA module, and a fourth-layer PC-EMA module;

[0056] In the neck network, the ordinary convolutional layer in the original YOLOv8n model is replaced with the GSConv module, and the C2f module is replaced with the VoVGSCSP module; as the neck network of the new fusion model;

[0057] In the head network, the detection head in the original YOLOv8n model is replaced with the PConv Head detection head; it serves as the head network of the new fusion model;

[0058] S3: Use the surface defect images of the fan to train the YOLOv8n and PConv-EMA fusion model;

[0059] S4: Input the surface defect image of the fan to be detected into the trained YOLOv8n and PConv-EMA fusion model to obtain the fan surface defect detection result.

[0060] In some embodiments, the wind turbine surface defect image dataset is divided into a training set, a validation set, and a test set in a ratio of 8:1:1.

[0061] In some embodiments, the PC-EMA module consists of 1 PConv layer, two 1×1 Conv layers, and an EMA attention module;

[0062] The CBS module consists of a normal convolution layer, a BN layer, and a Si LU layer;

[0063] In the PC-EMA module, a Split operation is first performed to divide the input feature map into two branches, one of which directly enters the Concat operation, while the other enters a certain number of PC-EMA block bottleneck layers and outputs feature maps with the same number of channels. Finally, the features are merged through the Concat operation;

[0064] The PC-EMA block bottleneck layer includes 1 PConv layer, two 1×1Conv layers and an EMA attention module;

[0065] The PConv Head detection head is composed of the two 3×3Conv layers in the original YOLOv8n detection head replaced by the Pconv convolution layer, and the classification and regression branches are merged.

[0066] In some embodiments, after the feature map output by the SPPF module in the backbone network, the feature map output by the PC-EMA module between the third-layer CBS module and the fourth-layer CBS module, and the feature map output by the PC-EMA module between the fourth-layer CBS module and the fifth-layer CBS module enter the neck network, at least one Concat operation is performed on each of them.

[0067] In some embodiments, in the neck network, the feature map output by the SPPF module is first upsampled, the upsampled feature map is spliced ​​with the feature map output by the third-layer PC-EMA module, and then enters the first-layer VoVGSCSP module for processing, the processed feature map is upsampled again, the upsampled feature map is spliced ​​with the feature map output by the second-layer PC-EMA module, and then enters the second-layer VoVGSCSP module for processing after splicing, the processed feature maps are respectively placed in the corresponding PConv Head detection head, and downsampled through GSConv, the downsampled feature map is spliced ​​with the feature map output by the first-layer VoVGSCSP module, and then enters the third-layer VoVGSCSP module for processing, the processed feature maps are respectively placed in the corresponding PConv Head detection head, and downsampled through GSConv, the downsampled feature map is spliced ​​with the feature map output by the SPPF module, and then enters the fourth-layer VoVGSCSP module for processing after splicing, and then placed in the corresponding PConv Head detection head.

[0068] The present invention also provides a fan surface defect detection device based on a lightweight PC-EMA algorithm, which is applied to the fan surface defect detection method based on a lightweight PC-EMA algorithm, comprising:

[0069] An object detection unit, used to obtain a fan surface defect image and construct a fan surface defect image data set;

[0070] Model building unit, used to build the YOLOv8n and PConv-EMA fusion model;

[0071] A processing unit, used for processing the fan surface defect image;

[0072] Training unit, used to train the YOLOv8n and PConv-EMA fusion model;

[0073] The output unit is used to output the detection result.

[0074] The present invention also provides a fan surface defect detection device based on a lightweight PC-EMA algorithm, the device comprising: a processor and a memory storing computer program instructions;

[0075] When the processor executes the computer program instructions, the fan surface defect detection method based on the lightweight PC-EMA algorithm is implemented.

[0076] The present invention also provides a computer-readable storage medium,

[0077] The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the fan surface defect detection method based on the lightweight PC-EMA algorithm is implemented.

[0078] Example:

[0079] In this embodiment, if Figure 2 As shown in the figure, the EMA attention mechanism is a new efficient multi-scale attention mechanism that does not require dimensionality reduction. Its design idea is to effectively capture multi-scale features while maintaining high efficiency, thereby improving the accuracy of the model.

[0080] EMA:

[0081] The EMA attention mechanism not only encodes inter-channel information to adjust the importance of different channels, but also retains precise spatial structure information in the channel. After the convolution layer, the EMA attention mechanism uses multi-scale branches to extract features of different scales. By introducing convolution kernels or pooling operations of different sizes in the network, feature representations of different scales can be obtained at different levels. These features of different scales are sent to their respective attention branches for processing. Each attention branch uses its own attention mechanism to dynamically adjust the importance of features according to specific contextual information. In this way, features of different scales can be assigned different weights according to their relative importance, thereby better capturing the key information in the image.

[0082] PC-EMA:

[0083] The shapes, sizes and colors of defective targets on the surface of wind turbines vary. There are often defective targets of multiple scales in the same image, which is very easy to cause missed detection, especially for targets with smaller contrast. The main network of YOLOv8n is composed of a large number of 3×3 standard convolution and C2f layer series modules for feature extraction. The input image is processed by the backbone network, and the shallow receptive field is small. Neurons can only capture local information of the input image. In addition, the Bott le neck part of YOLOv8n, such as Figure 3 , first use 3×3 convolution to reduce the dimension and remove redundant information; then use 3×3 convolution to increase the dimension; because the Bott l eneck structure will be stacked multiple times in the network, the number of network parameters will be too large;

[0084] In order to solve the above problems, a PC-EMA block based on PConv and EMA attention mechanism is designed; this module retains more semantic information of small objects, improves the ability to extract multi-scale features and the accuracy of the network; the structure is as follows Figure 4 As shown in the figure, the PC-EMA module has a PConv layer followed by two Conv 1×1 layers shown together as an inverted residual block, which can perform identity mapping and spatial transformation in higher dimensions, thereby effectively alleviating information loss and gradient confusion; the intermediate layer has an expanded number of channels, and a shortcut connection is placed to re-input the features, and then passes through an efficient multi-scale attention EMA without dimensionality reduction to fuse contextual information of different scales so that it can produce better pixel-level attention for high-level feature mapping; in addition, batch normalization BN is used; the benefit of BN is that it can be merged into adjacent Conv layers for faster reasoning; in the activation layer, ReLU is selected to avoid the gradient vanishing problem caused by back-propagation while considering running time and effectiveness; the shortcuts in each building block are moved from low-dimensional representations to high-dimensional representations; this module retains more small target information, improves the extraction capability of multi-scale features and the accuracy of the network;

[0085] Neck Network:

[0086] The detection scene of wind turbines is often a complex environment, which greatly interferes with the capture of targets in the image. In addition, if the network uses deep separable convolution extraction, a large amount of channel information will be lost. For this reason, a lightweight convolution GSConv is introduced in the neck network, which is a hybrid convolution composed of ordinary convolution, deep separable convolution and shuffle. GSConv convolution is an adaptive convolution mechanism that can dynamically adjust the shape and size of the convolution kernel according to the content of the input image; as follows Figure 5As shown in the figure, GSConv first inputs a downsampling of a common convolution, and then uses DWConv deep convolution to splice the results of the two convs, one is a dense convolution of the SC channel, and the other is a sparse convolution of the DSC channel; finally, a shuffle operation is performed to make the corresponding channels of the previous two convolutions close together, and the information generated by SC is infiltrated into every part of the information generated by DSC; this method can reduce the computational cost by evenly exchanging local feature information on different channels, so that the information from the common convolution is completely mixed into the output of the depthwise separable convolution;

[0087] Typically, the complexity of convolution calculations is defined by GFLOPs; therefore, the complexity of SC, DSC, and GSConv is shown in Equation 1-3 below:

[0088] Times SC =O(W×H×K 1 ×K 2 ×C 1 ×C 2 ) Formula 1

[0089] Times DSC =O(W×H×K 1 ×K 2 ×1×C 2 ) Formula 2

[0090]

[0091] Where W is the width of the output feature map, H is the height of the output feature map, K1 and K2 are the sizes of the convolution kernels, C1 is the number of channels in the convolution kernel, and C2 is the number of channels in the output feature map; it can be seen that the time complexity of GSConv is less than that of SC and DSC; in fan defect detection, the GSConv module can make the network pay more attention to the grid area where the defect is located and extract more accurate features through adaptive convolution; this helps to improve the positioning accuracy and detection performance of the defect detector;

[0092] GSConv reduces the computational complexity, but in order to reduce the inference time and retain accuracy, a new module is still needed; for this reason, referring to VoVNet and CSPNet, a network module VoVGSCSP is designed based on the GSConv one-time aggregation method, as shown in Figure 6 As shown in the figure; its function is consistent with that of C2f, but the computational complexity is lower; the algorithm of the present invention replaces the ordinary convolution with GSConv in the feature fusion network, and replaces the C2f module of the neck network with the VoVGSCSP module, so as to enhance the expression ability of the model when facing complex graph structures, overcome the problem of decreased model positioning ability due to network deepening, and accelerate the calculation and reasoning speed while ensuring accuracy;

[0093] Head network:

[0094] YOLOv8n uses Decoup led Head, Figure 7 The decoupled head network is shown in Figure 1. First, the three effective feature layers P3, P4, and P5 are input into the head. Then, the decoupled head network uses two parallel 3×3 convolutional layers to separate the classification and regression tasks, so that the classification and regression tasks are performed separately. Next, the classification, positioning, and confidence detection tasks are again implemented through 1×1 convolutions in classification and regression. The classification head is used to predict the category of the target, and the regression head is used to predict the position and size of the target. The network has better expression ability after using the decoupled head. However, although decoupling the detection head can speed up the convergence of the model, it will also increase the complexity of the operation. In addition, the number of channels is stacked due to the use of multiple 3×3 convolutions in series, which will greatly increase the number of network parameters.

[0095] In actual fan defect detection, drone equipment with limited computing resources is often used to detect defects. However, the original detection head of YOLOv8n is too complex and not conducive to performance. Therefore, the detection head is lightweight and improved, and PConv Head is designed. Figure 8 As shown in the figure, two 3×3 convolutions are replaced by Pconv convolution, which greatly reduces the number of network parameters; then 1×1 convolution is used for dimensionality reduction to further reduce the number of parameters; then, the two branches are merged so that the classification and regression tasks are implemented together in the convolution. This operation affects the accuracy of network detection to a certain extent, but the introduction of PConv utilizes the redundancy in the feature map and systematically applies standard convolution Conv only on a part of the input channels without affecting the remaining channels. Taking into account the redundancy in the feature map, it retains the channel information to the maximum extent while reducing FLOPs and memory access, ensuring the accuracy of the model;

[0096] In the application research of wind turbine surface defect detection, there is a lack of publicly available data sets suitable for deep learning training; the images used in the present invention are composed of wind turbine surface defect images taken by drones provided by wind power plants in northwest China and wind turbine surface defect images taken by public drones provided by the Roboflow website; the drones took pictures of the wind turbine surface from multiple angles, such as Fig. 9As shown in the figure, it includes wind turbine hub, tower, wind vane, yaw system, blades and other structures; the image resolution is 1280×1080, which basically meets the requirements of target detection; the image blur algorithm is added to the data set preprocessing operation to simulate photos taken in bad weather, and the brightness contrast transformation is added to simulate photos taken in dim light; the 3733 images obtained are screened and annotated, and the data set is divided into training set, validation set and test set in a ratio of 8:1:1, with 2986 training sets, 374 test sets and 373 validation sets. Fig.10 As shown; the model of the present invention is compared with other models to test the results, such as Fig.11 As shown, from left to right, the columns are SSD model, Faster-RCNN model, YOLOv8n model, and the model of the present invention;

[0097] The present invention uses the same data set and training parameters to design experiments, with the batch size set to 16, the learning rate to 0.01, and the number of epochs to 200; the improved model is compared with the previous defect detection method; the experimental data are shown in Table 1;

[0098] In the table: mAP@0.5 is the average precision, Mode lsi ze is the model size, and GFLOPs is the model computing power;

[0099] The comparison between Experiment B and Experiment C shows that the introduction of the PC-EMA module changes the original convolution method and focuses on more valuable feature information, thereby improving the accuracy of defect detection; the average precision mAP@0.5 increases by 3.68%; S lim-neck is the improvement of the neck network by GSConv and VoVGSCSP. Compared with Experiment B and D, the fusion of GSConv and VoVGSCSP increases the adaptability of the neural network and improves the fusion ability of the target feature map; among them, mAP@0.5 increases by 1.96%; Compared with Experiment B and G, the Model size is better and the lightweight level of the model is better, but the accuracy is 1.39% lower than that of the model of the present invention; the model of the present invention improves the backbone, neck, head network and loss function, improves the multi-scale feature extraction ability of the model, and increases the feature fusion ability of the network, while ensuring the low latency of the model and greatly reducing the number of parameters; therefore, when detecting various defects, the detection accuracy and lightweight level of the model are better than other models;

[0100] Table 1. Comparison table between various models

[0101]

[0102]

[0103] Using the same training data set, the proposed model has better detection effect than traditional models such as SSD, Faster-RCNN and YOLOv5, as shown in Table 2;

[0104] In the table: mAP@0.5 is the average precision, Precision is the accuracy, Recall is the recall, Model is the model size, and Frame rate is the detection speed;

[0105] The feature extraction of SSD is not sufficient, the detection accuracy is not high enough, and the generalization ability of the model is not strong;

[0106] Although the detection effect of Faster-RCNN is acceptable, the frame rate is too low due to the use of two-stage detection, and the real-time detection effect cannot be achieved; the detection speed of the model of the present invention is about 12fps faster than that of YOLOv8n; the mAP of the model of the present invention is improved to a certain extent compared with the other four models, which is 5.07% higher than that of YOLOv8n; the model size of the model of the present invention is 1.93M smaller than that of YOLOv8n;

[0107] Table 2: Performance comparison between the proposed model and the classical model

[0108]

[0109]

[0110] Speed ​​comparison experiment deployed on Jetson Nano:

[0111] TensorRT is an inference engine released by NVID IA. It is optimized and accelerated for NVID IA series hardware to maximize the use of GPU resources and improve inference performance. In order to make hardware detection faster, import TensorRT into Python to make the most efficient use of GPU, and then export the trained model best.PT to best.onnx format for lightweight deployment.

[0112] As shown in Table 3;

[0113] In the table: Image size is the image size, Preprocessing is the data preprocessing time, Inference is the inference time, NMS is the non-maximum suppression time limit, FPS is the detection speed, and TensorRT FPS is the detection speed after TensorRT acceleration;

[0114] When the image resolution is 640×640, the inference time of the model of the present invention is 28% faster than that of the original model YOLOv5, and the detection speed is greatly improved compared with various yo lo algorithms. It is 4 frames faster than YOLOv8n. After TensorRT acceleration, the model speed is 11 frames faster than the original model. As the input resolution decreases, the inference speed of the model gradually approaches, and the model frame rate also gradually approaches, but the improved model is least affected by the size of the resolution. This improved model is still the fastest, and the model frame rate is still 8 frames higher than the original model. After deployment, the reliability and robustness of the lightweight model are verified, and the device performance is fully utilized.

[0115] Table 3: Speed ​​comparison on Jetson Nano

[0116]

Claims

1. A fan surface defect detection method based on lightweight PC-EMA algorithm, characterized in that: The following steps are involved: S1: Collect fan surface defect images and build a fan surface defect image dataset; S2: Build a YOLOv8n and PConv-EMA fusion model, including: In the backbone network, five layers of CBS modules are arranged in sequence from the input end, and a PC-EMA module is inserted after the second layer CBS module and the third layer CBS module, the third layer CBS module and the fourth layer CBS module, the fourth layer CBS module and the fifth layer CBS module, and the fifth layer CBS module, and an SPPF module is arranged after the last PC-EMA module; The CBS module is used to extract low-level features of the image, stabilize and accelerate training, and improve the expressiveness of the model. The PC-EMA module is used to improve the expressiveness of features through multi-scale features and local context enhancement. The SPPF module is used to capture features of different scales. The PC-EMA modules arranged in sequence from the input end are a first-layer PC-EMA module, a second-layer PC-EMA module, a third-layer PC-EMA module, and a fourth-layer PC-EMA module; In the neck network, the ordinary convolutional layer in the original YOLOv8n model is replaced with the GSConv module, and the C2f module is replaced with the VoVGSCSP module; as the neck network of the new fusion model; In the head network, the detection head in the original YOLOv8n model is replaced with the PConv Head detection head; it serves as the head network of the new fusion model; S3: Use the surface defect images of the fan to train the YOLOv8n and PConv-EMA fusion model; S4: Input the surface defect image of the fan to be detected into the trained YOLOv8n and PConv-EMA fusion model to obtain the fan surface defect detection result.

2. A fan surface defect detection method based on lightweight PC-EMA algorithm according to claim 1, characterized in that: The fan surface defect image dataset is divided into training set, validation set and test set in a ratio of 8:1:

1.

3. A fan surface defect detection method based on lightweight PC-EMA algorithm according to claim 2, characterized in that: The PC-EMA module consists of a PConv layer, two 1×1Conv layers, and an EMA attention module; The CBS module consists of a normal convolutional layer, a BN layer, and a SiLU layer; In the PC-EMA module, a Split operation is first performed to divide the input feature map into two branches. One branch directly enters the Concat operation, while the other branch enters a certain number of PC-EMA block bottleneck layers and outputs feature maps with the same number of channels. Finally, the features are merged through the Concat operation. The bottleneck layer of the PC-EMA block includes a PConv layer, two 1×1Conv layers, and an EMA attention module; The PConv Head detection head is composed of the two 3×3Conv layers in the original YOLOv8n detection head replaced by the Pconv convolution layer, and the classification and regression branches are merged.

4. A method for detecting fan surface defects based on lightweight PC-EMA algorithm according to claim 3, characterized in that: After the feature map output by the SPPF module in the backbone network, the feature map output by the PC-EMA module between the third-layer CBS module and the fourth-layer CBS module, and the feature map output by the PC-EMA module between the fourth-layer CBS module and the fifth-layer CBS module enter the neck network, at least one Concat operation is performed on each of them.

5. A method for detecting fan surface defects based on lightweight PC-EMA algorithm according to claim 4, characterized in that: In the neck network, the feature map output by the SPPF module is first upsampled, and the upsampled feature map is spliced ​​with the feature map output by the third-layer PC-EMA module, and then enters the first-layer VoVGSCSP module for processing. The processed feature map is upsampled again, and the upsampled feature map is spliced ​​with the feature map output by the second-layer PC-EMA module. After splicing, it enters the second-layer VoVGSCSP module for processing. The processed feature maps are placed in the corresponding PConv Head detection head, and downsampled through GSConv. The downsampled feature map is spliced ​​with the feature map output by the first-layer VoVGSCSP module, and then enters the third-layer VoVGSCSP module for processing. The processed feature maps are placed in the corresponding PConv Head detection head, and downsampled through GSConv. The downsampled feature map is spliced ​​with the feature map output by the SPPF module, and then enters the fourth-layer VoVGSCSP module for processing, and then placed in the corresponding PConv Head detection head.

6. A fan surface defect detection device based on lightweight PC-EMA algorithm, applied to a fan surface defect detection method based on lightweight PC-EMA algorithm as claimed in claim 5, characterized in that: include: An object detection unit, used to obtain a fan surface defect image and construct a fan surface defect image data set; Model building unit, used to build the YOLOv8n and PConv-EMA fusion model; A processing unit, used for processing the fan surface defect image; Training unit, used to train the YOLOv8n and PConv-EMA fusion model; The output unit is used to output the detection result.

7. A fan surface defect detection device based on lightweight PC-EMA algorithm, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the fan surface defect detection method based on the lightweight PC-EMA algorithm as described in any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the fan surface defect detection method based on the lightweight PC-EMA algorithm as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Aerial insulator image defect detection method based on YOLOv5 algorithm

    CN116468730A

  • Gesture recognition method based on improved YOLOv5

    CN117238024A

  • Fire detection method fusing YOLOv8 and RT-DETR

    CN117974973A

Cited By

  • Method for identifying electric vehicle in elevator based on improved YOLOv8

    CN119181012A

  • Elevator Electric Bicycle Recognition Method Based on Improved YOLOv8

    CN119181012B

  • Light-weight industrial product surface defect detection method

    CN119313659A

  • A method for detecting surface defects of lightweight industrial products

    CN119313659B

  • Synthetic leather surface defect detection method based on space instance dissimilatory self-attention

    CN120070402A