An 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 have been solved, and efficient and real-time insulator defect detection is achieved.

CN119444752BActive Publication Date: 2025-05-30NANCHANG INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In practical applications, existing insulator defect detection methods face problems such as low detection accuracy, high error detection rate, high miss detection rate and large calculation amounts of inability to achieve real-time processing, especially in complex environments, UAV patrol efficiency is low.

Method used

The insulator defect detection method based on lightweight CGC-YOLO is adopted, and by optimizing the model structure and introducing the CMC module and the APS-Attention attention mechanism module, the calculation amount and the detection accuracy are reduced, which is suitable for efficient inspection in complex environments.

Benefits of technology

High-precision insulator defect detection is achieved with low calculation amount, which significantly improves the detection effect and practicality of the equipment side, and is suitable for real-time detection on mobile devices such as drones.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444752B_ABST
    Figure CN119444752B_ABST
Patent Text Reader

Abstract

The present invention discloses an insulator defect detection method based on lightweight CGC-YOLO. S1: Construct an image dataset of insulator defects on a transmission line and divide it into a training set and a validation set; S2: Construct a CGC-YOLO network model, which includes a backbone network, a neck network, and a head network; 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 measured into the trained CGC-YOLO network model for insulator defect detection. By optimizing the model structure and introducing innovative modules, the present invention achieves high-precision insulator defect detection with low computational complexity, meets the requirements of efficient inspection in complex environments, and significantly improves the detection effect and the practicality at the device end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Insulators are one of the indispensable important electrical components in transmission lines, mainly undertaking 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, during long-term use, insulators may be damaged or soiled under the influence of external factors such as rain, lightning strikes, hail, and bird droppings, resulting in a decline in insulation performance. Therefore, it is necessary to regularly inspect the insulators on high-voltage lines to promptly detect and replace the abnormally damaged insulators. Currently, the detection of insulator defects mainly relies on manual identification. Inspectors regularly check the insulators on high-voltage lines along the line, usually by visual observation or using a telescope to judge the defect situation. Such an inspection process is time-consuming, inefficient, and has a high missed detection rate. On transmission lines in complex terrains, it is difficult to achieve high-precision results with manual detection. 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 and the uneven conditions of insulators in the images, it has become impractical to check them one by one. Therefore, drones equipped with target detection algorithms have become the mainstream means for 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, there are various types and complex morphologies of insulator defects. When existing algorithms identify fine defects such as fine cracks, minute defects, and small soiling, there are often high false detection rates, poor accuracy, and missed detections. Second, during the drone inspection process, it is greatly affected by factors such as weather, light, and background complexity, and the captured pictures are blurred and of poor quality, which is not conducive to model training. Finally, although some complex deep learning models have improved in detection accuracy, they have a large amount of computation and cannot achieve real-time processing. Especially when the edge computing resources of drones are limited, the real-time performance of the algorithm is greatly restricted, affecting the inspection efficiency. Summary of the Invention

[0004] Aiming at the deficiencies of the existing technology, 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, which is suitable for the high-efficiency inspection requirements in complex environments and significantly improves the detection effect and the practicality of the device end.

[0005] To achieve the above object, the present invention provides the following technical solutions: An insulator defect detection method based on lightweight CGC-YOLO, comprising the following steps:

[0006] S1: Construct an image dataset of transmission line insulator defects and divide it into a training set and a validation set;

[0007] S2: Construct a CGC-YOLO network model, which includes a backbone network, a neck network, and a head network;

[0008] The backbone network includes two consecutive Conv convolution modules, two CGC 1 modules, a Conv convolution module, three CGC 2 modules, a Conv convolution module, six CGC 3 modules, a Conv convolution module, and three CGC 4 modules. The output features of the two CGC 1 modules, the three CGC 2 modules, the six CGC 3 modules, and the three CGC 4 modules are respectively used as the input of the neck network;

[0009] 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 attention mechanism module. There are 4 CMC modules, namely CMC 1 module, CMC 2 module, CMC 3 module, CMC 4 module. The processing process of the neck network is as follows: The output of the two CGC 1 modules is subjected to feature extraction by the CMC 1 module to obtain feature M 1 , the output of the three CGC 2 modules is subjected to feature extraction by the CMC 2 module to obtain feature M 2 , the output of the six CGC 3 modules is subjected to feature extraction by the CMC 3 module to obtain feature M 3 , the output of the three CGC 4 modules is subjected to feature extraction by the CMC 4 module to obtain feature M 4 , feature M 4 is processed by Conv convolution to obtain feature M 5 , after upsampling feature M 5 , it is combined with feature M 3Perform Concat concatenation to obtain feature M 6 , feature M 6 After feature extraction by the CGC module, feature M is obtained 7 , feature M 7 After Conv convolution processing, feature M is obtained 8 , for feature M 8 Perform upsampling and then Concat concatenation with feature M 2 Perform Concat concatenation to obtain feature M 9 , feature M 9 After feature extraction by the CGC module, feature M is obtained 10 , feature M 10 After Conv convolution processing, feature M is obtained 11 , for feature M 11 Perform upsampling and then Concat concatenation with feature M 1 Perform Concat concatenation to obtain feature M 12 , feature M 12 , feature M 11 , feature M 8 , feature M 5 Respectively, after the APS-Attention attention mechanism module strengthens the feature extraction operation, feature M is obtained 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, perform Concat concatenation with feature M 14 to obtain 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, perform Concat concatenation with feature M 15 to obtain 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, perform Concat concatenation with feature M 16 to obtain feature M 22 , feature M 22 After feature extraction by the CGC module, feature M is obtained 23 , finally, feature M 17 , feature M 19 , feature M 21 and feature M 23As the output of the neck network;

[0010] The head network includes four Detect modules, which are respectively used to detect insulator images with different sizes of defects, and input feature M 17 , feature M 19 , feature M 21 and feature M 23 into the four Detect modules respectively for insulator defect detection; the Detect module includes a convolutional layer and a fully connected layer, and is used to predict the category to which each candidate box belongs;

[0011] 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;

[0012] S4: Input the insulator defect image to be measured into the trained CGC-YOLO network model for insulator defect detection.

[0013] Further preferably, the structures of the CGC 1 module, the CGC 2 module, the CGC 3 module, and the CGC 4 module are all the same as the CGC module. The processing process of the CGC module is as follows: the input feature is successively operated by Conv convolution, BN batch normalization, and SiLU activation function to obtain feature X 1 ; perform two different processes on feature X 1 . The first time is to perform Conv convolution, BN batch normalization, and SiLU activation function operations to obtain feature X 2 . The second time is to process it through the GC module to obtain feature X 3 . Add feature X 2 and feature X 3 to get feature X 4 . Perform average pooling and Conv convolution, BN batch normalization, and SiLU activation function operations on feature X 4 respectively to obtain feature X 5 and feature X 6 . Concatenate feature X 5 and feature X 6 through Concat to obtain feature X 7 . Feature X 7 is processed through the GC module to obtain feature X 8 . Feature X 8 is connected to the input feature through a residual network to obtain feature X 9 . Feature X 9Perform the Sigmoid activation function operation to obtain the output feature Y.

[0014] Further preferably, the processing process of the GC module is as follows: The input feature undergoes a Conv convolution operation to obtain feature A 1 , for feature A 1 Perform a Conv convolution and a Softmax activation operation to obtain feature A 2 , for feature A 1 Perform average pooling and max pooling operations to obtain feature A 3 , and multiply feature A 1 , feature A 2 and feature A 3 to obtain feature A 4 , feature A 4 Successively passes through Conv convolution, BN batch normalization, and the SiLU activation function to obtain feature A 5 , feature A 5 Obtains feature A after Conv convolution processing 6 , connects feature A 6 to the input feature through a residual network to obtain feature A 7 , performs the Softmax activation function operation on feature A 7 to obtain the output feature Y 1 .

[0015] Further preferably, the processing process of the CMC module is as follows: It includes two paths; in the first path, the input feature undergoes Conv convolution processing to obtain feature B, and two max pooling operations are respectively performed on feature B to obtain feature B 1 and feature B 2 , and concatenate feature B, feature B 1 and feature B 2 to obtain feature B 3 , feature B 3 Obtains feature B after Conv convolution processing 4 , for feature B 4 Perform two max pooling operations respectively to obtain feature B 5 and feature B 6 , and concatenate feature B 4 , feature B 5 and feature B 6 to obtain feature B 7 , feature B 7 Successively passes through Conv convolution, BN batch normalization, and the SiLU activation function operation to obtain feature B 8 ; in the second path, the input feature respectively undergoes KCConv dilated convolution processing of three different sizes to obtain feature B 9, Feature B 10 , Feature B 11 , concatenate Feature B 9 , Feature B 10 and Feature B 11 through Concat to obtain Feature B 12 ; add the Feature B obtained in the first path 8 to the Feature B obtained in the second path 12 to obtain the output feature Y 2 .

[0016] Further preferably, the processing process of the APS - Attention attention mechanism module is as follows: the input feature undergoes an average pooling operation to obtain Feature C, and Feature C successively passes through the PSA attention mechanism module and the Sigmoid activation function to obtain Feature C 1 , add Feature C and Feature C 1 through residual connection to finally obtain the output feature Y 3 .

[0017] Further preferably, the processing process of the PSA attention mechanism module is as follows: the input feature respectively undergoes four average pooling operations to obtain Feature D 1 , Feature D 2 , Feature D 3 and Feature D 4 , concatenate Feature D 1 , Feature D 2 , Feature D 3 and Feature D 4 through Concat to obtain Feature D 5 , Feature D 5 is processed by the attention weight module and the Softmax activation function to obtain Feature D 6 , multiply Feature D 5 and Feature D 6 element - by - element to obtain the output.

[0018] 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, localization loss, and confidence loss, which are used to measure the difference between the model prediction value and the true value.

[0019] Further preferably, the data set is composed of insulator images captured by drones. The images include two cases of contaminated insulators and damaged insulators. The data set is labeled and data-augmented. Labeling the data set includes: using the LabelImg image annotation tool to perform rectangular annotation on the defective parts of insulators in each image. After the annotation is completed, a txt file containing the damaged category, the contaminated category, and the corresponding annotation box coordinate information is generated. The data augmentation process optimizes the image quality through image quality enhancement, contrast adjustment, and denoising.

[0020] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0021] The CGC-YOLO network model designed in 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 adopted as the core for feature extraction. The CGC module has extremely strong scalability, can effectively reduce the number of model parameters, provides strong support for the deployment of mobile devices such as drones, and realizes real-time object 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. Second, in the neck network, a CMC module and an APS-Attention attention mechanism module are added. The CMC module is used to extract deeper feature information and enhance the detection ability for small targets. By reducing the spatial dimension of the feature map, the max-pooling operation in the CMC module significantly reduces the computational amount and memory consumption of the subsequent layers, thereby accelerating the training and inference speed of the model, reducing the overfitting risk, and improving the generalization ability of the model. The APS-Attention attention mechanism uses global context information to help the model better understand the overall structure and background of the image. At the same time, this mechanism focuses on capturing local details and makes the model more sensitive to fine-grained information by dynamically adjusting the importance of local features, which helps to better process 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. Description of the Drawings

[0022] Figure 1 is the flowchart of the method of the present invention;

[0023] Figure 2 is the structural schematic diagram of the CGC-YOLO network model;

[0024] Figure 3 is the structural schematic diagram of the CGC module;

[0025] Figure 4 is the structural schematic diagram of the GC module;

[0026] Figure 5It is a schematic diagram of the CMC module structure;

[0027] Figure 6 It is a schematic diagram of the APS - Attention attention mechanism module structure;

[0028] Figure 7 It is a schematic diagram of the PSA attention mechanism module structure. Specific implementation manner

[0029] The following further describes the present invention in conjunction with embodiments. It is necessary to point out here that the following embodiments are only used to further illustrate the present invention and cannot be understood as limiting the protection scope of the present invention. Some non - essential improvements and adjustments made by those skilled in the art according to the above - mentioned invention content still fall within the protection scope of the present invention.

[0030] The present invention proposes an insulator defect detection method based on lightweight CGC - YOLO. This method uses lightweight modules to construct a network model. While maintaining a low number of parameters and low computational complexity, it ensures that the model has high detection accuracy, providing strong technical support for real - time detection on mobile devices such as unmanned aerial vehicles. The defective and soiled 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 soiling of different scales, thereby improving the recognition ability for small and large defect targets. In addition, in order to enhance the recognition effect of the model in complex backgrounds, the present invention introduces an attention mechanism into the model structure, enabling the model to focus on the key areas of insulators and further improving the robustness and detection accuracy of the model.

[0031] Refer to Figure 1 A method for detecting insulator defects based on lightweight CGC - YOLO includes the following steps:

[0032] S1: Construct an image dataset of transmission line insulator defects and divide it into a training set and a validation set;

[0033] In this embodiment, the dataset consists of insulator images captured by drones, and the images include two cases of contaminated insulators and damaged insulators. To ensure that the model can accurately identify defects, the dataset is first labeled and preprocessed. Specifically, the LabelImg image annotation tool is used to perform rectangular annotations on the defective parts of insulators in each image, and the labels of damaged insulators are uniformly set to "Defective_insulator", and the labels of contaminated insulators are uniformly set to "Polluted_insulator". After the annotation is completed, a txt file containing the damaged category, the contaminated category, and the coordinate information of the corresponding annotation box is generated so that the model can accurately locate the defect position. To further improve the detection accuracy of the model, data augmentation preprocessing is performed on the dataset. During the data augmentation process, the image quality is optimized through techniques such as image quality enhancement, contrast adjustment, and denoising, thereby improving the adaptability of the model in different scenarios and complex environments. Data augmentation can not only enrich the diversity of data but also effectively improve the model's ability to identify various defect forms. After the data preprocessing is completed, the dataset is divided into a training set and a validation set according to a ratio of 9:1. The training set is used for the parameter learning of the model, while the validation set is used to evaluate the performance of the model during the training process to help detect and prevent overfitting problems. Through this reasonable data division, it can be ensured that the model has good generalization ability while maintaining high detection accuracy, making it more suitable for actual application scenarios.

[0034] S2: Construct a CGC-YOLO network model, which includes a backbone network, a neck network, and a head network;

[0035] 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, used to extract local spatial information of the 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, enhance the expression ability of local features by introducing global features. This module combines global features with local features, enabling the model to capture global context information more effectively, thereby improving the overall recognition performance. In the neck network, it is composed of CMC modules, CGC modules, Conv convolutional modules, upsampling modules, Concat splicing modules, and APS-Attention attention mechanism modules. The CMC module is a bidirectional pooling structure used to extract deeper feature information and enhance the detection ability for small targets. By a dual pooling process, it reduces the spatial dimension of the feature map, reduces the computational amount and the number of parameters of the subsequent layers, and improves the computational efficiency of the model. 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 splicing module is used to splice feature maps of different scales together to form a new feature map, thereby enhancing the representation ability of the features. The APS-Attention attention mechanism module is composed of a residual network and a PSA attention mechanism module. It is an attention mechanism used to enhance the feature representation ability, enabling the model to focus on key regions, and capturing information at different scales by constructing multi-scale feature maps, which helps the model better process targets of different sizes. In the head network, an additional detection head specifically for small targets is added, enabling the four groups of detection heads to have the ability to detect insulators with large and small defects simultaneously. The Detect module includes convolutional layers and fully connected layers, used to predict the category to which each candidate box belongs. In the detection head, it also includes the non-maximum suppression (NMS) algorithm and the loss function. 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, localization loss, and confidence loss, used to measure the difference between the model prediction value and the true value, guiding the model to continuously optimize parameters during training, thereby improving the detection accuracy and robustness of the model.

[0036] The CGC-YOLO network model structure is as Figure 2 shown, specifically including:

[0037] The backbone network includes two consecutive Conv convolutional modules, two CGC 1 modules, a Conv convolutional module, three CGC 2 modules, a Conv convolutional module, and six CGC 3Module, Conv Convolution Module, and Three CGCs 4 Modules, respectively taking two CGCs 1 Modules, three CGCs 2 Modules, six CGCs 3 Modules and three CGCs 4 The output features of the modules are used as the input to the neck network.

[0038] The input to the backbone network is an image with a size of 640×640 and 3 channels, and its features are gradually extracted from top to bottom. First, the image undergoes two consecutive Conv convolution operations, and the size of the feature map is reduced to 160×160. Then, the network sequentially connects multiple modules, including 2 repeated CGC 1 Modules, one Conv Convolution Module, 3 repeated CGC 2 Modules, one Conv Convolution Module, 6 repeated CGC 3 Modules, one Conv Convolution Module, and finally 3 repeated CGC 4 Modules. After being gradually processed by these modules, the size of the feature map is reduced to 20×20, and the number of channels is 1024. In the backbone network, the convolution kernels of all convolution modules are 3×3 in size, and the stride is set to 2.

[0039] The neck network includes CMC Module, CGC Module, Conv Convolution Module, Upsampling Module, Concat Concatenation Module, and APS-Attention Attention Mechanism Module. The CMC Module is used to extract deeper features from shallow features, further enhancing the feature representation ability. There are 4 CMC Modules, namely CMC 1 Module, CMC 2 Module, CMC 3 Module, CMC 4 Module. The processing process of the neck network is as follows: The output of two CGC 1 Modules undergoes feature extraction by the CMC 1 Module to obtain feature M 1 , the output of three CGC 2 Modules undergoes feature extraction by the CMC 2 Module to obtain feature M 2 , the output of six CGC 3 Modules undergoes feature extraction by the CMC 3 Module to obtain feature M 3 , the output of three CGC 4 Modules undergoes feature extraction by the CMC 4 Module to obtain feature M 4 , feature M 4 Undergoes Conv convolution processing to obtain feature M5 , after upsampling the feature M 5 and performing Concat splicing with the feature M 3 to obtain the feature M 6 , the feature M 6 is obtained after feature extraction by the CGC module 7 , the feature M 7 is obtained after Conv convolution processing 8 , after upsampling the feature M 8 and performing Concat splicing with the feature M 2 to obtain the feature M 9 , the feature M 9 is obtained after feature extraction by the CGC module 10 , the feature M 10 is obtained after Conv convolution processing 11 , after upsampling the feature M 11 and performing Concat splicing with the feature M 1 to obtain the feature M 12 , the feature M 12 , the feature M 11 , the feature M 8 , the feature M 5 are respectively obtained after strengthening the feature extraction operation by the APS - Attention attention mechanism module 13 , the feature M 14 , the feature M 15 , the feature M 16 , the feature M 13 is obtained after feature extraction by the CGC module 17 , the feature M 17 is obtained after Conv convolution processing and performing Concat splicing with the feature M 14 to obtain the feature M 18 , the feature M 18 is obtained after feature extraction by the CGC module 19 , the feature M 19 is obtained after Conv convolution processing and performing Concat splicing with the feature M 15 to obtain the feature M 20 , the feature M 20 is obtained after feature extraction by the CGC module 21 , the feature M 21 is obtained after Conv convolution processing and performing Concat splicing with the feature M 16 to obtain the feature M 22 , the feature M 22 is obtained after feature extraction by the CGC module 23 , finally, the feature M 17, Feature M 19 , Feature M 21 With Feature M 23 As the output of the neck network.

[0040] In the neck network, it is mainly composed of a Feature Pyramid Network (FPN) and a Path Aggregation Network (PAN). The FPN network can transmit the semantic information of the high-level feature map to the low-level feature map through bottom-up feature information propagation, thereby enhancing the representation ability of the low-level feature map. The PAN network, on the other hand, further enhances the ability of multi-scale feature fusion through top-down feature information propagation, ensuring that each scale of feature map can obtain global and local information, thus improving the detection accuracy of the model. Between the FPN network and the PAN network, four APS-Attention attention mechanism modules are also connected. This attention mechanism module enables the model to better adapt to different scenarios 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 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, both contain Conv convolution modules, upsampling modules, CGC modules, and Concat splicing modules. The FPN network performs upsampling operations on the input features through these modules, while the PAN network performs downsampling operations on the input features through these modules. The collaborative work of these modules enables the FPN network and the PAN network to efficiently process multi-scale features and improve the overall performance of the model.

[0041] The head network includes four Detect modules, which are respectively used to detect insulator images with different sizes of defects, and input Feature M 17 , Feature M 19 , Feature M 21 And Feature M 23 Into the four Detect modules 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;

[0042] In the head network, there are a total of four groups of detection heads, which are used to detect insulator images with smaller defects, small defects, medium defects, and large defects respectively. Each group of detection heads is optimized for defects of different sizes to ensure that the model can effectively detect insulator defects at multiple scales. First, the Detect module performs a convolution operation on the input multi-scale feature map. The convolutional layer is used to further extract and enhance the features in the feature map, and by changing the number of channels of the feature map, it adapts to the subsequent detection tasks. Then, a 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 target). Finally, the non-maximum suppression (NMS) algorithm is used to remove overlapping detection boxes to ensure that each target has only one detection box. By setting a threshold, the NMS algorithm will select the detection box with the highest score and remove other boxes whose overlap with it exceeds the threshold. The Detect module also includes a loss function. The loss function guides the model to continuously optimize the parameters during training, balance different tasks, and improve the robustness and generalization ability of the model by measuring the difference between the model prediction value and the true value.

[0043] CGC 1 Module, CGC 2 Module, CGC 3 Module, CGC 4 The structures of the modules are the same as those of the CGC module. As Figure 3 shown, the processing process of the CGC module is as follows: The input features are sequentially passed through the Conv convolution, BN batch normalization, and SiLU activation function operations to obtain the feature X 1 ; The feature X 1 is processed in two different ways. The first time, it passes through the Conv convolution, BN batch normalization, and SiLU activation function operations to obtain the feature X 2 , and the second time, it passes through the GC module to obtain the feature X 3 . The feature X 2 is added to the feature X 3 to obtain the feature X 4 . The feature X 4 is respectively subjected to average pooling and Conv convolution, BN batch normalization, and SiLU activation function operations to obtain the feature X 5 and the feature X 6 . The feature X 5 is concatenated with the feature X 6 through Concat to obtain the feature X 7 . The feature X 7 passes through the GC module to obtain the feature X 8 . The feature X 8 is connected to the input feature through a residual network to obtain the feature X 9, Feature X 9 Perform the Sigmoid activation function operation to obtain the output feature Y. Through the above module design, not only the stability and performance of the model are improved, but also the feature extraction ability and generalization ability of the model are enhanced through the combination of various operations and modules.

[0044] Such as Figure 4 As shown, the processing process of the GC module is as follows: The input feature undergoes a Conv convolution operation to obtain feature A 1 , For feature A 1 Perform Conv convolution and Softmax activation operations to obtain feature A 2 , For feature A 1 Perform average pooling and max pooling operations to obtain feature A 3 , Multiply feature A 1 , Feature A 2 And feature A 3 To get feature A 4 , Feature A 4 Successively pass through Conv convolution, BN batch normalization, and SiLU activation function to obtain feature A 5 , Feature A 5 After Conv convolution processing, feature A is obtained 6 , Connect feature A 6 To the input feature through the residual network to obtain feature A 7 , Feature A 7 Perform the Softmax activation function operation to obtain the output feature Y 1 . Through the combination of residual connections and various activation functions, the generalization ability of the model is enhanced.

[0045] Such as Figure 5 As shown, the processing process of the CMC module is as follows: It includes two paths; in the first path, the input feature undergoes Conv convolution processing to obtain feature B, and two max pooling operations are respectively performed on feature B to obtain feature B 1 And feature B 2 , Feature B, feature B 1 And feature B 2 Perform Concat splicing to obtain feature B 3 , Feature B 3 After Conv convolution processing, feature B is obtained 4 , For feature B 4 Two max pooling operations are respectively performed to obtain feature B 5 And feature B 6 , Feature B 4 , Feature B 5 And feature B 6 Perform Concat splicing to obtain feature B 7, Feature B 7 Feature B is obtained by successively passing through Conv convolution, BN batch normalization, and SiLU activation function operations 8 ; In the second path, the input feature is respectively processed by three KCConv dilated convolutions of different sizes to obtain Feature B 9 , Feature B 10 , Feature B 11 , the kernel sizes of the KCConv dilated convolutions are 3×3, 5×5, and 7×7 respectively. Feature B 9 , Feature B 10 and Feature B 11 are concatenated by Concat to obtain Feature B 12 ; Feature B obtained in the first path 8 is added to Feature B obtained in the second path 12 to obtain the output feature Y 2 . By adopting consecutive max pooling operations, it helps the model better understand the multi-level structure of the image, enhancing the robustness and generalization ability of the model. By using three dilated convolutions with different kernel sizes, the model can capture context information at different scales, improving the multi-scale perception ability of the model, and also improving the resolution and computational efficiency of the feature map

[0046] As Figure 6 shown, the processing process of the APS-Attention attention mechanism module is as follows: the input feature passes through an average pooling operation to obtain Feature C, and Feature C successively passes through the PSA attention mechanism module and the Sigmoid activation function to obtain Feature C 1 , Feature C and Feature C 1 are finally added through residual connection to obtain the output feature Y 3 .

[0047] As Figure 7 shown, the processing process of the PSA attention mechanism module is as follows: the input feature passes through four average pooling operations respectively to obtain Feature D 1 , Feature D 2 , Feature D 3 and Feature D 4 , Feature D 1 , Feature D 2 , Feature D 3 and Feature D 4 are concatenated by Concat to obtain Feature D 5 , Feature D 5 passes through the attention weight module and the Softmax activation function to obtain Feature D 6 , Feature D 5 and Feature D 6Perform element-wise multiplication to obtain the output.

[0048] 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 the trained CGC-YOLO network model;

[0049] After constructing the CGC-YOLO network model, put the processed data set into two pre-set folders in the formats of jpg pictures and txt texts respectively. Before model training, uniformly adjust all pictures to a size of 640×640. The training parameters are set as follows: the number of training times is 200, the batch size is 4 (that is, 4 pictures are processed each time training), and the learning rate is set to 0.01. After completing the above preparations, start model training. After training ends, the model will output the detection results. The predicted defect positions will be displayed on the pictures, and the detection accuracy of each defect will be marked.

[0050] S4: Input the insulator defect image to be measured into the trained CGC-YOLO network model for insulator defect detection.

[0051] The CGC-YOLO network model designed in the present invention has been improved in the backbone network, neck network, and head network. First, in the backbone network, a lightweight CGC module is used as the core for feature extraction. The CGC module has strong scalability, can effectively reduce the number of model parameters, provides strong support for the deployment of mobile devices such as drones, and realizes real-time object 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. Second, in the neck network, the CMC module and the APS-Attention attention mechanism module are added. The CMC module is used to extract deeper feature information and enhance the detection ability for small targets. By reducing the spatial dimension of the feature map, the max-pooling operation in the CMC module significantly reduces the computational amount and memory consumption of the subsequent layers, thereby accelerating the training and inference speed of the model, reducing the overfitting risk, and improving the generalization ability of the model. The APS-Attention attention mechanism uses global context information to help the model better understand the overall structure and background of the image. At the same time, this mechanism focuses on capturing local details. By dynamically adjusting the importance of local features, the model is more sensitive to fine-grained information, which helps to better process 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.

[0052] The above only expresses the preferred embodiments of the present invention and does not limit the present invention in other forms. Any person skilled in the relevant art may use the disclosed content to make changes or modifications into equivalent embodiments with equivalent changes. However, any simple modification, equivalent change, and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within 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; 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, 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 average pooled to obtain feature X5, feature X4 is subjected to Conv convolution, BN batch normalization, and SiLU activation function operations to obtain 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; 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 sequence to obtain feature A5, feature A5 is subjected to Conv convolution processing to obtain feature A6, feature A6 is connected with 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 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 to obtain the output feature Y2; 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; 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.

2. The insulator defect detection method based on lightweight CGC-YOLO according to claim 1 is 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.

3. 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

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

    CN117113066A

  • Lightweight model-based strain clamp defect detection method

    CN117237327A