Insulator defect detection method based on lightweight CGC-YOLO

By adopting a lightweight CGC-YOLO network model in insulator defect detection, combined with the CMC module and the APS-Attention attention mechanism module, the existing detection methods are not accurate and computationally large, and efficient and accurate Insulator defect detection.

CN119444752AActive Publication Date: 2025-02-14NANCHANG INST OF TECH

Patent Information

Application Number
CN202510037996.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-02-14
Estimated Expiration
2045-01-10

AI Technical Summary

Technical Problem

In actual application, the existing insulator defect detection methods face the situation of low detection accuracy, high error detection rate, poor accuracy and missed detection. They are greatly affected by factors such as weather, lighting, background complexity, etc., and the calculation volume cannot be achieved. Real-time processing.

Method used

Using the insulator defect detection method based on lightweight CGC-YOLO, high-precision insulator defect detection is achieved with low calculation amount by optimizing the model structure and introducing the CMC module and the APS-Attention attention mechanism module.

Benefits of technology

It significantly improves the detection effect and practicality of the equipment side, realizes efficient inspection in complex environments, reduces the error detection rate and missed detection rate, and improves the detection accuracy and real-timeness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444752A_ABST
    Figure CN119444752A_ABST
Patent Text Reader

Abstract

The invention discloses an insulator defect detection method based on lightweight CGC-YOLO, and the method comprises the steps: S1, constructing an image data set of insulator defects of a power transmission line, and dividing the image data set into a training set and a verification set; s2, constructing a CGC-YOLO network model, wherein the model comprises a backbone network, a neck network and a head network; s3, training the CGC-YOLO network model by using the insulator defect images of the training set, and evaluating the performance of the CGC-YOLO network model in the training process by using the insulator defect images of the verification set to obtain a trained CGC-YOLO network model; and S4, inputting a defect image of the insulator to be detected into the trained CGC-YOLO network model to detect the defect of the insulator. By optimizing a model structure and introducing an innovative module, high-precision insulator defect detection is realized under a low calculation amount, the method is suitable for efficient inspection requirements in a complex environment, and the detection effect and the practicability of an equipment end are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power transmission lines, and in particular relates to an insulator defect detection method based on lightweight CGC-YOLO. Background Art

[0002] Insulators are one of the indispensable and important electrical components in transmission lines. They mainly undertake the functions of line support and electrical insulation to prevent current leakage to other components and cause short circuits, thereby ensuring the safe operation of the power system. However, insulators may be damaged or dirty during long-term use due to external factors such as rain, lightning, hail, and bird droppings, resulting in reduced insulation performance. Therefore, it is necessary to conduct regular inspections of insulators on high-voltage lines to promptly detect and replace insulators with abnormal damage. At present, insulator defect detection mainly relies on manual identification. Inspectors regularly inspect insulators on high-voltage lines along the line, usually by visual observation or using telescopes to determine the defect situation. Such an inspection process is time-consuming, inefficient, and has a high rate of missed detection. On transmission lines with complex terrain, manual inspection is difficult to achieve high-precision results. With the rapid development of drone technology, drones can take a large number of insulator images and transmit them back to the background for staff to check. Due to the huge amount of data, the insulator conditions in the image are uneven, and it has become impractical to check them one by one. Therefore, drones equipped with target detection algorithms have become the mainstream means of insulator defect detection, providing a low-cost, high-efficiency and highly mobile solution for transmission line defect detection.

[0003] Existing insulator defect detection methods face multiple challenges in practical applications, resulting in low detection accuracy. First, insulator defects are diverse and complex in shape. Existing algorithms are prone to high false detection rates, poor accuracy, and missed detections when identifying subtle defects such as fine cracks, tiny defects, and small contamination. Secondly, during drone inspections, the images are blurred and of poor quality due to factors such as weather, lighting, and background complexity, which is not conducive to model training. Finally, although some complex deep learning models have improved detection accuracy, they have a large amount of computation and cannot achieve real-time processing. Especially when drone edge computing resources are limited, the real-time performance of the algorithm is greatly restricted, affecting the inspection efficiency. Summary of the invention

[0004] In view of the shortcomings of the prior art, the purpose of the present invention is to provide an insulator defect detection method based on lightweight CGC-YOLO. By optimizing the model structure and introducing innovative modules, high-precision insulator defect detection is achieved with low computational complexity. It is suitable for efficient inspection needs in complex environments and significantly improves the detection effect and practicability of the equipment end.

[0005] To achieve the above object, the present invention provides the following technical solution: an insulator defect detection method based on lightweight CGC-YOLO, comprising the following steps: S1: Construct an image dataset of transmission line insulator defects and divide it into a training set and a validation set; S2: Build a CGC-YOLO network model, which includes a backbone network, a neck network, and a head network; The backbone network includes two Conv convolution modules, two CGC1 modules, a Conv convolution module, three CGC2 modules, a Conv convolution module, six CGC3 modules, a Conv convolution module and three CGC4 modules connected in sequence, and the output features of the two CGC1 modules, the three CGC2 modules, the six CGC3 modules and the three CGC4 modules are respectively used as the input of the neck network; The neck network includes a CMC module, a CGC module, a Conv convolution module, an upsampling module, a Concat splicing module and an APS-Attention mechanism module. The CMC modules are set to 4, namely, a CMC1 module, a CMC2 module, a CMC3 module and a CMC4 module. The processing process of the neck network is as follows: the outputs of the two CGC1 modules are subjected to feature extraction by the CMC1 module to obtain feature M1, the outputs of the three CGC2 modules are subjected to feature extraction by the CMC2 module to obtain feature M2, the outputs of the six CGC3 modules are subjected to feature extraction by the CMC3 module to obtain feature M3, the outputs of the three CGC4 modules are subjected to feature extraction by the CMC4 module to obtain feature M4, feature M4 is subjected to Conv convolution processing to obtain feature M5, feature M5 is upsampled and Concat spliced ​​with feature M3 to obtain feature M6, feature M6 After feature extraction by the CGC module, feature M7 is obtained. After feature M7 is processed by Conv convolution, feature M8 is obtained. After upsampling feature M8, feature M9 is concat-joined with feature M2 to obtain feature M9. After feature extraction by the CGC module, feature M9 is obtained. 10 , feature M 10 After Conv convolution processing, feature M is obtained 11 , for feature M 11 After upsampling, concatenate it with feature M1 to get feature M 12 , feature M 12 , Feature M 11 , feature M8, and feature M5 are respectively subjected to the APS-Attention mechanism module to strengthen the feature extraction operation and obtain feature M 13 , Feature M 14 , Feature M 15 , Feature M 16 , feature M 13After feature extraction by the CGC module, feature M is obtained 17 , feature M 17 After Conv convolution processing and feature M 14 Perform Concat to get feature M 18 , feature M 18 After feature extraction by the CGC module, feature M is obtained 19 , feature M 19 After Conv convolution processing and feature M 15 Perform Concat to get feature M 20 , feature M 20 After feature extraction by the CGC module, feature M is obtained 21 , feature M 21 After Conv convolution processing and feature M 16 Perform Concat to get feature M 22 , feature M 22 After feature extraction by the CGC module, feature M is obtained 23 , and finally the feature M 17 , Feature M 19 , Feature M 21 With feature M 23 As the output of the neck network; The head network includes four Detect modules, which are used to detect insulator images with defects of different sizes. 17 , Feature M 19 , Feature M 21 With feature M 23 Four Detect modules are input respectively for insulator defect detection; the Detect module includes a convolutional layer and a fully connected layer, which are used to predict the category to which each candidate box belongs; S3: Use the insulator defect images in the training set to train the CGC-YOLO network model, and use the insulator defect images in the validation set to evaluate the performance of the CGC-YOLO network model during the training process to obtain a trained CGC-YOLO network model; S4: Input the insulator defect image to be tested into the trained CGC-YOLO network model to detect the insulator defects.

[0006] Further preferably, the structures of the CGC1 module, CGC2 module, CGC3 module, and CGC4 module are the same as those of the CGC module. The processing process of the CGC module is: the input features are sequentially subjected to Conv convolution, BN batch normalization, and SiLU activation function operations to obtain feature X1; feature X1 is processed twice differently, the first time Conv convolution, BN batch normalization, and SiLU activation function operations are performed to obtain feature X2, and the second time feature X3 is processed by the GC module to obtain feature X3, feature X2 and feature X3 are added to obtain feature X4, feature X4 is respectively subjected to average pooling and Conv convolution, BN batch normalization, and SiLU activation function operations to obtain feature X5 and feature X6, feature X5 and feature X6 are concat spliced ​​to obtain feature X7, feature X7 is processed by the GC module to obtain feature X8, feature X8 and the input feature are connected through a residual network to obtain feature X9, and feature X9 is subjected to a Sigmoid activation function operation to obtain an output feature Y.

[0007] Further preferably, the processing process of the GC module is as follows: the input feature is subjected to a Conv convolution operation to obtain feature A1, Conv convolution and Softmax activation operations are performed on feature A1 to obtain feature A2, average pooling and maximum pooling operations are performed on feature A1 to obtain feature A3, feature A1, feature A2 and feature A3 are multiplied to obtain feature A4, feature A4 is subjected to Conv convolution, BN batch normalization and SiLU activation function in sequence to obtain feature A5, feature A5 is subjected to Conv convolution processing to obtain feature A6, feature A6 is connected to the input feature through a residual network to obtain feature A7, and feature A7 is subjected to a Softmax activation function operation to obtain output feature Y1.

[0008] Further preferably, the processing process of the CMC module is as follows: it includes two paths; in the first path, the input feature is processed by Conv convolution to obtain feature B, and feature B is subjected to two maximum pooling operations to obtain feature B1 and feature B2, feature B, feature B1 and feature B2 are concat spliced ​​to obtain feature B3, feature B3 is processed by Conv convolution to obtain feature B4, feature B4 is subjected to two maximum pooling operations to obtain feature B5 and feature B6, feature B4, feature B5 and feature B6 are concat spliced ​​to obtain feature B7, feature B7 is sequentially subjected to Conv convolution, BN batch normalization and SiLU activation function operations to obtain feature B8; in the second path, the input feature is processed by three KCConv expanded convolutions of different sizes to obtain feature B9, feature B10 and feature B2. 10 , Feature B 11 , feature B9, feature B 10 and feature B 11Perform Concat to get feature B 12 ; Combine the feature B8 obtained in the first path with the feature B obtained in the second path 12 Add them together to get the output feature Y2.

[0009] Further preferably, the processing process of the APS-Attention mechanism module is as follows: the input feature is subjected to an average pooling operation to obtain feature C, feature C is sequentially subjected to a PSA attention mechanism module and a Sigmoid activation function to obtain feature C1, and feature C and feature C1 are added through a residual connection to finally obtain an output feature Y3.

[0010] Further preferably, the processing process of the PSA attention mechanism module is: the input features are subjected to four average pooling operations to obtain features D1, feature D2, feature D3 and feature D4, feature D1, feature D2, feature D3 and feature D4 are concat spliced ​​to obtain feature D5, feature D5 is processed by the attention weight module and the Softmax activation function to obtain feature D6, and feature D5 and feature D6 are multiplied element by element to obtain the output.

[0011] Further preferably, the Detect module also includes a non-maximum suppression algorithm and a loss function. The non-maximum suppression algorithm is used to remove overlapping detection boxes to ensure that each target has only one detection box. The loss function includes classification loss, positioning loss and confidence loss, which are used to measure the difference between the model prediction value and the true value.

[0012] Further preferably, the data set is composed of insulator images taken by a drone, the images include two situations: contaminated insulators and damaged insulators, and the data set is labeled and data enhanced; labeling the data set includes: using the LabelImg image labeling tool to perform rectangular labeling on the insulator defect parts in each image, and after the labeling is completed, a txt file containing the damaged category, the contamination category and the corresponding labeling box coordinate information is generated; the data enhancement processing is to optimize the image quality through image quality enhancement, contrast adjustment and denoising.

[0013] Compared with the prior art, the present invention has the following beneficial effects: The CGC-YOLO network model designed by the present invention has been improved in the backbone network, the neck network and the head network. First, in the backbone network, a lightweight CGC module is used as the core of feature extraction. The CGC module has extremely strong scalability, can effectively reduce the amount of model parameters, provides strong support for the deployment of mobile devices such as drones, and realizes real-time target detection. In addition, the CGC module is based on the global feature extraction method and enhances the local expression ability of the image by introducing global features. Secondly, in the neck network, the CMC module and the APS-Attention mechanism module are added. The CMC module is used to extract deeper feature information and enhance the detection ability of small targets. By reducing the spatial dimension of the feature map, the maximum pooling operation in the CMC module significantly reduces the computational complexity and memory consumption of subsequent layers, thereby speeding up the training and reasoning speed of the model, while reducing the risk of overfitting and improving the generalization ability of the model. The APS-Attention mechanism uses global context information to help the model better understand the overall structure and background of the image. At the same time, the mechanism focuses on capturing local details and dynamically adjusts the importance of local features, making the model more sensitive to fine-grained information and helping to better handle targets of different scales. Finally, in the head network, an insulator detection head dedicated to detecting small defects and contamination is added, further improving the detection accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 is a flow chart of the method of the present invention; Figure 2 This is a schematic diagram of the CGC-YOLO network model structure; Figure 3 It is a schematic diagram of the CGC module structure; Figure 4 It is a schematic diagram of the GC module structure; Figure 5 It is a schematic diagram of the CMC module structure; Figure 6 APS-Attention mechanism module structure diagram; Figure 7 Schematic diagram of the PSA attention mechanism module structure. DETAILED DESCRIPTION

[0015] The present invention is further described below in conjunction with embodiments. It is necessary to point out that the following embodiments are only used to further illustrate the present invention and cannot be understood as limiting the scope of protection of the present invention. Some non-essential improvements and adjustments made by technical personnel in this field based on the above invention content still fall within the scope of protection of the present invention.

[0016] The present invention proposes an insulator defect detection method based on lightweight CGC-YOLO. The method uses lightweight modules to build a network model. Under the premise of maintaining low parameters and low computational complexity, it ensures that the model has high detection accuracy, and provides strong technical support for real-time detection on mobile devices such as drones. The defects and contamination parts of insulators are usually small and difficult to identify. Therefore, the present invention adds a detection head specifically for small targets in the model prediction stage to more accurately capture defects and contamination of different scales, thereby improving the recognition ability of small and large defective targets. In addition, in order to enhance the recognition effect of the model in complex backgrounds, the present invention introduces an attention mechanism in the model structure, so that the model can focus on the key areas of the insulator, further improving the robustness and detection accuracy of the model.

[0017] Reference Figure 1 , an insulator defect detection method based on lightweight CGC-YOLO, comprising the following steps: S1: Construct an image dataset of transmission line insulator defects and divide it into a training set and a validation set; In this embodiment, the data set consists of images of insulators taken by drones, and the images include two situations: dirty insulators and damaged insulators. In order to ensure that the model can accurately identify defects, the data set is first labeled and preprocessed. Specifically, the LabelImg image annotation tool is used to rectangularly annotate the defective parts of the insulators in each image, and the labels of the damaged insulators are uniformly set to "Defective_insulator", and the labels of the polluted insulators are uniformly set to "Polluted_insulator". After the annotation is completed, a txt file containing the damaged category, the dirty category and the corresponding annotation box coordinate information is generated so that the model can accurately locate the defect position. In order to further improve the detection accuracy of the model, the data set is preprocessed for data enhancement. In the data enhancement process, the image quality is optimized through image quality enhancement, contrast adjustment and denoising, thereby improving the adaptability of the model in different scenarios and complex environments. Data enhancement can not only enrich the diversity of data, but also effectively improve the model's ability to recognize various defect forms. After the data preprocessing is completed, the data set is divided into a training set and a validation set in a ratio of 9:1. The training set is used to learn the model's parameters, while the validation set is used to evaluate the model's performance during the training process, helping to detect and prevent overfitting problems. This reasonable data division ensures that the model has good generalization capabilities while maintaining high detection accuracy, making it more suitable for actual application scenarios.

[0018] S2: Build a CGC-YOLO network model, which includes a backbone network, a neck network, and a head network; In the backbone network, it is composed of convolutional layers and CGC modules. The convolutional layer is the basic layer of the entire neural network, which is used to extract local spatial information of input features. The CGC module includes a series of convolutional layers and GC (Global Context) modules. The GC module is a lightweight module that can effectively reduce the number of parameters of the entire model. At the same time, the GC module is used to capture the global information of the features and enhance the expression ability of local features by introducing global features. This module combines global features with local features, so that the model can more effectively capture global context information, thereby improving the overall recognition performance. In the neck network, it is composed of CMC modules, CGC modules, Conv convolution modules, upsampling modules, Concat splicing modules, and APS-Attention mechanism modules. The CMC module is a bidirectional pooling structure used to extract deeper feature information and enhance the detection ability of small targets. The spatial dimension of the feature map is reduced through the double pooling process, the calculation amount and parameter amount of the subsequent layers are reduced, and the calculation efficiency of the model is improved. The upsampling module converts the low-resolution feature map into a high-resolution feature map through upsampling operations to restore the spatial dimension of the feature map. The Concat module is used to concatenate feature maps of different scales to form a new feature map, thereby enhancing the representation capability of features. The APS-Attention mechanism module consists of a residual network and a PSA attention mechanism module. It is an attention mechanism used to enhance the representation capability of features, enabling the model to focus on key areas and capture information of different scales by constructing multi-scale feature maps, which helps the model to better handle targets of different sizes. In the head network, an additional detection head specifically for small targets is added, so that the four sets of detection heads can simultaneously have the ability to detect insulators with large and small defects. The Detect module includes a convolutional layer and a fully connected layer to predict the category to which each candidate box belongs. In the detection head, a non-maximum suppression (NMS) algorithm and a loss function are also included. The NMS algorithm ensures that each target has only one detection box, thereby improving the clarity and accuracy of the detection results. The loss function includes classification loss, positioning loss, and confidence loss, which are used to measure the difference between the model prediction value and the true value, and guide the model to continuously optimize parameters during the training process, thereby improving the detection accuracy and robustness of the model.

[0019] The CGC-YOLO network model structure is as follows Figure 2 As shown, specifically including: The backbone network includes two Conv convolution modules, two CGC1 modules, a Conv convolution module, three CGC2 modules, a Conv convolution module, six CGC3 modules, a Conv convolution module and three CGC4 modules, which are connected in sequence. The output features of the two CGC1 modules, three CGC2 modules, six CGC3 modules and three CGC4 modules are used as the input of the neck network respectively.

[0020] The input of the backbone network is an image of size 640×640 and 3 channels, and its features are extracted step by step from top to bottom. First, the image passes through two consecutive Conv convolution operations, and the size of the feature map is reduced to 160×160. Then, the network is connected to multiple modules in sequence, including 2 repeated CGC1 modules, a Conv convolution module, 3 repeated CGC2 modules, a Conv convolution module, 6 repeated CGC3 modules, a Conv convolution module, and finally 3 repeated CGC4 modules. After the step-by-step processing of these modules, the size of the feature map is reduced to 20×20 with 1024 channels. In the backbone network, the convolution kernel size of all convolution modules is 3×3, and the stride is set to 2.

[0021] The neck network includes CMC module, CGC module, Conv convolution module, upsampling module, Concat splicing module and APS-Attention mechanism module. The CMC module is used to extract shallow features at a deeper level and further enhance the representation ability of features. There are 4 CMC modules, namely CMC1 module, CMC2 module, CMC3 module and CMC4 module. The processing process of the neck network is as follows: the outputs of the two CGC1 modules are subjected to feature extraction by the CMC1 module to obtain feature M1, the outputs of the three CGC2 modules are subjected to feature extraction by the CMC2 module to obtain feature M2, the outputs of the six CGC3 modules are subjected to feature extraction by the CMC3 module to obtain feature M3, the outputs of the three CGC4 modules are subjected to feature extraction by the CMC4 module to obtain feature M4, feature M4 is subjected to Conv convolution processing to obtain feature M5, feature M5 is upsampled and Concat spliced ​​with feature M3 to obtain feature M6, feature M6 After feature extraction by the CGC module, feature M7 is obtained. After feature M7 is processed by Conv convolution, feature M8 is obtained. After upsampling feature M8, feature M9 is concat-joined with feature M2 to obtain feature M9. After feature extraction by the CGC module, feature M9 is obtained. 10 , feature M 10 After Conv convolution processing, feature M is obtained 11 , for feature M 11 After upsampling, concatenate it with feature M1 to get feature M 12 , feature M12 , Feature M 11 , feature M8, and feature M5 are respectively subjected to the APS-Attention mechanism module to strengthen the feature extraction operation and obtain feature M 13 , Feature M 14 , Feature M 15 , Feature M 16 , feature M 13 After feature extraction by the CGC module, feature M is obtained 17 , feature M 17 After Conv convolution processing and feature M 14 Perform Concat to get feature M 18 , feature M 18 After feature extraction by the CGC module, feature M is obtained 19 , feature M 19 After Conv convolution processing and feature M 15 Perform Concat to get feature M 20 , feature M 20 After feature extraction by the CGC module, feature M is obtained 21 , feature M 21 After Conv convolution processing and feature M 16 Perform Concat to get feature M 22 , feature M 22 After feature extraction by the CGC module, feature M is obtained 23 , and finally the feature M 17 , Feature M 19 , Feature M 21 With feature M 23 As the output of the neck network.

[0022] In the neck network, it is mainly composed of feature pyramid network (FPN) and path aggregation network (PAN). The FPN network can transfer the semantic information of high-level feature maps to low-level feature maps by propagating feature information from bottom to top, thereby enhancing the representation ability of low-level feature maps. The PAN network further enhances the ability of multi-scale feature fusion by propagating feature information from top to bottom, ensuring that feature maps of each scale can obtain global and local information, thereby improving the detection accuracy of the model. Four APS-Attention mechanism modules are also connected between the FPN network and the PAN network. This attention mechanism module enables the model to better adapt to different scenes and targets, especially in the case of complex backgrounds and multi-scale targets, the model can more accurately locate and identify targets. By focusing on important features, the APS-Attention mechanism module can reduce the impact of noise and interference information on the model and improve the robustness of the model. In the structures of the FPN network and the PAN network, Conv convolution module, upsampling module, CGC module and Concat splicing module are included. The FPN network upsamples the input features through these modules, while the PAN network downsamples the input features through these modules. The collaborative work of these modules enables the FPN network and PAN network to efficiently process multi-scale features and improve the overall performance of the model.

[0023] The head network includes four Detect modules, which are used to detect insulator images with defects of different sizes. 17 , Feature M 19 , Feature M 21 With feature M 23 Four Detect modules are input respectively for insulator defect detection; the Detect module includes a convolutional layer and a fully connected layer, which are used to predict the category to which each candidate box belongs; In the head network, there are four groups of detection heads, which are used to detect insulator images with small defects, small defects, medium defects and large defects. Each group of detection heads is optimized for defects of different sizes to ensure that the model can effectively detect defects in insulators at multiple scales. First, the Detect module performs convolution operations on the input multi-scale feature map. The convolution layer is used to further extract and enhance the features in the feature map, and adapt it to subsequent detection tasks by changing the number of channels of the feature map. Next, the fully connected layer operation is performed. The fully connected layer is used to predict the category to which each candidate box belongs, the bounding box coordinates of each candidate box (i.e., the center point position and width and height), and the confidence of each candidate box (i.e., the possibility that the candidate box contains the object). Finally, the non-maximum suppression (NMS) algorithm is used to remove overlapping detection boxes to ensure that each object has only one detection box. By setting a threshold, the NMS algorithm selects the detection box with the highest score and removes other boxes whose overlap exceeds the threshold. The Detect module also includes a loss function, which measures the difference between the model's predicted value and the true value, guides the model to continuously optimize parameters during training, balance different tasks, and improve the model's robustness and generalization ability.

[0024] The structures of CGC1 module, CGC2 module, CGC3 module and CGC4 module are the same as those of CGC module. Figure 3 As shown in the figure, the processing process of the CGC module is as follows: the input features are sequentially subjected to Conv convolution, BN batch normalization and SiLU activation function operations to obtain feature X1; feature X1 is processed twice in different ways, the first time Conv convolution, BN batch normalization and SiLU activation function operations are performed to obtain feature X2, the second time it is processed by the GC module to obtain feature X3, feature X2 and feature X3 are added to obtain feature X4, feature X4 is subjected to average pooling and Conv convolution, BN batch normalization, and SiLU activation function operations to obtain feature X5 and feature X6, feature X5 and feature X6 are concat spliced ​​to obtain feature X7, feature X7 is processed by the GC module to obtain feature X8, feature X8 and input features are connected through a residual network to obtain feature X9, and feature X9 is subjected to a Sigmoid activation function operation to obtain output feature Y. The above module design not only improves the stability and performance of the model, but also enhances the feature extraction and generalization capabilities of the model through the combination of multiple operations and modules.

[0025] like Figure 4As shown in the figure, the processing process of the GC module is as follows: the input feature is subjected to Conv convolution operation to obtain feature A1, Conv convolution and Softmax activation operations are performed on feature A1 to obtain feature A2, average pooling and maximum pooling operations are performed on feature A1 to obtain feature A3, feature A1, feature A2 and feature A3 are multiplied to obtain feature A4, feature A4 is subjected to Conv convolution, BN batch normalization and SiLU activation function in turn to obtain feature A5, feature A5 is subjected to Conv convolution processing to obtain feature A6, feature A6 is connected to the input feature through a residual network to obtain feature A7, and feature A7 is subjected to Softmax activation function operation to obtain output feature Y1. The generalization ability of the model is enhanced through the combination of residual connection and multiple activation functions.

[0026] like Figure 5 As shown in the figure, the processing process of the CMC module is as follows: it includes two paths; in the first path, the input feature is processed by Conv convolution to obtain feature B, and feature B is subjected to two maximum pooling operations to obtain feature B1 and feature B2, feature B, feature B1 and feature B2 are concat spliced ​​to obtain feature B3, feature B3 is processed by Conv convolution to obtain feature B4, feature B4 is subjected to two maximum pooling operations to obtain feature B5 and feature B6, feature B4, feature B5 and feature B6 are concat spliced ​​to obtain feature B7, feature B7 is sequentially processed by Conv convolution, BN batch normalization and SiLU activation function to obtain feature B8; in the second path, the input features are processed by three KCConv expanded convolutions of different sizes to obtain feature B9, feature B10 and feature B21. 10 , Feature B 11 The convolution kernel sizes of KCConv are 3×3, 5×5, and 7×7 respectively, and feature B9 and feature B 10 and feature B 11 Perform Concat to get feature B 12 ; Combine the feature B8 obtained in the first path with the feature B obtained in the second path 12 The output feature Y2 is obtained by adding them. By using continuous maximum pooling operations, the model can better understand the multi-level structure of the image and enhance the robustness and generalization ability of the model. By using three convolution kernels of different sizes for extended convolution, the model can capture contextual information of different scales, improve the multi-scale perception ability of the model, and also improve the resolution and computational efficiency of the feature map.

[0027] like Figure 6As shown in the figure, the processing process of the APS-Attention mechanism module is as follows: the input feature is subjected to the average pooling operation to obtain feature C, feature C is sequentially subjected to the PSA attention mechanism module and the Sigmoid activation function to obtain feature C1, and feature C and feature C1 are added through the residual connection to finally obtain the output feature Y3.

[0028] like Figure 7 As shown in the figure, the processing process of the PSA attention mechanism module is as follows: the input features are subjected to four average pooling operations to obtain features D1, D2, D3 and D4, features D1, D2, D3 and D4 are concat-concatenated to obtain feature D5, feature D5 is processed by the attention weight module and the Softmax activation function to obtain feature D6, and features D5 and D6 are multiplied element by element to obtain the output.

[0029] S3: Use the insulator defect images in the training set to train the CGC-YOLO network model, and use the insulator defect images in the validation set to evaluate the performance of the CGC-YOLO network model during the training process to obtain a trained CGC-YOLO network model; After building the CGC-YOLO network model, the processed data set is placed in two pre-set folders in jpg image format and txt text format. Before model training, all images are uniformly resized to 640×640. The training parameters are set as follows: 200 training times, 4 batch sizes (i.e., 4 images are processed each time for training), and the learning rate is set to 0.01. After completing the above preparations, start model training. After training, the model will output the detection results, the predicted defect location will be displayed on the picture, and the detection accuracy of each defect will be marked.

[0030] S4: Input the insulator defect image to be tested into the trained CGC-YOLO network model to detect the insulator defects.

[0031] The CGC-YOLO network model designed by the present invention has been improved in the backbone network, the neck network and the head network. First, in the backbone network, a lightweight CGC module is used as the core of feature extraction. The CGC module has extremely strong scalability, can effectively reduce the amount of model parameters, provides strong support for the deployment of mobile devices such as drones, and realizes real-time target detection. In addition, the CGC module is based on the global feature extraction method and enhances the local expression ability of the image by introducing global features. Secondly, in the neck network, the CMC module and the APS-Attention mechanism module are added. The CMC module is used to extract deeper feature information and enhance the detection ability of small targets. By reducing the spatial dimension of the feature map, the maximum pooling operation in the CMC module significantly reduces the computational complexity and memory consumption of subsequent layers, thereby speeding up the training and reasoning speed of the model, while reducing the risk of overfitting and improving the generalization ability of the model. The APS-Attention mechanism uses global context information to help the model better understand the overall structure and background of the image. At the same time, the mechanism focuses on capturing local details and dynamically adjusts the importance of local features, making the model more sensitive to fine-grained information and helping to better handle targets of different scales. Finally, in the head network, an insulator detection head dedicated to detecting small defects and contamination is added, further improving the detection accuracy of the model.

[0032] The above only expresses the preferred implementation of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosure to modify or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.

Claims

1. An insulator defect detection method based on lightweight CGC-YOLO, characterized in that: The following steps are involved: S1: Construct an image dataset of transmission line insulator defects and divide it into a training set and a validation set; S2: Build a CGC-YOLO network model, which includes a backbone network, a neck network, and a head network; The backbone network includes two Conv convolution modules, two CGC1 modules, a Conv convolution module, three CGC2 modules, a Conv convolution module, six CGC3 modules, a Conv convolution module and three CGC4 modules connected in sequence, and the output features of the two CGC1 modules, the three CGC2 modules, the six CGC3 modules and the three CGC4 modules are respectively used as the input of the neck network; The neck network includes a CMC module, a CGC module, a Conv convolution module, an upsampling module, a Concat splicing module and an APS-Attention mechanism module. The CMC modules are set to 4, namely, a CMC1 module, a CMC2 module, a CMC3 module and a CMC4 module. The processing process of the neck network is as follows: the outputs of the two CGC1 modules are subjected to feature extraction by the CMC1 module to obtain feature M1, the outputs of the three CGC2 modules are subjected to feature extraction by the CMC2 module to obtain feature M2, the outputs of the six CGC3 modules are subjected to feature extraction by the CMC3 module to obtain feature M3, the outputs of the three CGC4 modules are subjected to feature extraction by the CMC4 module to obtain feature M4, feature M4 is subjected to Conv convolution processing to obtain feature M5, feature M5 is upsampled and Concat spliced ​​with feature M3 to obtain feature M6, feature M6 After feature extraction by the CGC module, feature M7 is obtained. After feature M7 is processed by Conv convolution, feature M8 is obtained. After upsampling feature M8, feature M9 is concat-joined with feature M2 to obtain feature M9. After feature extraction by the CGC module, feature M9 is obtained. 10 , feature M 10 After Conv convolution processing, feature M is obtained 11 , for feature M 11 After upsampling, concatenate it with feature M1 to get feature M 12 , feature M 12 , Feature M 11 , feature M8, and feature M5 are respectively subjected to the APS-Attention mechanism module to strengthen the feature extraction operation and obtain feature M 13 , Feature M 14 , Feature M 15 , Feature M 16 , feature M 13 After the CGC module feature extraction, the feature M is obtained 17 , feature M 17 After Conv convolution processing and feature M 14 Perform Concat to get feature M 18 , feature M 18 After the CGC module feature extraction, the feature M is obtained 19 , feature M 19 After Conv convolution processing and feature M 15 Perform Concat to get feature M 20 , feature M 20 After the CGC module feature extraction, the feature M is obtained 21 , feature M 21 After Conv convolution processing and feature M 16 Perform Concat to get feature M 22 , feature M 22 After the CGC module feature extraction, the feature M is obtained 23 , and finally the feature M 17 , Feature M 19 , Feature M 21 With feature M 23 As the output of the neck network; The head network includes four Detect modules, which are used to detect insulator images with defects of different sizes. 17 , Feature M 19 , Feature M 21 With feature M 23 Four Detect modules are input respectively for insulator defect detection; the Detect module includes a convolutional layer and a fully connected layer, which are used to predict the category to which each candidate box belongs; S3: Use the insulator defect images in the training set to train the CGC-YOLO network model, and use the insulator defect images in the validation set to evaluate the performance of the CGC-YOLO network model during the training process to obtain a trained CGC-YOLO network model; S4: Input the insulator defect image to be tested into the trained CGC-YOLO network model to detect the insulator defects.

2. The insulator defect detection method based on lightweight CGC-YOLO according to claim 1 is characterized in that: The structures of the CGC1 module, CGC2 module, CGC3 module, and CGC4 module are the same as those of the CGC module. The processing process of the CGC module is as follows: the input features are sequentially subjected to Conv convolution, BN batch normalization, and SiLU activation function operations to obtain feature X1; feature X1 is processed twice in different ways, the first time Conv convolution, BN batch normalization, and SiLU activation function operations are performed to obtain feature X2, and the second time feature X3 is processed by the GC module, feature X2 and feature X3 are added to obtain feature X4, feature X4 is respectively subjected to average pooling and Conv convolution, BN batch normalization, and SiLU activation function operations to obtain feature X5 and feature X6, feature X5 and feature X6 are concat-joined to obtain feature X7, feature X7 is processed by the GC module to obtain feature X8, feature X8 and the input feature are connected through a residual network to obtain feature X9, and feature X9 is subjected to a Sigmoid activation function operation to obtain an output feature Y.

3. The insulator defect detection method based on lightweight CGC-YOLO according to claim 2 is characterized in that: The processing process of the GC module is as follows: the input feature is subjected to Conv convolution operation to obtain feature A1, Conv convolution and Softmax activation operations are performed on feature A1 to obtain feature A2, average pooling and maximum pooling operations are performed on feature A1 to obtain feature A3, feature A1, feature A2 and feature A3 are multiplied to obtain feature A4, feature A4 is subjected to Conv convolution, BN batch normalization and SiLU activation function in turn to obtain feature A5, feature A5 is subjected to Conv convolution processing to obtain feature A6, feature A6 is connected to the input feature through a residual network to obtain feature A7, and feature A7 is subjected to Softmax activation function operation to obtain output feature Y1.

4. The insulator defect detection method based on lightweight CGC-YOLO according to claim 1, characterized in that: The processing process of the CMC module is as follows: it includes two paths; in the first path, the input feature is processed by Conv convolution to obtain feature B, and feature B is subjected to two maximum pooling operations to obtain feature B1 and feature B2, feature B, feature B1 and feature B2 are concat spliced ​​to obtain feature B3, feature B3 is processed by Conv convolution to obtain feature B4, feature B4 is subjected to two maximum pooling operations to obtain feature B5 and feature B6, feature B4, feature B5 and feature B6 are concat spliced ​​to obtain feature B7, feature B7 is sequentially subjected to Conv convolution, BN batch normalization and SiLU activation function operations to obtain feature B8; in the second path, the input feature is processed by three KCConv expanded convolutions of different sizes to obtain feature B9, feature B10 and feature B21. 10 , Feature B 11 , feature B9, feature B 10 and feature B 11 Perform Concat to get feature B 12 ; Combine the feature B8 obtained in the first path with the feature B obtained in the second path 12 Add them together to get the output feature Y2.

5. The insulator defect detection method based on lightweight CGC-YOLO according to claim 1, characterized in that: The processing process of the APS-Attention mechanism module is as follows: the input feature is subjected to an average pooling operation to obtain feature C, feature C is sequentially subjected to the PSA attention mechanism module and the Sigmoid activation function to obtain feature C1, and feature C and feature C1 are added through a residual connection to finally obtain the output feature Y3.

6. The insulator defect detection method based on lightweight CGC-YOLO according to claim 5, characterized in that: The processing process of the PSA attention mechanism module is as follows: the input features are subjected to four average pooling operations to obtain features D1, D2, D3 and D4, features D1, D2, D3 and D4 are concat-concatenated to obtain feature D5, feature D5 is processed by the attention weight module and the Softmax activation function to obtain feature D6, and features D5 and D6 are multiplied element by element to obtain the output.

7. The insulator defect detection method based on lightweight CGC-YOLO according to claim 1, characterized in that: The Detect module also includes a non-maximum suppression algorithm and a loss function. The non-maximum suppression algorithm is used to remove overlapping detection frames to ensure that each target has only one detection frame. The loss function includes classification loss, positioning loss and confidence loss, which are used to measure the difference between the model prediction value and the true value.

8. The insulator defect detection method based on lightweight CGC-YOLO according to claim 1, characterized in that: The dataset consists of insulator images taken by drones, including dirty insulators and damaged insulators. The dataset is annotated and data enhanced. Labeling the dataset includes: using the LabelImg image labeling tool to mark the defective parts of the insulator in each image with rectangles. After labeling, a txt file containing the damage category, contamination category and corresponding labeling box coordinate information is generated; data enhancement processing is to optimize image quality through image quality enhancement, contrast adjustment and denoising.

Citation Information

Patent Citations

  • Insulator state rapid detection method based on lightweight YOLOv5 model

    CN115147383A

  • High-performance lightweight YOLOv5-3S-4PH insulator defect real-time detection method

    CN115222672A

  • YOLO-TGB vehicle detection system and method

    CN116503631A

  • Insulator detection method based on target detection algorithm and attention mechanism

    CN116895030A

  • Power transmission line insulator defect detection method based on computer vision

    CN117113066A

Cited By

  • AL-YOLO-based insulator defect detection method and system

    CN120726048A

  • An al-yolo-based insulator defect detection method and system

    CN120726048B