Insulator defect detection method and device based on lightweight feature extraction network
By constructing a lightweight feature extraction network and combining phantom convolution and EMA attention mechanisms, the accuracy and real-time performance issues of insulator defect detection in UAV inspections were solved, achieving efficient and accurate power line defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-19
- Publication Date
- 2026-04-07
AI Technical Summary
Existing drone inspection technology suffers from low accuracy, poor real-time performance, and insufficient adaptability to the detection environment in power line defect detection, especially in insulator defect detection. Furthermore, existing deep learning algorithms are difficult to deploy efficiently on resource-constrained embedded devices.
A method for detecting insulator defects based on a lightweight feature extraction network is constructed. It adopts a cascaded backbone network, a hybrid encoder and a decoder head, and combines phantom convolution, EMA attention mechanism, CB-SPP module and knowledge distillation training to achieve feature extraction and multi-scale fusion. The detection performance is improved by using a lightweight network structure and feature knowledge distillation training.
Achieving high-precision, low-latency insulator defect detection in resource-constrained embedded platforms and UAV equipment reduces computational load and parameter scale, improving detection efficiency and adaptability.
Smart Images

Figure CN121544614B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer vision and power equipment detection, and particularly relates to an insulator defect detection method and device based on a lightweight feature extraction network. BACKGROUND
[0002] At present, the main methods for power line inspection include manual inspection, helicopter inspection and unmanned aerial vehicle (UAV) inspection. Although manual inspection has low cost, it has low efficiency and has great safety hazards. Helicopter inspection has high detection efficiency, but due to its high cost and influence of weather and other factors, it is difficult to be widely applied in a large range. Compared with the first two methods, UAV inspection has the advantages of low cost, high efficiency and good safety, and has become one of the main inspection methods at present. However, the existing UAV inspection technology still faces certain technical challenges, especially in power line inspection. The common insulator defect detection still has problems such as low precision, poor real-time performance and insufficient adaptability to detection environment.
[0003] With the continuous development of deep learning and computer vision technology, deep learning algorithms based on target detection have made certain progress in the field of power equipment detection. Although existing target detection algorithms such as YOLOv5 and Faster-RCNN have shown high precision in some detection tasks, they generally have problems such as large parameter quantity and high computational overhead, which makes it difficult for them to be efficiently deployed on resource-constrained embedded devices and unmanned aerial vehicles and other hardware. In addition, although these algorithms can provide high detection accuracy, in actual application, due to the limitation of computing resources, they often cannot meet the requirements of real-time detection, affecting their practicability in power inspection.
[0004] Therefore, there is an urgent need for a new technical solution to solve the technical problem of how to accurately and quickly detect defects of power lines. SUMMARY
[0005] The present application provides an insulator defect detection method and device based on a lightweight feature extraction network to solve the technical problem of how to accurately and quickly detect defects of power lines.
[0006] To achieve the above purpose, the present application provides an insulator defect detection method based on a lightweight feature extraction network, comprising:
[0007] constructing a first model; the first model comprises a cascaded backbone network, a hybrid encoder and a decoding head; the backbone network is used for feature extraction through a cascaded first regular convolutional block, a first phantom convolutional block, a phantom convolutional residual block, three first modules and a CB-SPP module; each of the first modules comprises a cascaded phantom convolutional block and a C2E module; the C2E module is used for feature extraction and weighting through a dense residual structure based on phantom convolution and EMA attention mechanism; the CB-SPP module is used for global and local information fusion through multi-scale pooling combined with channel and spatial attention mechanisms; the hybrid encoder is used for enhancing and multi-scale integrating the features output by the backbone network; the decoding head is used for obtaining a detection result according to the output of the hybrid encoder; the first model is trained based on the principle of knowledge distillation; and the target scene is detected for insulator defects according to the first model.
[0008] Preferably, the C2E module comprises a fourth phantom convolutional block, a fifth phantom convolutional block, an EMA attention module and a ReLU activation function layer; the input of the C2E module is processed by the fourth phantom convolutional block to obtain first features; the input of the C2E module is connected in residual with the first features to obtain second features; the second features are processed by the fifth phantom convolutional block to obtain third features; the input of the C2E module is connected in residual with the third features to obtain fourth features; the fourth features are processed by the EMA attention module to obtain fifth features; the input of the C2E module is connected in residual with the fifth features to obtain sixth features; and the sixth features are processed by the ReLU activation function layer to obtain the output of the C2E module.
[0009] Preferably, the CB-SPP module comprises a second regular convolutional block, a third regular convolutional block, a first maximum pooling layer, a second maximum pooling layer, a third maximum pooling layer, a fourth maximum pooling layer and a CBAM module; the input of the CB-SPP module is processed by the second regular convolutional block to obtain seventh features; the seventh features are input into the first maximum pooling layer; the first maximum pooling layer, the second maximum pooling layer, the third maximum pooling layer and the fourth maximum pooling layer are cascaded; the outputs of the second maximum pooling layer, the third maximum pooling layer and the fourth maximum pooling layer are respectively spliced with the seventh features and then jointly input into the CBAM module to obtain eighth features; the output of the first maximum pooling layer, the seventh features and the eighth features are jointly input into the third regular convolutional block to obtain the output of the CB-SPP module.
[0010] Preferably, the hybrid encoder comprises a cascaded AIFI module, an attention shuffle module and a DySample module.
[0011] The AIFI module is used to interact with features of the same scale in the output of the backbone network; the attention shuffling module is used to adaptively perform phantom convolution, channel attention enhancement, spatial attention enhancement or shortcut connection on the encoded features output by the AIFI module according to semantics; the DySample module is used to upsample the output of the attention shuffling module and adaptively generate the sampling point position during the upsampling process.
[0012] Preferably, the attention shuffling module includes a first branch, a second branch, a third branch, and a fourth branch; the first branch, the second branch, the third branch, and the fourth branch are respectively used to perform phantom convolution, channel attention enhancement, spatial attention enhancement, and shortcut connection on the output encoded features of the AIFI module; the outputs of the first branch, the second branch, the third branch, and the fourth branch are integrated as the output of the attention shuffling module.
[0013] Preferably, the first branch includes a cascaded sixth phantom convolutional block, a normalization layer, and a SiLu activation layer; the second branch includes a cascaded fourth regular convolutional layer, a normalization layer, a Hardswish activation layer, and a channel attention layer; the third branch includes a cascaded fifth regular convolutional layer, a normalization layer, a Hardswish activation layer, and a spatial attention layer; the fourth branch is a shortcut connection, with the input of the attention shuffling module as the branch output; the input of the attention shuffling module, i.e., the output encoded features of the AIFI module, is semantically adaptively input into the first, second, third, and fourth branches.
[0014] Preferably, the DySample module includes:
[0015] Two-dimensional offsets are predicted using 1×1 convolutions, and the coordinates of the sampling points are initialized using a static range factor.
[0016] ;
[0017] Where H is the sampling offset range and s is the upsampling factor.
[0018] The two-dimensional offset is constrained by a preset scaling factor and then added to the initial coordinates to obtain the sampling point position.
[0019] Preferably, the first model trained based on the knowledge distillation principle includes:
[0020] A model with the same structure as the first model but significantly more parameters is selected as the teacher model; the first model is used as the student model; channel-level distillation loss is used to perform inter-network feature distillation on the decoder inputs of both the teacher and student models, including:
[0021] The pre-trained teacher model is used to perform forward propagation on the input, obtaining the teacher model's feature map and prediction results, which serve as the learning target for the student model. The student model is then used to perform forward propagation on the input, obtaining its feature map and prediction results. By comparing the feature maps of the student and teacher models, the feature distillation loss is calculated using the first loss function, and the student model is optimized through backpropagation. The first loss function... include:
[0022] ;
[0023] ;
[0024] ;
[0025] in, Classification loss; For bounding box regression loss; To compare the losses; This is due to distillation losses; It refers to the batch size. For the number of channels, For distribution and Between divergence, For the first The first input teacher network prediction result One channel, For the first The first input student network prediction result One channel; For tensor normalization operations, These are the preset distillation temperature parameters; For adaptive distillation weights; This represents the number of training iterations. The length of the dataset.
[0026] Preferably, the phantom convolution residual block includes a cascaded second phantom convolution block and a third phantom convolution block; the input of the second phantom convolution block is concatenated with the output residual of the third phantom convolution block to serve as the output of the phantom convolution residual block.
[0027] The present invention also provides an insulator defect detection device based on a lightweight feature extraction network for implementing the method of the present invention. The device includes a first module, a second module and a third module.
[0028] The first module is used to construct the first model; the first model includes a cascaded backbone network, a hybrid encoder, and a decoder head; the backbone network is used for feature extraction through a cascaded first regular convolutional block, a first phantom convolutional block, a phantom convolutional residual block, a three-layer first module, and a CB-SPP module; the first module includes a cascaded phantom convolutional block and a C2E module; the C2E module is used for feature extraction and weighting through a dense residual structure based on phantom convolution and EMA attention mechanisms; the CB-SPP module is used for global and local information fusion through multi-scale pooling combined with channel and spatial attention mechanisms; the hybrid encoder is used to enhance and multi-scale integrate the features output by the backbone network; the decoder head is used to obtain the detection results based on the output of the hybrid encoder.
[0029] The second module is used to train the first model based on the principle of knowledge distillation.
[0030] The third module is used to detect insulator defects in the target scenario based on the first model.
[0031] The present invention has the following beneficial effects:
[0032] This invention presents an insulator defect detection method based on a lightweight feature extraction network. By embedding an EMA attention module into the residual structure composed of phantom convolutions to form a dense residual block C2E module, and constructing a CB-SPP module with efficient multi-scale fusion, the method achieves hierarchical coupling optimization of the convolutional layers, attention mechanism, and multi-scale feature fusion. This allows the first model to maintain lightweight design while possessing high feature representation capability and detection performance. By adding an attention shuffling module with feature selection and enhancement capabilities to the output of the AIFI module, the high-dimensional features encoded by the AIFI module can be extracted more effectively. Simultaneously, the lightweight and efficient point sampler Dysample module replaces the existing simple kernel upsampler, improving resource efficiency and significantly reducing computational workload and latency. Addressing the limitations of lightweight networks in learning ability and search space, a feature knowledge distillation training method based on student-teacher feature loss is constructed to train the first model. This enhances the optimization capability of the first network and improves the overall loss function, thereby increasing the training accuracy of the first model. The method of this invention improves the feature extraction, feature fusion and query matching mechanism, which can effectively reduce the computational load and parameter size of the model, and thus achieve high-precision, low-latency defect detection in resource-constrained embedded platforms and UAV equipment.
[0033] The insulator defect detection device based on a lightweight feature extraction network of the present invention, when used in the method of the present invention, has the same beneficial effects as the method of the present invention.
[0034] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description
[0035] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0036] Figure 1 This is a schematic diagram of the method flow of a preferred embodiment of the present invention.
[0037] Figure 2 This is a schematic diagram of the backbone network structure of a preferred embodiment of the present invention.
[0038] Figure 3 This is a schematic diagram of the phantom convolution block structure of a preferred embodiment of the present invention.
[0039] Figure 4 This is a schematic diagram of the phantom convolution residual block structure of a preferred embodiment of the present invention.
[0040] Figure 5 This is a schematic diagram of the C2E module structure according to a preferred embodiment of the present invention.
[0041] Figure 6 This is a schematic diagram of the CB-SPP module structure according to a preferred embodiment of the present invention.
[0042] Figure 7 This is a schematic diagram of the attention shuffling module structure according to a preferred embodiment of the present invention.
[0043] Figure 8 This is a schematic diagram of training the first model based on the knowledge distillation principle according to a preferred embodiment of the present invention.
[0044] Figure 9 This is a schematic diagram comparing the detection effects of the method of the present invention and the comparative method according to a preferred embodiment of the present invention.
[0045] Figure 10 This is a schematic diagram comparing the model heatmaps of the method of the present invention and the comparative method according to a preferred embodiment of the present invention. Detailed Implementation
[0046] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings, but the present invention can be implemented in many different ways as defined and covered by the claims.
[0047] See Figure 1 In a preferred embodiment of the present invention, an insulator defect detection method based on a lightweight feature extraction network is provided, comprising:
[0048] S1. Construct the first model; the first model includes a cascaded backbone network, a hybrid encoder, and a decoder head.
[0049] See Figure 2 The backbone network is used for feature extraction through cascaded first regular convolutional blocks, first phantom convolutional blocks, phantom convolutional residual blocks, three-layer first modules, and a CB-SPP module; the first module includes cascaded phantom convolutional blocks and a C2E module. The hybrid encoder is used to enhance and multi-scale integrate the features output by the backbone network. The decoder head is used to obtain the detection results based on the output of the hybrid encoder.
[0050] In a preferred embodiment of the present invention, see [reference needed]. Figure 3 The phantom convolutional block consists of a regular convolutional block (3×3) and a depthwise separable convolutional block (1×1). In the phantom convolutional block, the regular convolutional block receives the input of the phantom convolutional block, processes it, and outputs it to the depthwise separable convolutional block for further processing. The input and output of the depthwise separable convolutional block are concatenated along the channel dimension to obtain a feature map with the same number of output channels as the regular convolution, which is then used as the output of the phantom convolutional block.
[0051] In a preferred embodiment of the present invention, see [reference needed]. Figure 4 The phantom convolution residual block includes a cascaded second phantom convolution block and a third phantom convolution block; the input of the second phantom convolution block is concatenated with the output residual of the third phantom convolution block to serve as the output of the phantom convolution residual block.
[0052] In a preferred embodiment of the present invention, the C2E module is used for feature extraction and weighting through a dense residual structure based on phantom convolution and EMA attention mechanism.
[0053] See Figure 5 The C2E module includes a fourth phantom convolutional block, a fifth phantom convolutional block, an EMA attention module, and a ReLU activation function layer. The input of the C2E module passes through the fourth phantom convolutional block to obtain the first feature. The input of the C2E module is residually connected with the first feature to obtain the second feature. The second feature passes through the fifth phantom convolutional block to obtain the third feature. The input of the C2E module is residually connected with the third feature to obtain the fourth feature. The fourth feature passes through the EMA attention module to obtain the fifth feature. The input of the C2E module is residually connected with the fifth feature to obtain the sixth feature. The sixth feature passes through the ReLU activation function layer to obtain the output of the C2E module.
[0054] In a preferred embodiment of the present invention, since the C2E module is a dense residual structure based on phantom convolution and EMA attention mechanism, the module reduces computational load and improves the ability to capture cross-dimensional pixel relationships during feature extraction. EMA attention mechanism is a cross-spatial multi-scale attention module for visual tasks that captures pixel-level correlations through information interaction between different dimensions, thereby enhancing the expressive power of features.
[0055] In a preferred embodiment of the present invention, the CB-SPP module is used to perform global and local information fusion through multi-scale pooling combined with channels and spatial attention mechanisms.
[0056] See Figure 6 The CB-SPP module includes a second regular convolutional block (1×1), a third regular convolutional block (1×1), a first max-pooling layer, a second max-pooling layer, a third max-pooling layer, a fourth max-pooling layer, and a CBAM module (Convolutional Block Attention Module). The input to the CB-SPP module passes through the second regular convolutional block to obtain the seventh feature. The seventh feature is input to the first max-pooling layer. The first, second, third, and fourth max-pooling layers are cascaded. The outputs of the second, third, and fourth max-pooling layers are concatenated with the seventh feature and then input into the CBAM module to obtain the eighth feature. The output of the first max-pooling layer, the seventh feature, and the eighth feature are input into the third regular convolutional block to obtain the output of the CB-SPP module. Figure 6 In this context, C1 and C2 represent the preset number of channels.
[0057] In a preferred embodiment of this invention, the CB-SPP module specifically addresses the issues of information loss and overlap that may occur in traditional SPP layers when processing multi-scale targets. First, by setting the pooling kernel size to different sizes, such as (1, 5, 9, 13), the receptive field is effectively expanded, enabling the network to better understand and capture the semantic information of targets at different scales, thereby improving the model's generalization ability. Second, by sequentially connecting different pooling stages, the original data and multi-scale information are balanced. Finally, by combining the CBAM module and utilizing concatenated channel attention and spatial attention mechanisms, the weights of the feature maps are dynamically adjusted, allowing the network to focus more on important features, improving feature discriminativeness and generalization ability, and fusing local features with global information to enhance the network's detection performance.
[0058] In a preferred embodiment of the present invention, the deep layers of the backbone network are constructed by alternating stacked phantom convolutions and C2E modules, enabling the backbone network to progressively extract high semantic features. A CB-SPP module is set at the end of the backbone network, which fuses global and local information through multi-scale pooling combined with channel attention and spatial attention mechanisms, enabling the backbone network to output a high semantic feature map.
[0059] In a preferred embodiment of the present invention, the hybrid encoder includes a cascaded AIFI (Attention-based Internal Feature Interaction) module, an attention shuffling module, and a DySample module.
[0060] The AIFI module is used to interact with features of the same scale in the output of the backbone network; the attention shuffling module is used to adaptively perform phantom convolution, channel attention enhancement, spatial attention enhancement or shortcut connection on the encoded features output by the AIFI module according to semantics; the DySample module is used to upsample the output of the attention shuffling module and adaptively generate the sampling point position during the upsampling process.
[0061] See Figure 7 In a preferred embodiment of the present invention, the attention shuffling module includes a first branch, a second branch, a third branch, and a fourth branch. The first, second, third, and fourth branches are respectively used to perform phantom convolution, channel attention enhancement, spatial attention enhancement, and shortcut connection on the output encoding features of the AIFI module. The input to the attention shuffling module, namely the output encoding features of the AIFI module, is semantically adaptively input into the first, second, third, and fourth branches. The outputs of the first, second, third, and fourth branches are integrated and used as the output of the attention shuffling module.
[0062] In a preferred embodiment of the present invention, the first branch includes a cascaded sixth phantom convolutional block, a normalization layer, and a SiLu activation layer; the second branch includes a cascaded fourth regular convolutional layer (1×1), a normalization layer, a Hardswish activation layer, and a channel attention layer; the third branch includes a cascaded fifth regular convolutional layer (1×1), a normalization layer, a Hardswish activation layer, and a spatial attention layer; and the fourth branch is a shortcut connection, with the input of the attention shuffling module as the branch output.
[0063] In a preferred embodiment of the present invention, the DySample module includes:
[0064] Two-dimensional offsets are predicted using 1×1 convolutions, and the coordinates of the sampling points are initialized using a static range factor.
[0065] ;
[0066] Where H is the sampling offset range and s is the upsampling factor.
[0067] The two-dimensional offset is constrained by a preset scaling factor and then added to the initial coordinates to obtain the sampling point position.
[0068] In a preferred embodiment of the present invention, the Dysample module focuses on the calculation of position offset and sampling operations. Compared with traditional kernel-based upsampling, it does not require the generation of a time-consuming dynamic kernel with many parameters, which can significantly reduce the amount of computation and latency.
[0069] In a preferred embodiment of the present invention, an attention shuffling module is added to the output section of the AIFI module of the hybrid encoder, and combined with the DySample upsampling operation, structural coupling optimization of feature selection, attention enhancement, and multi-scale fusion can be achieved. This strategy not only reduces the amount of computation, but also significantly improves the detection accuracy of lightweight networks in complex scenes.
[0070] S2, Training the first model based on the knowledge distillation principle. S2 specifically includes:
[0071] See Figure 8 A model with the same structure as the first model but significantly more parameters is selected as the teacher model; the first model is used as the student model; channel-level distillation loss is used to perform inter-network feature distillation on the decoder inputs of both the teacher and student models, including:
[0072] The pre-trained teacher model is used to perform forward propagation on the input, obtaining the teacher model's feature map and prediction results, which serve as the learning target for the student model. The student model is then used to perform forward propagation on the input, obtaining its feature map and prediction results. By comparing the feature maps of the student and teacher models, the feature distillation loss is calculated using the first loss function, and the student model is optimized through backpropagation. The first loss function... include:
[0073] ;
[0074] ;
[0075] ;
[0076] in, Classification loss; For bounding box regression loss; To compare the losses; This is due to distillation losses; It refers to the batch size. For the number of channels, For distribution and Between divergence, For the first The first input teacher network prediction result One channel, For the first The first input student network prediction result One channel; For tensor normalization operations, These are the preset distillation temperature parameters; For adaptive distillation weights; This represents the number of training iterations. The length of the dataset.
[0077] In a preferred embodiment of the present invention, see [reference needed]. Figure 8 The specific training process includes:
[0078] First, the training dataset is loaded and fed into both the teacher and student models for training. Both models incorporate an AIFI module to enhance global contextual relationships in the feature maps. The aim is to enable the student model to focus not only on local features but also on global information when extracting features. The enhanced feature maps are then subjected to reparameterizable convolutions, which reduce computation while preserving important information. Cross-entropy is calculated on the tensors output from each corresponding part of the reparameterizable convolution, and the sum of the resulting similarities is used as the channel loss. The feature maps of each corresponding part of the teacher and student models are compared, and the first loss function is used to calculate the loss. After calculating the loss, the student model can gradually mimic the feature map features of the teacher network, thereby improving its feature extraction capabilities. Figure 8 In this context, conventional losses include category classification loss, bounding box regression loss, and intersection-union ratio loss, while channel-level distillation loss includes distillation loss.
[0079] In a preferred embodiment of the present invention, by constructing a knowledge distillation learning framework and using the output features of corresponding nodes in similar large networks for transfer learning, the optimization capability of the lightweight network is enhanced, which can improve the detection performance of the first model for small defect targets.
[0080] S3. Perform insulator defect detection on the target scene based on the first model.
[0081] After the first model reaches the preset training termination condition, the training is completed, and insulator defect detection is performed on the target scene based on the first model.
[0082] This invention presents an insulator defect detection method based on a lightweight feature extraction network. By embedding an EMA attention module into the residual structure composed of phantom convolutions to form a dense residual block C2E module, and constructing a CB-SPP module with efficient multi-scale fusion, the method achieves hierarchical coupling optimization of the convolutional layers, attention mechanism, and multi-scale feature fusion. This allows the first model to maintain lightweight design while possessing high feature representation capability and detection performance. By adding an attention shuffling module with feature selection and enhancement capabilities to the output of the AIFI module, the high-dimensional features encoded by the AIFI module can be extracted more effectively. Simultaneously, the lightweight and efficient point sampler Dysample module replaces the existing simple kernel upsampler, improving resource efficiency and significantly reducing computational workload and latency. Addressing the limitations of lightweight networks in learning ability and search space, a feature knowledge distillation training method based on student-teacher feature loss is constructed to train the first model. This enhances the optimization capability of the first network and improves the overall loss function, thereby increasing the training accuracy of the first model. The method of this invention improves the feature extraction, feature fusion and query matching mechanism, which can effectively reduce the computational load and parameter size of the model, and thus achieve high-precision, low-latency defect detection in resource-constrained embedded platforms and UAV equipment.
[0083] In a preferred embodiment of the present invention, an insulator defect detection device based on a lightweight feature extraction network is also provided to implement the method of the present invention. The device includes a first module, a second module, and a third module.
[0084] The first module is used to construct the first model; the first model includes a cascaded backbone network, a hybrid encoder, and a decoder head; the backbone network is used for feature extraction through a cascaded first regular convolutional block, a first phantom convolutional block, a phantom convolutional residual block, a three-layer first module, and a CB-SPP module; the first module includes a cascaded phantom convolutional block and a C2E module; the C2E module is used for feature extraction and weighting through a dense residual structure based on phantom convolution and EMA attention mechanisms; the CB-SPP module is used for global and local information fusion through multi-scale pooling combined with channel and spatial attention mechanisms; the hybrid encoder is used to enhance and multi-scale integrate the features output by the backbone network; the decoder head is used to obtain the detection results based on the output of the hybrid encoder.
[0085] The second module is used to train the first model based on the principle of knowledge distillation.
[0086] The third module is used to detect insulator defects in the target scenario based on the first model.
[0087] The insulator defect detection device based on a lightweight feature extraction network of the present invention, when used in the method of the present invention, has the same beneficial effects as the method of the present invention.
[0088] Verification section:
[0089] In a preferred embodiment of the present invention, the dataset used includes the China Power Line Insulator Defect Dataset (CPLID) and some defective insulator images crawled from the internet. The original data contains 600 normal samples and 248 defective samples. To improve data diversity, various enhancement processes such as fogging and mosaic were performed. After enhancement, the total number of data images expanded to 6784, including 4800 normal insulator images and 1984 defective images.
[0090] The first model of this invention and four other classic object detection models were trained using the same insulator defect dataset and the same training set / validation set partitioning strategy for performance comparison. The comparison models included Faster Region Convolutional Neural Network (Faster RCNN), YOLOv5, YOLOv9, RT-DETR-resnet50, and RT-DETR-X. Experimental results are shown in Table 1.
[0091] ;
[0092] As shown in Table 1, the first model of this invention achieves the highest detection speed and average accuracy compared to classic object detection models Faster R-CNN and YOLOv5, while having the fewest model parameters. In the two-stage object detection model, YOLOv9, with GELAN as its backbone network, achieved high detection accuracy, reaching an mAP50-95 of 0.812 on the entire dataset. However, its large parameter count and computational cost make it difficult to deploy efficiently on low-cost edge platforms such as drones. Compared to more advanced object detection models, the first model of this invention achieves detection accuracy close to YOLOv9 and RT-DETR-X while significantly reducing model size. Its mAP50-95 on the entire dataset is similar to these models, while its parameter count and floating-point computation cost are significantly lower. The detection speed reaches 147.06 frames / s, demonstrating significantly better overall detection efficiency than other comparative models.
[0093] Figure 9 The results show the differences in detection results among multiple lightweight models. Figure 9The improved model, namely the first model of this invention, shows that lightweight network models such as YOLOv5 and RT-DETR-resnet50 have problems with missing insulator defects under strong fog and high occlusion backgrounds. The first model of this invention can accurately identify insulator defects in the image and accurately mark their positions, effectively reducing the false detection and missed detection of self-explosion defects during the detection process.
[0094] To provide a more intuitive analysis of the model performance before and after the improvement, heatmaps of the detection head output were extracted from various models, and the detection results of some lightweight models were compared. For example... Figure 10 As shown, Figure 10 The improved model, namely the first model of this invention, compared to other RT-DETR models, has its heatmap pixels concentrated on the detected target itself, achieving results close to the RT-DETR-X model, which has a much larger volume. This indicates that the first model of this invention can stably extract abnormal features while being lightweight, with fewer background misjudgments and less uncertainty about information outside the target, thus exhibiting stronger recognition capabilities.
[0095] To verify the impact of different data densities on the performance of the proposed model, a multi-sample-size performance stability experiment was designed. Specifically, a portion of the validation set samples were redistributed to the training set, and the model was trained and tested separately at seven different proportions: 25%, 40%, 55%, 70%, 85%, 100%, and 115% of the total training set. This was to analyze the performance trends under scenarios of scarce and abundant data. Simultaneously, under the same data perturbation and augmentation strategies, the performance of typical detection models such as YOLOv5s, Faster R-CNN, and RT-DETR-R50 was compared and evaluated. The experimental results are shown in Table 2.
[0096] ;
[0097] As shown in Table 2, the detection accuracy of different models all showed an upward trend as the training sample size gradually increased, but the growth rate and stability differed significantly. In the low sample size stage (25%–55%), all models exhibited a certain degree of performance degradation. In contrast, the first model of this invention achieved an accuracy of 0.434 with 55% sample size, an improvement of approximately 4.6% compared to YOLOv5s, indicating stronger feature extraction and representation capabilities in small sample scenarios. When the training sample size increased to 70% or higher, the performance growth of the first model of this invention was more significant, with its mAP50-90 increasing from 0.434 to 0.698, and then to 0.799, an increase of approximately 84.0%, significantly higher than other comparative models. Furthermore, the performance fluctuation of the first model of this invention did not exceed 3.0% under data perturbation of ±15%. In summary, the first model of this invention exhibits higher detection capability and generalization performance in low to medium sample size scenarios, and is better able to fully extract feature information under high sample size conditions, with performance improvement tending to stabilize. This demonstrates that the first model of the present invention can maintain superior performance stability under different data densities, verifying its advantages of low dependence on training data and stronger deployment reliability in power inspection tasks.
[0098] To verify the deployability of the first model of this invention in edge computing scenarios, while maintaining the network structure, the first model of this invention was trained and quantized using INT8. In an experimental environment comparable to the computing power of typical edge devices, the inference performance was evaluated under different input resolutions (320×320, 512×512, 640×640) and batch sizes (8, 16, 32). The detection speed (FPS), parameter count (Params), and computational cost (GFLOPs) of the quantized model were statistically analyzed, and the results are shown in Table 3.
[0099] ;
[0100] As can be seen, after INT8 quantization, the first model of this invention maintains a high inference frame rate and stable computational burden and parameter scale under different input resolutions and batch sizes. Even at the highest input resolution (640×640) and a large batch size, the quantized model can still meet the real-time detection requirements; at lower resolutions, the inference speed is further improved, making it more suitable for latency-sensitive edge scenarios. The above results demonstrate that the first model of this invention still has good accuracy retention and inference efficiency after low-bit quantization, providing a feasible basis for deployment on low-power edge devices.
[0101] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting insulator defects based on a lightweight feature extraction network, characterized in that, include: A first model is constructed, comprising a cascaded backbone network, a hybrid encoder, and a decoder head. The backbone network is used for feature extraction via a cascaded first regular convolutional block, a first phantom convolutional block, a phantom convolutional residual block, a three-layer first module, and a CB-SPP module. The first module comprises a cascaded phantom convolutional block and a C2E module. The C2E module is used for feature extraction and weighting via a dense residual structure based on phantom convolution and EMA attention mechanisms. The CB-SPP module is used for global and local information fusion via multi-scale pooling combined with channel and spatial attention mechanisms. The hybrid encoder is used to enhance and multi-scale integrate the features output by the backbone network. The decoder head is used to obtain detection results based on the output of the hybrid encoder. The first model is trained based on the knowledge distillation principle. Insulator defect detection is performed on the target scene based on the first model. The C2E module includes a fourth phantom convolutional block, a fifth phantom convolutional block, an EMA attention module, and a ReLU activation function layer. The input to the C2E module passes through the fourth phantom convolutional block to obtain a first feature. The input to the C2E module is residually concatenated with the first feature to obtain a second feature. The second feature passes through the fifth phantom convolutional block to obtain a third feature. The input to the C2E module is residually concatenated with the third feature to obtain a fourth feature. The fourth feature passes through the EMA attention module to obtain a fifth feature. The input to the C2E module is residually concatenated with the fifth feature to obtain a sixth feature. The sixth feature passes through the ReLU activation function layer to obtain the output of the C2E module. The CB-SPP module includes a second regular convolutional block, a third regular convolutional block, a first max-pooling layer, a second max-pooling layer, a third max-pooling layer, a fourth max-pooling layer, and a CBAM module. The input of the CB-SPP module passes through the second regular convolutional block to obtain a seventh feature. The seventh feature is input to the first max-pooling layer. The first, second, third, and fourth max-pooling layers are cascaded. The outputs of the second, third, and fourth max-pooling layers are concatenated with the seventh feature and then input into the CBAM module to obtain an eighth feature. The output of the first max-pooling layer, the seventh feature, and the eighth feature are input into the third regular convolutional block to obtain the output of the CB-SPP module.
2. The insulator defect detection method based on a lightweight feature extraction network according to claim 1, characterized in that, The hybrid encoder includes a cascaded AIFI module, an attention shuffling module, and a DySample module; The AIFI module is used to perform information interaction on features of the same scale in the output of the backbone network; the attention shuffling module is used to adaptively perform phantom convolution, channel attention enhancement, spatial attention enhancement or shortcut connection on the encoded features output by the AIFI module according to semantics; the DySample module is used to upsample the output of the attention shuffling module and adaptively generate the sampling point position during the upsampling process.
3. The insulator defect detection method based on a lightweight feature extraction network according to claim 2, characterized in that, The attention shuffling module includes a first branch, a second branch, a third branch, and a fourth branch; the first branch, the second branch, the third branch, and the fourth branch are respectively used to perform phantom convolution, channel attention enhancement, spatial attention enhancement, and shortcut connection on the output encoding features of the AIFI module; the outputs of the first branch, the second branch, the third branch, and the fourth branch are integrated as the output of the attention shuffling module.
4. The insulator defect detection method based on a lightweight feature extraction network according to claim 3, characterized in that, The first branch includes a cascaded sixth phantom convolutional block, a normalization layer, and a SiLu activation layer; the second branch includes a cascaded fourth regular convolutional layer, a normalization layer, a Hardswish activation layer, and a channel attention layer; the third branch includes a cascaded fifth regular convolutional layer, a normalization layer, a Hardswish activation layer, and a spatial attention layer. The fourth branch is a shortcut connection, with the input of the attention shuffling module as the branch output; the input of the attention shuffling module, i.e. the output encoding features of the AIFI module, is semantically adaptively input into the first branch, the second branch, the third branch, and the fourth branch.
5. The insulator defect detection method based on a lightweight feature extraction network according to claim 4, characterized in that, The DySample module includes: Two-dimensional offsets are predicted using 1×1 convolutions, and the coordinates of the sampling points are initialized using a static range factor. ; Where H is the sampling offset range and s is the upsampling factor; The two-dimensional offset is constrained by a preset scaling factor and then added to the initial coordinates to obtain the sampling point position.
6. The insulator defect detection method based on a lightweight feature extraction network according to claim 5, characterized in that, The training of the first model based on the knowledge distillation principle includes: A model with the same structure as the first model but a much larger number of parameters is selected as the teacher model; the first model is used as the student model; channel-level distillation loss is used to perform inter-network feature distillation on the decoder inputs of the teacher and student models, including: The pre-trained teacher model is used to perform forward propagation on the input to obtain the feature map and prediction results of the teacher model, which serve as the learning target for the student model. The student model is then used to perform forward propagation on the input to obtain its feature map and prediction results. By comparing the feature maps of the student model and the teacher model, a first loss function is used to calculate the feature distillation loss, and the student model is optimized through backpropagation. The first loss function... include: ; ; ; in, Classification loss; For bounding box regression loss; To compare the losses between the two; This is due to distillation losses; It refers to the batch size. For the number of channels, For distribution and Between divergence, For the first The first input teacher network prediction result One channel, For the first The first input student network prediction result One channel; For tensor normalization operations, These are the preset distillation temperature parameters; For adaptive distillation weights; This represents the number of training iterations. The length of the dataset.
7. The insulator defect detection method based on a lightweight feature extraction network according to claim 6, characterized in that, The phantom convolution residual block includes a cascaded second phantom convolution block and a third phantom convolution block; the input of the second phantom convolution block and the output residual of the third phantom convolution block are concatenated to form the output of the phantom convolution residual block.
8. An insulator defect detection device based on a lightweight feature extraction network, used to implement the method according to any one of claims 1 to 7, characterized in that, The device includes a first module, a second module, and a third module; The first module is used to construct a first model; the first model includes a cascaded backbone network, a hybrid encoder, and a decoder head; the backbone network is used for feature extraction through a cascaded first regular convolutional block, a first phantom convolutional block, a phantom convolutional residual block, a three-layer first module, and a CB-SPP module; the first module includes a cascaded phantom convolutional block and a C2E module; the C2E module is used for feature extraction and weighting through a dense residual structure based on phantom convolution and EMA attention mechanisms; the CB-SPP module is used for global and local information fusion through multi-scale pooling combined with channel and spatial attention mechanisms; the hybrid encoder is used to enhance and multi-scale integrate the features output by the backbone network; the decoder head is used to obtain detection results based on the output of the hybrid encoder. The second module is used to train the first model based on the principle of knowledge distillation; The third module is used to perform insulator defect detection on the target scene based on the first model.
Citation Information
Patent Citations
Insulator defect detection method based on multi-scale characteristics and channel perception
CN119295828A
Image anomaly detection method and system based on lightweight target detection model
CN119904624A