Transmission line insulator defect and tower bird nest detection method based on YOLOv8n
By improving the YOLOv8n algorithm and utilizing the PCFocalNeXt-C2f module, asymptotic pyramid network, and ECIoU loss function optimization model, the problems of low target recognition accuracy and high false recognition rate in the detection of insulator defects and bird nests on transmission lines were solved, achieving a more efficient detection effect.
Patent Information
- Application Number
- CN202410915155.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2044-07-09
AI Technical Summary
Existing target detection algorithms suffer from problems such as low target recognition accuracy and high false recognition rate when detecting defects in insulators of transmission lines and bird nests on towers. These problems include complex backgrounds, small defect targets, and large differences in the size of different targets.
A detection method based on YOLOv8n is adopted. The backbone is optimized by designing the PCFocalNeXt-C2f module, the inverse pyramid network (AFPN) and ECIoU loss function are introduced to optimize the neck part, and the detection results are obtained by using ECIoU-NMS to improve the robustness and detection performance of the model.
It improves the model's ability to extract multi-scale features and detect small targets, reduces the false recognition rate, and enhances detection accuracy and the model's generalization performance.
Smart Images

Figure CN119027366B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of transmission line defect detection, and particularly relates to a transmission line insulator defect and tower bird nest detection method based on YOLOv8n. BACKGROUND
[0002] With the advancement of smart grid construction, unmanned aerial vehicle aerial photography has become a common method in power inspection. Due to the large amount of image data obtained by aerial photography and the complex background, the manual screening method is time-consuming and laborious and has low efficiency, and at the same time, this method has the problems of high risk of missed detection and difficulty in ensuring the accuracy of judgment. Insulators are one of the most prone to failure power equipment in transmission lines, and tower bird nests are one of the common foreign matters in transmission line corridors. It is of great significance to reduce the work intensity of inspection personnel and improve the intelligent level of the power system to study a transmission line insulator defect and tower bird nest detection method based on deep learning.
[0003] At present, the mainstream deep learning target detection algorithm can be divided into single-stage target detection algorithm and two-stage target detection algorithm. Typical single-stage target detection algorithms include YOLO, SSD, etc., which can directly generate the class probability and position coordinate value of the object through one stage. Typical representatives of two-stage target detection algorithms include R-CNN, Fast R-CNN, Faster R-CNN, Mask R-CNN, etc., which usually generate candidate regions containing target approximate position information, and then classify and refine the position of the candidate regions. Compared with the two-stage target detection algorithm, the single-stage target detection algorithm does not need to generate candidate regions, has faster detection speed, and is more suitable for real-time detection of transmission line inspection. YOLOv8 is the latest algorithm of the YOLO series of single-stage target detection algorithms, and compared with other mainstream target detection algorithms, YOLOv8 has higher detection accuracy. Due to the problems of complex background, small defect target, and large size difference of different detection targets in the aerial inspection image of the unmanned aerial vehicle, direct use of the above algorithms has the problems of low target recognition accuracy and high misidentification rate, and the network needs to be further optimized.
[0004] In recent years, deep learning-based transmission line defect detection methods have been widely studied. For example, the patent document with the authorization announcement number CN111539302B discloses a glass insulator self-explosion recognition method based on a multi-scale deep disturbance neural network, which improves the classification ability and state detection accuracy of multi-class insulators in complex environments by using a multi-scale deep disturbance neural network-based glass insulator self-explosion recognition method. The detection speed of the insulator is improved by reducing the complexity of the convolution operation, but this method can only detect one kind of insulator self-explosion defect, and has poor generalization, and the method cannot well identify small defects such as insulator damage and insulator flashover. SUMMARY
[0005] The purpose of the present application is to solve the problem of low target recognition accuracy and high misrecognition rate in the prior art when detecting insulator defects and tower bird nests of power transmission lines, due to the complexity of the detection target background, the small size of the defect target, the large difference in the size of different detection targets, and the easy loss of defect features, and to provide a YOLOv8n-based insulator defect and tower bird nest detection method for power transmission lines.
[0006] To solve the above technical problems, the technical scheme adopted by the present application is:
[0007] The YOLOv8n-based insulator defect and tower bird nest detection method for power transmission lines comprises the following steps:
[0008] Step 1: Collect insulator defect and tower bird nest inspection images of power transmission lines to make a data set, divide the data set into a training set, a validation set and a test set, and expand the data set through data augmentation;
[0009] Step 2: Improve the YOLOv8n algorithm and build an insulator defect and tower bird nest detection model for power transmission lines;
[0010] Step 3: Train the model using the training set, detect the inspection images to be detected using the trained model, and compare the experimental results of the YOLOv8n algorithm before and after improvement.
[0011] Compared with the prior art, the present application has the following technical effects:
[0012] First, to solve the problem of small target insulator defect feature loss, a PCFocalNeXt-C2f module is designed and used to optimize the Backbone of YOLOv8n, which can better fuse fine-grained local interaction and coarse-grained global interaction, effectively avoid the problem of small target information loss during feature extraction, and improve the model's ability to extract multi-scale features and detect small targets; second, to solve the problem of information loss or degradation of defect features in multi-level transmission, an asymptotic pyramid network (AFPN) that supports direct interaction between non-adjacent layers is used to optimize the Neck of YOLOv8n; finally, the loss function ECIoU is introduced to optimize the loss function in YOLOv8n, and ECIoU-NMS is used to obtain the detection results, improving the robustness of the model. Experimental results show that the algorithm proposed in the present application has superior detection performance compared to the improved YOLOv8n. BRIEF DESCRIPTION OF DRAWINGS
[0013] The present application will be further described below:
[0014] Figure 1 Flowchart for the technical route of the present application;
[0015] Figure 2 Schematic diagram of CBS structure in YOLOv8n algorithm of the present application
[0016] Figure 3 Schematic diagram of Bottleneck structure in YOLOv8n algorithm of the present application
[0017] Figure 4 Schematic diagram of C2f structure in YOLOv8n algorithm of the present application
[0018] Figure 5 Schematic diagram of Focal NeXt block structure in improved YOLOv8n algorithm of the present application
[0019] Figure 6 Schematic diagram of PCFocalNeXt-C2f module structure in improved YOLOv8n algorithm of the present application
[0020] Figure 7 Schematic diagram of AFPN structure in improved YOLOv8n algorithm of the present application
[0021] Figure 8 Schematic diagram of original YOLOv8n structure
[0022] Figure 9 Schematic diagram of improved YOLOv8n structure DETAILED DESCRIPTION
[0023] The power line insulator defect and tower bird nest detection method based on YOLOv8n specifically comprises the following steps:
[0024] Step 1: Collect power line insulator defect and tower bird nest inspection images to make a data set, divide the expanded data set into a training set, a validation set and a test set, and expand the data set through data enhancement;
[0025] Step 2: Improve the original YOLOv8n algorithm to build a power line insulator defect and tower bird nest detection model;
[0026] Step 3: Train the model using the training set, detect the inspection images to be detected using the trained model, and compare the experimental results of the YOLOv8n algorithm before and after improvement.
[0027] In step 1, the training of the deep learning model requires a large amount of data, including picture data and corresponding label data of the pictures, and the amount of picture data with defect targets in power line inspection images is very small. Collecting enough inspection pictures with defect targets and performing data labeling requires a large amount of manual cost. Therefore, the data set can be expanded through data augmentation, which can greatly reduce the cost and improve the generalization of the model. It includes the following sub-steps:
[0028] Step 1-1: Collecting power line insulator defect and tower nest inspection images
[0029] Most of the inspection images are defect-free image data. Select images containing power line insulator defects and tower nests to make a data set. The data set should include as many types of target objects as possible. Only in this way can the target recognition model trained have good generalization performance in various test scenarios and prevent overfitting.
[0030] Step 1-2: Making and expanding the data set, including the following steps:
[0031] Step 1-2-1: Labeling the collected 795 inspection images using Labelme, which contains five detection targets, namely insulator explosion, insulator breakage, insulator flashover, tower nest, and insulator string.
[0032] Step 1-2-2: Divide the data set into training set, validation set and test set according to the ratio of 8:1:1.
[0033] The training set is a data sample set for model fitting, such as fitting some parameters to establish a classifier.
[0034] The validation set is a sample set left out during model training. It can be used to adjust the hyperparameters of the model and to preliminarily evaluate the ability of the model. It is usually used to verify the generalization ability (accuracy, recall rate, etc.) of the current model during model iteration training to prevent overfitting and determine how to adjust the hyperparameters.
[0035] The test set is not involved in training and is used to test the accuracy of the trained model.
[0036] Step 1-2-3: Expand the divided data set using data augmentation methods, including noise addition, brightness adjustment, cropping, rotation, translation and mirroring. The original 795 image data is expanded to 4770, and the picture data and corresponding picture label data are expanded at the same time during data set expansion.
[0037] In step 2, due to the problems of complex background, small defect target and large size difference of different detection targets in the unmanned aerial vehicle aerial inspection image of insulator defects, the current target detection algorithm is prone to lose defect features when identifying such targets, resulting in low precision and high misidentification rate. In order to improve the detection performance of YOLOv8n algorithm on insulator defects and tower bird nests of power transmission lines, the YOLOv8n algorithm is optimized, which includes the following sub-steps:
[0038] Step 2-1: design a PCFocalNeXt-C2f module, and use the module to optimize the YOLOv8n algorithm, so that the model can better fuse fine-grained local interaction and coarse-grained global interaction, effectively prevent small target information from being lost during feature extraction, improve the model's ability to extract multi-scale features and detect small targets, and the optimization method of YOLOv8n algorithm includes the following steps.
[0039] Step 2-1-1: PConv module is a module that can reduce redundant calculation and memory access at the same time, and can effectively extract spatial features. Focal NeXt block is a kind of focusing block designed in CFNet network. This module uses global attention or large convolution kernel to expand the receptive field, so as to obtain better performance when processing large size input image. The purpose is to fuse fine-grained local interaction and coarse-grained global interaction at the same time, which makes Focal NeXt block can more effectively fuse multi-scale features. The structure of Focal NeXt block is shown in Figure 5 , in which d7x7 layer represents a depth convolution with a convolution kernel of 7x7, n is the number of output features, r is the expansion rate of the additional convolution, 1x1 layer represents a Linear layer with a convolution kernel of 1x1, which is used to change the number of channels, LayerNorm layer is used for normalization processing, and GELU layer is an activation function Gaussian error linear unit. The structures of Bottleneck module and C2f module are shown in Figure 2 and Figure 3 , respectively. The PCFocalNeXt-C2f module designed by the application is shown in Figure 6 , which adds a PConv before the first CBS module and after the last CBS module of the C2f module to improve its feature extraction capability, and uses Focal NeXt block to replace Bottleneck in C2f module. This module makes the model better fuse fine-grained local interaction and coarse-grained global interaction, effectively prevents small target information from being lost during feature extraction, improves the model's ability to extract multi-scale features and detect small targets, and has lower parameter amount. This improvement greatly improves the detection accuracy of the model on insulator defects.
[0040] Step 2-1-2: Replace all C2f modules in the backbone of the original YOLOv8n with the PCFocalNeXt-C2f module of the present application.
[0041] Step 2-2: Replace the neck of YOLOv8n with an asymptotic feature pyramid network (AFPN) that supports direct interaction between non-adjacent levels to solve the problem of information loss or degradation of defective target features in multi-level transmission, the replacement method comprising the following steps:
[0042] Step 2-2-1: The structure of the asymptotic feature pyramid network (AFPN) is as shown in Figure 7 The solid arrows represent convolution, and the dashed arrows represent adaptive spatial feature fusion. AFPN is a structure that supports direct interaction between non-adjacent levels by fusing two adjacent low-level features and gradually incorporating high-level features into the fusion process, thereby avoiding large semantic gaps between non-adjacent levels. Due to the possibility of multi-object information conflict in the fusion process of features at each spatial location, the adaptive spatial feature fusion operation in AFPN is used to alleviate these inconsistencies. The asymptotic feature pyramid network (AFPN) is divided into two stages during the bottom-up feature extraction process of the backbone. In the first stage, two low-level features of different resolutions are fused, and as the process enters the later stage, high-level features are gradually incorporated into the fusion process, and finally fused with the top features of the backbone. This fusion method can avoid large semantic gaps between non-adjacent levels, and in this process, the semantics from low-level features and high-level features are directly interacted, avoiding information loss or degradation in multi-level transmission. During the entire feature fusion process, the adaptive spatial feature fusion operation is used to filter the features in the multi-level fusion process, thereby suppressing the information contradiction between different levels of features.
[0043] Step 2-2-2: Replace the neck of YOLOv8n with the asymptotic feature pyramid network (AFPN).
[0044] Step 2-3: Introduce the loss function ECIoU to optimize the loss function in YOLOv8n, thereby obtaining better positioning results and model performance, and use ECIoU-NMS to obtain the detection results, thereby improving the robustness of the model, the replacement method comprising the following steps:
[0045] Step 2-3-1: ECIoU loss function definition:
[0046]
[0047] In the formula: IoU represents the intersection over union of the real box and the predicted box, b and b gtrespectively represent the center points of the predicted box and the real box, represents the Euclidean distance between the two center points, represents the weight function, and is used to measure the similarity of the aspect ratio; w gt and h gt respectively represent the width and height of the real box, and w and h represent the width and height of the predicted box, respectively.
[0048] The term of in ECIoU uses the Sigmoid function to form a penalty term of the aspect ratio of the rectangular box, which makes the term of ECIoU more smooth and smooth than the term of CIoU, the function output value of which is (0, 0.25), which can directly meet the normalization requirement, simplify the complexity of the original loss function, make the regression loss function ECIoU obtain faster convergence speed, better positioning result and model performance, and use ECIoU-NMS to remove invalid target boxes in the detection image, reduce the misrecognition rate of the model to all detection targets, and improve the robustness of the model.
[0049] Step 2-3-2: replace the loss function of YOLOv8n with ECIoU, and replace the NMS of YOLOv8n with ECIoU-NMS.
[0050] In step 3, the model is trained using the training set, and experiments prove the superiority of the detection performance of the present application; step 3-1: when training the model, the model parameters are set, and the model evaluation index is determined, and the setting method includes the following steps:
[0051] Step 3-1-1: set the model parameters: the input image size (imgsz) is 640x640, the batch is 64, the training period (epochs) is 300, the number of processes (workers) is 32, the optimizer used is SGD, and the initial learning rate (lr0) and the final learning rate (lrf) are both 0.01.
[0052] Step 3-1-2: The present application uses precision, recall, F1 value, low-quality model precision indicator mAP@0.5, and high-quality model precision indicator mAP@0.5-0.95 to evaluate the detection performance of the model, and uses the parameter quantity Parameters to evaluate the size of the model. The precision is the proportion of the predicted correct data that is actually correct; the recall represents the search rate, that is, the probability of predicting the correct category frame; the F1 value represents the harmonic mean, which is used to balance the accuracy and recall; mAP@0.5 represents the average detection accuracy of all detection categories when the IoU threshold is 0.5; mAP@0.5-0.95 represents the average of 10 mAP values when the IoU threshold increases from 0.5 to 0.95 with a step of 0.05, which is a more accurate indicator than mAP@0.5 which only considers the IoU threshold of 0.5; Parameters represents the parameter quantity contained in the model; wherein the calculation formulas of precision, recall, F1 value, average precision indicators mAP@0.5 and mAP@0.5-0.95 are as follows:
[0053]
[0054] Step 3-2: The training set is used to train the model respectively. In order to prove the effectiveness of the improvement strategy, an ablation experiment is set up to compare the experimental results of YOLOv8n algorithm before and after improvement.
[0055] In order to verify the effectiveness of the improved algorithm in this paper, an ablation experiment as shown in Table 1 is established. Group 1 is the initial YOLOv8n algorithm; Group 2, Group 3, and Group 4 are algorithms after introducing PCFocalNeXt-C2f module, AFPN, and ECIoU into YOLOv8n respectively; Group 5 is an algorithm after introducing PCFocalNeXt-C2f module and AFPN into YOLOv8n; Group 6 is an algorithm after introducing PCFocalNeXt-C2f module and ECIoU into YOLOv8n; Group 7 is an algorithm after introducing AFPN and ECIoU into YOLOv8n; Group 8 is the algorithm proposed in this paper, which represents the algorithm after introducing PCFocalNeXt-C2f module, AFPN, and ECIoU into YOLOv8n.
[0056] Table 1 Ablation experiment results
[0057]
[0058] The experimental results show that the detection accuracy of each improved algorithm is higher than that of the original YOLOv8n model, proving the effectiveness of the PCFocalNeXt-C2f module designed in this paper, and also proving the effectiveness of the AFPN and ECIoU introduced. By comparing the algorithm (group 8) in this paper and the initial YOLOv8n algorithm (group 1), it can be seen that compared with the original YOLOv8n algorithm, the recall rate of the algorithm proposed in this paper is increased by 5.1%, the F1 value is increased by 3.2%, the map@50 and map@50-95 are increased by 3.9% and 5.9% respectively, and the parameter amount is reduced by 23.8%, proving that the improvement strategy in this paper effectively improves the detection performance of the model on power insulator defects and tower bird nests.
[0059] The embodiments described in the specification are merely a list of implementation forms of the inventive concept, and the protection scope of the present application should not be regarded as being limited to the specific forms stated in the embodiments, and the protection scope of the present application also extends to equivalent technical means that can be thought of by those skilled in the art according to the inventive concept.
Claims
1. A method for detecting defects of insulators and bird nests of towers of a power transmission line based on improved YOLOv8n, characterized in that, The method comprises the following steps: Step 1: collecting transmission line insulator defect and tower bird nest inspection image data set, dividing the data set into training set, validation set and test set, and expanding the data set through data enhancement; Step 2: improving the YOLOv8n algorithm, and constructing a transmission line insulator defect and tower bird nest detection model; Step 3: training the model using the training set, detecting the inspection image to be detected using the trained model, and comparing the experimental results of the YOLOv8n algorithm before and after improvement; In step 2, the following sub-steps are included: Step 2-1: design a PCFocalNeXt-C2f module, and use the module to optimize the YOLOv8n algorithm, and the optimization method comprises the following steps: Step 2-1-1: add a PConv before the first CBS module and after the last CBS module of the C2f module to improve the feature extraction capability, and replace the Bottleneck in the C2f module with a Focal NeXt block to design a PCFocalNeXt-C2f module; Step 2-1-2: replace all C2f modules in the backbone of the improved YOLOv8n with the PCFocalNeXt-C2f module designed in step 2-1-1; Step 2-2: use an asymptotic pyramid network (AFPN) that supports direct interaction on non-adjacent layers to replace the Neck part of YOLOv8n; Step 2-3: introduce a loss function ECIoU to optimize the loss function in YOLOv8n, and use ECIoU-NMS to obtain the detection result.
2. The method for transmission line insulator defect and tower bird nest detection based on improved YOLOv8n according to claim 1, characterized in that, In step 1, the following sub-steps are included: Step 1-1: collect transmission line insulator defect and tower bird nest inspection images; Step 1-2: make and expand the data set, and the making and expanding method comprises the following steps: Step 1-2-1: use Labelme to label the collected multiple inspection images, which contain five detection targets, namely insulator explosion, insulator breakage, insulator flashover, tower bird nest and insulator string; Step 1-2-2: divide the data set into training set, validation set and test set according to the ratio of 8:1:1; Step 1-2-3: expand the data set divided in step 1-2-2 using the data enhancement method, and expand the original multiple image data.
3. The method for transmission line insulator defect and tower bird nest detection based on improved YOLOv8n according to claim 1, characterized in that, In step 2-3, the ECIoU loss function is defined as: ;(1) ;(2) ;(3) wherein: IoU denotes the intersection over union of the true and predicted boxes, b and b gt denote the center points of the predicted and true boxes, respectively, denotes the Euclidean distance between the two center points, denotes a weighting function, used to measure the similarity of the aspect ratio; w gt and h gt denote the width and height of the true box, respectively, w and h denote the width and height of the predicted box, respectively, the term uses a sigmoid function to form a penalty term for the aspect ratio of the rectangular box.
4. The method for transmission line insulator defect and tower bird nest detection based on improved YOLOv8n according to claim 1, characterized in that, In step 2-1-1, the PCFocalNeXt-C2f module adds a PConv before the first CBS module and after the last CBS module of the C2f module, and replaces the Bottleneck in the C2f module with a Focal NeXt block.
5. The method for transmission line insulator defect and tower bird nest detection based on improved YOLOv8n according to claim 1, characterized in that, In step 3, the following sub-steps are included: Step 3-1: When training the model, set the input image size (imgsz) to 640x640, the batch size to 64, the training period (epochs) to 300, the number of processes (workers) to 32, the optimizer used to SGD, and the initial learning rate (lr0) and final learning rate (lrf) to 0.01; Step 3-2: Use the training set to train the original YOLOv8n model and the improved YOLOv8n model respectively, and set up an ablation experiment to compare the experimental results of the YOLOv8n algorithm before and after improvement.
6. The improved YOLOv8n-based transmission line insulator defect and tower bird nest detection method according to claim 5, characterized in that, In step 3-1, accuracy is used. Precision Recall rate Recall , F 1 value, low quality model accuracy index mAP @0.5 and high-quality model accuracy metrics mAP The model's detection performance is evaluated using a value of 0.5-0.95, and the number of parameters is [not specified]. Parameters To evaluate the size of the model; accuracy Precision Recall is the proportion of data where the prediction was correct but the actual value was correct; Recall This represents the recall rate, which is the probability of predicting the correct category box. F A value of 1 represents the harmonic mean, a metric used to balance precision and recall. mAP 0.5 represents the average detection accuracy across all detection categories when the IoU threshold is 0.5; mAP @0.5-0.95 represents the 10 values when the IoU threshold increases from 0.5 to 0.95 in increments of 0.
05. mAP The average value, compared to when only considering the IoU threshold of 0.
5. mAP @0.5 better reflects the model's accuracy; mAP This represents the number of parameters in the model; where accuracy is... Parameters Recall rate Precision , F 1 value, average accuracy index Recall @0.5 and mAP mAP The calculation formulas for @0.5-0.95 are shown in equations (4) to (8): ;(4) ;(5) ;(6) ;(7) ;(8)。
Citation Information
Patent Citations
A method for identifying spontaneous breakage of glass insulators based on multi-scale deep perturbation neural networks
CN111539302B
Insulator defect detection method and system based on YOLO detector
CN117455923A