Insulator detection method based on lightweight improved YOLOv8n network
By improving the YOLOv8n network with a lightweight design and combining it with CSPPC, CCFM-Neck, and HRAMi modules, the real-time performance and accuracy issues of insulator detection on UAV equipment were resolved, achieving efficient insulator defect detection.
Patent Information
- Application Number
- CN202511049647.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-11
AI Technical Summary
Existing insulator testing methods suffer from poor real-time performance and low efficiency on UAV equipment, making it difficult to accurately identify and locate insulator defects.
We adopted a lightweight improved YOLOv8n network, improved the Backbone network by introducing the CSPPC module, designed the CCFM-Neck network and introduced the DyEMA attention mechanism, and combined the HRAMi module to build the Head network to optimize feature fusion and detection capabilities.
It improves the accuracy and efficiency of insulator detection, reduces the amount of computation and model parameters, is suitable for deployment on UAV platforms, and enables real-time detection of insulator defects.
Smart Images

Figure CN120931599A_ABST
Abstract
Description
Technical fields:
[0001] This invention relates to the field of image processing and target detection technology in the field of power transmission line equipment inspection technology, specifically to an insulator inspection method based on a lightweight improved YOLOv8n network. Background technology:
[0002] Insulators are widely used in power transmission lines and are crucial to their stable operation. Insulators not only provide excellent current insulation but also connect conductors and provide mechanical support. Due to long-term exposure to complex natural environments, insulators are prone to defects such as damage and flashover. Therefore, regular inspections are essential to ensure the safe and stable operation of lines, and the timely elimination of faults using stable and efficient defect detection methods is particularly critical. Traditional manual inspections require personnel to carry equipment, are greatly affected by geographical conditions, and pose significant safety hazards, resulting in low efficiency and high costs. Unmanned aerial vehicle (UAV) technology, equipped with image acquisition devices, offers simple operation, high flexibility, and is less affected by terrain, making it a new method for power line inspection.
[0003] With the development of deep learning and computer vision technologies, detecting insulator defects through aerial imagery, combined with existing hardware, has become an important direction for the development of this technology. However, due to limitations in the computing and storage capabilities of drones and the complexity of detection models, current inspection processes require transmitting images captured by drones to a data center for processing. This back-end processing method is inefficient and time-consuming, making it difficult to achieve real-time detection of insulators.
[0004] To achieve real-time insulator detection, it is necessary to reduce the number of detection model parameters and computational load while ensuring identification accuracy, so that it can be deployed on UAV equipment for real-time processing, thereby avoiding false detections and missed detections, and improving the efficiency and accuracy of insulator detection. Summary of the Invention:
[0005] The purpose of this invention is to address the problem of poor real-time information performance and low efficiency caused by the complex models carried by UAVs in real-time insulator detection tasks, and to propose an insulator detection method based on a lightweight improved YOLOv8n network.
[0006] To achieve the objectives of this invention, the following technical solution is proposed: an insulator detection method based on a lightweight improved YOLOv8n network includes:
[0007] Step 1: Based on the YOLOv8n framework, perform lightweight improvements to build an insulator defect detection model;
[0008] Step 2: Introduce the CSPPC (Cross Stage Partial PConv) module to improve the backbone network;
[0009] Step 3: Introduce the DyEMA attention mechanism to construct the CCFM-Neck (Cross-scale Feature FusionModule Neck) network to replace the YOLOv8n Neck network;
[0010] Step 4: Introduce HRAMi (Hierarchical Reciprocal Attention Mixer) in front of the small target detection head of the Head network.
[0011] In step 2, the Backbone sequentially includes a Conv layer (64 channels, 3×3 convolution, stride 2), a Conv layer (128 channels, 3×3 convolution, stride 2), a CSPPC module (128 channels), a Conv layer (256 channels, 3×3 convolution, stride 2), a CSPPC module (256 channels), a Conv layer (512 channels, 3×3 convolution, stride 2), a CSPPC module (512 channels), a Conv layer (1024 channels, 3×3 convolution, stride 2), a CSPPC module (1024 channels), and an SPPF module (1024 channels, 5×5 cores).
[0012] The CSPPC module is formed by replacing the Bottleneck of the C2f module with PConv_Bottleneck; the PConv_Bottleneck module is formed by concatenating two lightweight convolutional PConv (Partial Conv); the PConv first splits the input feature map according to the number of channels, performs regular convolution processing on the first 25% of the channel feature map, keeps the last 75% of the channel feature map unchanged, and finally concatenates the two.
[0013] Furthermore, in step 3, the CCFM-Neck network sequentially includes: layer 10: DyEMA module; layer 11: Conv layer (64 channels, 1×1 convolution, stride 1); layer 12: upsampling layer (2x scaling, nearest interpolation); layer 13: Conv layer (64 channels, 1×1 convolution, stride 1) performing convolution processing on layer 6 in the Backbone; layer 14: Concat layer fusing layers 12 and 13; layer 15: C2f module (64 channels); layer 16: Conv layer (64 channels, 1×1 convolution, stride 1); layer 17: upsampling layer (2x scaling, nearest interpolation); layer 18: ... The Conv layer (64 channels, 1×1 convolution, stride 1) performs convolution processing on layer 4 in the Backbone; layer 19: Concat layer merges layers 17 and 18; layer 20: C2f_DyEMA module (64 channels); layer 21: Conv layer (64 channels, 3×3 convolution, stride 2); layer 22: Concat layer merges layers 15 and 21; layer 23: C2f_DyEMA (64 channels); layer 24: Conv layer (64 channels, 3×3 convolution, stride 2); layer 25: Concat layer merges layers 10 and 24; layer 26: C2f_DyEMA module (64 channels).
[0014] Compared to the standard YOLOv8n Neck, the CCFM-Neck structure adds a 1×1 convolution after the SPPF module to reduce the number of output feature map channels from 256 to 64. It also adds 1×1 convolutions between the 4th and 6th layers of the backbone network and the Concat module to unify the number of channels to 64.
[0015] The DyEMA module combines the attention mechanism designed by EMA (Efficient Multi-scale Attention) and the DySample dynamic upsampling module. Input features are expanded through DySample upsampling and then fused with the features processed by EMA. Features are then extracted using a 3×3 depthwise separable convolution, and finally restored to the original number of channels using a 1×1 convolution. The EMA module uses two parallel branches to process the grouped features. One branch encodes global information and recalibrates channel weights using a 1×1 convolution kernel, while the other branch captures multi-scale spatial structure information using a 3×3 convolution kernel. The output features of the two branches are then processed through cross-dimensional intersection. Further fusion is performed to extract features at different scales. The DySample dynamically adjusts the sampling position during upsampling using a learnable offset, replacing the traditional fixed interpolation mode. Given a feature map X of size H1×W1×C and a sampling set δ of size H2×W2×2g, the two-dimensional coordinates of each position in δ are mapped onto the input feature map X, and bilinear interpolation is used to resample to a feature tensor X′ of shape H2×W2×C. The specific steps are: input the feature tensor X of H1×W1×C from the module, give the upsampling scaling factor s, and use input channels C and 2gs. 2 The linear layer calculation shape of the output channel is H×W×2gs 2 The offset O is then used to obtain a high-resolution tensor with shape sH×sW×2g through pixel recombination, which is added to the original grid G to obtain the sampling set δ; the C2f_DyEMA module is a DyEMA module connected in series after the C2f module.
[0016] Furthermore, in step 4, the Head network sequentially includes a 27th layer: the HRAMi module (which fuses features from layers 20, 23, 26, and 4), and a 28th layer: three Detect modules that receive feature maps from layers 27, 23, and 26 respectively. They extract features at three scales: 80×80, 40×40, and 20×20, and output four types of targets: normal insulators, flashover insulators, damaged insulators, and defective insulators.
[0017] This invention designs an improved YOLOv8n network to address the problems of low accuracy and high deployment cost in insulator defect detection based on convolutional neural networks. To ensure detection accuracy and reduce computational load and model parameters, a lightweight convolutional PConv module is used to build a CSPPC module to replace the C2f module in the backbone network. A CCFM-Neck structure is designed for the neck network to promote multi-scale feature fusion and further reduce model parameters and computational load. To enhance the network's resistance to background noise in complex environments, a DyEMA attention mechanism is designed and added to the first layer of the neck network and the layer before each detection head. An HRAMi module is introduced before the small target detection head to fuse multi-scale features and enhance the network's ability to detect small targets. This invention resolves the contradiction between accuracy, real-time performance, and lightweight design in existing insulator defect detection algorithms. The improved network has fewer model parameters, meaning smaller storage requirements and a lower hardware deployment threshold. It has efficient deployment capabilities in power grid inspection and is adaptable to mobile platforms such as drones, providing reliable technical support for automated inspection of smart grids and possessing significant engineering application value. Attached image description:
[0018] Figure 1 This is a flowchart of the method of the present invention;
[0019] Figure 2 The structure diagram of the improved YOLOv8n;
[0020] Figure 3 Here are the structural diagrams of CSPPC and C2f;
[0021] Figure 4 DyEMA structure diagram;
[0022] Figure 5 Here is a diagram of the HRAMi module structure;
[0023] Figure 6 Here is a diagram of the MobiVari architecture;
[0024] Figure 7 The experimental results show the detection model of this invention and existing target detection models. Detailed implementation method:
[0025] The present invention will be further described below with reference to the embodiments. It should be noted that the following embodiments are only used to further illustrate the present invention and should not be construed as limiting the scope of protection of the present invention. Some non-essential improvements and adjustments made by those skilled in the art based on the above-described invention are still within the scope of protection of the present invention.
[0026] This invention proposes a lightweight detection network based on an improved YOLOv8n, aiming to address the problems of low detection rate, high false negative rate, and poor real-time performance in existing insulator defect detection algorithms. This network achieves significant improvements in computational efficiency, multi-scale sensing capability, and robustness in complex environments through systematic optimization of the network architecture and feature fusion mechanism.
[0027] In this embodiment, the dataset is obtained by acquiring insulator images through publicly available online datasets or by taking photos independently. The data images include normal insulators, flashover insulators, damaged insulators, and defective insulators.
[0028] To ensure the model can accurately identify defects, the dataset is first labeled and preprocessed. Specifically, an image annotation tool is used to label the insulators in each image with rectangles, and the labels for normal insulators, flashover insulators, broken insulators, and defective insulators are uniformly set to "normal_insulator", "flasher_insulator", "broken_insulator", and "defect_insulator", respectively. After annotation, a txt file containing the coordinate information of the corresponding annotation boxes for different categories is generated. To further improve the model's detection accuracy, the dataset undergoes data augmentation preprocessing. The labeled insulator dataset is divided into training, validation, and test sets in an 8:1:1 ratio, and then the dataset is expanded using data augmentation methods such as random flipping, adding noise, and averaging pixels; the noise addition methods include adding Gaussian noise and salt-and-pepper noise. Data augmentation not only improves the model's adaptability to different scenarios and complex environments but also effectively enhances the model's ability to identify various defect morphologies.
[0029] Reference Figure 1 An improved lightweight insulator defect detection method using YOLOv8n includes the following steps:
[0030] Step 1: Based on the YOLOv8n framework, perform lightweight improvements to build an insulator defect detection model;
[0031] The improved YOLOv8n network model structure is as follows: Figure 2 As shown, it specifically includes: Backbone, CCFM-Neck, and Head.
[0032] Step 2: Introduce the CSPPC module to improve the Backbone network;
[0033] The Backbone consists of the following layers in sequence: Layer 0: Conv layer (16 channels, 3×3 convolution, stride 2), Layer 1: Conv layer (32 channels, 3×3 convolution, stride 2), Layer 2: CSPPC module (32 channels), Layer 3: Conv layer (64 channels, 3×3 convolution, stride 2), Layer 4: CSPPC module (64 channels), Layer 5: Conv layer (128 channels, 3×3 convolution, stride 2), Layer 6: CSPPC module (128 channels), Layer 7: Conv layer (256 channels, 3×3 convolution, stride 2), Layer 8: CSPPC module (256 channels), and Layer 9: SPPF module (256 channels, 5×5 cores).
[0034] The CSPPC module described above has the following structure: Figure 3 As shown, the C2f module's Bottleneck is replaced by PConv_Bottleneck; the PConv_Bottleneck module is composed of two lightweight convolutional PConv modules cascaded together; the PConv module first splits the input feature map according to the number of channels, performs regular convolution processing on the first 25% of the channel feature map, keeps the last 75% of the channel feature map unchanged, and finally concatenates the two.
[0035] Step 3: Introduce the DyEMA attention mechanism to construct the CCFM-Neck network to replace the YOLOv8n Neck network;
[0036] The CCFM-Neck network consists of the following layers in sequence: Layer 10: DyEMA module; Layer 11: Conv layer (64 channels, 1×1 convolution, stride 1); Layer 12: Upsampling layer (2x scaling, nearest interpolation); Layer 13: Conv layer (64 channels, 1×1 convolution, stride 1) performing convolution processing on Layer 6 of the Backbone; Layer 14: Concat layer merging Layers 12 and 13; Layer 15: C2f module (64 channels); Layer 16: Conv layer (64 channels, 1×1 convolution, stride 1); Layer 17: Upsampling layer (2x scaling, nearest interpolation); Layer 18: Conv layer. (64 channels, 1×1 convolution, stride 1) Convolution processing is performed on layer 4 of the Backbone; layer 19: Concat layer merges layers 17 and 18; layer 20: C2f_DyEMA module (64 channels); layer 21: Conv layer (64 channels, 3×3 convolution, stride 2); layer 22: Concat layer merges layers 15 and 21; layer 23: C2f_DyEMA (64 channels); layer 24: Conv layer (64 channels, 3×3 convolution, stride 2); layer 25: Concat layer merges layers 10 and 24; layer 26: C2f_DyEMA module (64 channels).
[0037] Compared to the standard YOLOv8n Neck, the CCFM-Neck structure adds a 1×1 convolution after the SPPF module to reduce the number of output feature map channels from 256 to 64. It also adds 1×1 convolutions between the 4th and 6th layers of the backbone network and the Concat module to unify the number of channels to 64.
[0038] The DyEMA module, such as Figure 4As shown, the attention mechanism, combining EMA (Efficient Multi-scale Attention) and the DySample dynamic upsampling module, expands the channels of the input features through DySample upsampling, then fuses them with the features processed by EMA. Features are then extracted through a 3×3 depthwise separable convolution, and finally restored to the original number of channels through a 1×1 convolution. The EMA employs two parallel branches to process the grouped features: one branch encodes global information and recalibrates channel weights using a 1×1 convolution kernel, while the other branch captures multi-scale spatial structure information using a 3×3 convolution kernel. The output features of the two branches are then processed through cross-dimensional intersection. Further fusion is performed to extract features at different scales. The DySample dynamically adjusts the sampling position during upsampling using a learnable offset, replacing the traditional fixed interpolation mode. Given a feature map X of size H1×W1×C and a sampling set δ of size H2×W2×2g, the two-dimensional coordinates of each position in δ are mapped onto the input feature map X, and bilinear interpolation is used to resample to a feature tensor X′ of shape H2×W2×C. The specific steps are: input the feature tensor X of H1×W1×C from the module, give the upsampling scaling factor s, and use input channels C and 2gs. 2 The linear layer calculation shape of the output channel is H×W×2gs 2 The offset O is then used to obtain a high-resolution tensor with shape sH×sW×2g through pixel recombination, which is added to the original grid G to obtain the sampling set δ; the C2f_DyEMA module is a DyEMA module connected in series after the C2f module.
[0039] Step 4: Introduce HRAMi in front of the small target detection head of the Head network.
[0040] The Head network consists of a 27th layer: an HRAMi module (fusing features from layers 20, 23, 26, and 4), and a 28th layer: three Detect modules that receive feature maps from layers 27, 23, and 26 respectively. These modules extract features at three scales: 80×80, 40×40, and 20×20, and output four types of targets: normal insulators, flashover insulators, damaged insulators, and defective insulators.
[0041] The structure diagram of the HRAMi module is as follows: Figure 5As shown, attention feature maps from different levels (Stage 1 to Stage 4) are received. Each level's attention feature map is upsampled to its original resolution (H×W) through pixel recombination, then concatenated along the channel dimension. Finally, the multi-scale feature maps are blended through a MobiVari layer. Stages 1 to 4 indicate that the HRAMi module requires four identical input dimensions. Pixel-Shuffle is an efficient upsampling method that improves the spatial resolution of the feature maps while maintaining the same number of channels. The MobiVari structure is as follows: Figure 6 As shown, this is a variant based on MobileNetV2 for efficient feature fusion. This module combines depthwise separable convolution with the LeakyReLU activation function to efficiently fuse multi-scale information and generate global attention weights.
[0042] To verify the effectiveness of the model of this invention, a comparative experiment was conducted between the detection model of this invention and existing target detection models. The experimental results are as follows: Figure 7 As shown, the improved YOLOv8n achieved accuracy, recall, and mAP@0.5 of 80.9%, 75.3%, and 81.6%, respectively. All three metrics are higher than YOLOv5n, YOLOv8n, and YOLO11n at the same parameter level. The improved YOLOv8n outperforms Faster R-CNN in all aspects; compared to YOLOv5s and YOLOv8s with one level of higher model parameters, the improved YOLOv8n is superior. mAP@0.5 is also leading, but its accuracy is slightly lower than YOLOv5s, and its recall is slightly lower than YOLOv8s. The improved YOLOv8n has only 1.611×106 parameters, significantly lower than similar networks, a 35.6% reduction compared to YOLOv5n's 2.504×106, a 46.4% reduction compared to YOLOv8n's 3.006×106, and a 37.6% reduction compared to YOLO11n's 2.583×106. The improved YOLOv8n... The computational cost of LOv8n is only 5.7 GFLOPs, a 21.9% reduction compared to YOLOv5n's 7.3 GFLOPs, a 30.5% reduction compared to YOLOv8n's 8.1 GFLOPs, and a 9.5% reduction compared to YOLO11n's 6.3 GFLOPs. Although the improved YOLOv8n achieves a computational speed of 222.9 frames per second, slightly higher than YOLOv8n and YOLO11n, it is lower than YOLOv5n, which is currently the fastest in the YOLO series.
[0043] This invention acquires images containing insulator defects from different perspectives, expands the insulator images using data augmentation methods, increases the diversity of the insulator dataset, constructs an improved YOLOv8n network, enhances the network's focus on insulator defect features, reduces false detections and false negatives, and can quickly and accurately identify and locate insulator defects in various complex background images.
Claims
1. A method for detecting insulator defects based on a lightweight improved YOLOv8n network, characterized in that, Includes the following steps: Step 1: Based on the YOLOv8n framework, perform lightweight improvements to build an insulator defect detection model; Step 2: Introduce the CSPPC (Cross Stage Partial PConv) module to improve the backbone network; Step 3: Introduce the DyEMA attention mechanism to construct the CCFM-Neck (Cross-scale Feature Fusion ModuleNeck) network to replace the YOLOv8n Neck network; Step 4: Introduce HRAMi (Hierarchical Reciprocal Attention Mixer) in front of the small target detection head of the Head network.
2. The insulator defect detection method based on a lightweight improved YOLOv8n network according to claim 1, characterized in that: In step 2, the Backbone sequentially includes: Layer 0: Conv layer (16 channels, 3×3 convolution, stride 2), Layer 1: Conv layer (32 channels, 3×3 convolution, stride 2), Layer 2: CSPPC module (32 channels), Layer 3: Conv layer (64 channels, 3×3 convolution, stride 2), Layer 4: CSPPC module (64 channels), Layer 5: Conv layer (128 channels, 3×3 convolution, stride 2), Layer 6: CSPPC module (128 channels), Layer 7: Conv layer (256 channels, 3×3 convolution, stride 2), Layer 8: CSPPC module (256 channels), and Layer 9: SPPF module (256 channels, 5×5 cores). The CSPPC module is formed by replacing the Bottleneck of the C2f module with PConv_Bottleneck; the PConv_Bottleneck module is formed by concatenating two lightweight convolutional PConv (Partial Conv); the PConv first splits the input feature map according to the number of channels, performs regular convolution processing on the first 25% of the channel feature map, keeps the last 75% of the channel feature map unchanged, and finally concatenates the two.
3. The insulator defect detection method based on a lightweight improved YOLOv8n network according to claim 1, characterized in that: In step 3, the CCFM-Neck network sequentially includes: layer 10: DyEMA module; layer 11: Conv layer (64 channels, 1×1 convolution, stride 1); layer 12: upsampling layer (2x scaling, nearest interpolation); layer 13: Conv layer (64 channels, 1×1 convolution, stride 1) performing convolution processing on layer 6 in the backbone; layer 14: Concat layer fusing layers 12 and 13; layer 15: C2f module (64 channels); layer 16: Conv layer (64 channels, 1×1 convolution, stride 1); layer 17: upsampling layer (2x scaling, nearest interpolation); layer 18: Co... The nv layer (64 channels, 1×1 convolution, stride 1) performs convolution processing on layer 4 in the Backbone; layer 19: Concat layer merges layers 17 and 18; layer 20: C2f_DyEMA module (64 channels); layer 21: Conv layer (64 channels, 3×3 convolution, stride 2); layer 22: Concat layer merges layers 15 and 21; layer 23: C2f_DyEMA (64 channels); layer 24: Conv layer (64 channels, 3×3 convolution, stride 2); layer 25: Concat layer merges layers 10 and 24; layer 26: C2f_DyEMA module (64 channels). Compared to the standard YOLOv8n Neck, the CCFM-Neck structure adds a 1×1 convolution after the SPPF module to reduce the number of output feature map channels from 256 to 64. It also adds 1×1 convolutions between the 4th and 6th layers of the backbone network and the Concat module to unify the number of channels to 64. The DyEMA module combines the attention mechanism designed by EMA (Efficient Multi-scale Attention) and the DySample dynamic upsampling module. Input features are upsampled and expanded by DySample, then fused with the features processed by EMA. Features are then extracted using a 3×3 depthwise separable convolution, and finally restored to the original number of channels using a 1×1 convolution. The EMA uses two parallel branches to process the grouped features. One branch encodes global information and recalibrates channel weights using a 1×1 convolution kernel, while the other branch captures multi-scale spatial structure information using a 3×3 convolution kernel. The output features of the two branches are then further fused through cross-dimensional interaction to extract features at different scales. DySample dynamically adjusts the sampling position during upsampling using learnable offsets, replacing the traditional fixed interpolation mode. Given a feature map X of size H1×W1×C and a sampling set δ of size H2×W2×2g, the two-dimensional coordinates of each position in δ are mapped onto the input feature map X, and bilinear interpolation is used to resample to a feature tensor X′ of shape H2×W2×C. The specific steps are as follows: Input the feature tensor X of H1×W1×C from the module, give the upsampling scaling factor s, and use input channels C and 2gs. 2 The linear layer calculation shape of the output channel is H×W×2gs 2 The offset O is then used to obtain a high-resolution tensor with shape sH×sW×2g through pixel recombination, which is added to the original grid G to obtain the sampling set δ; the C2f_DyEMA module is a DyEMA module connected in series after the C2f module.
4. The insulator defect detection method based on a lightweight improved YOLOv8 network according to claim 1, characterized in that: In step 4, the Head network sequentially includes layer 27: HRAMi module (fusing features from layers 20, 23, 26, and 4), and layer 28: three Detect modules that receive feature maps from layers 27, 23, and 26 respectively, extract features at three scales of 80×80, 40×40, and 20×20, and output four types of targets: normal insulators, flashover insulators, damaged insulators, and defective insulators.