A construction and detection method, device and storage medium of an insulator defect detection model based on CDC-YOLOv8

By introducing a cross-stage local heterogeneous convolution module and a convolution and attention hybrid module into the insulator defect detection model, combined with an expanded residual module, the model structure was optimized, solving the problems of high model complexity and poor detection effect for small targets, and achieving efficient and accurate insulator defect detection.

CN119741584BActive Publication Date: 2025-12-05HARBIN UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411733061.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-12-05
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

Existing insulator defect detection models suffer from high model complexity, high computational cost, and the need for further improvement in the detection performance of small targets. Furthermore, their generalization ability and noise suppression performance are limited in complex backgrounds and diverse environments.

Method used

A cross-stage local heterogeneous convolution module (CSPHet) and a convolution and attention hybrid module (CAFM) are introduced into the backbone network and combined with an expanded residual module (DWR) to construct a CDC-YOLOv8 model. Through feature fusion and feature extraction optimization, the model complexity is reduced and the detection accuracy and generalization ability are improved.

Benefits of technology

While reducing model complexity, it significantly improves the accuracy and stability of insulator defect detection, especially the accuracy of detection in small targets and complex backgrounds, and reduces the false negative rate and noise interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741584B_ABST
    Figure CN119741584B_ABST
Patent Text Reader

Abstract

The application discloses a construction method of an insulator defect detection model based on CDC-YOLOv8, a computer device and a storage medium, and relates to the field of insulator defect detection.The construction method comprises the following steps: S1, a light-weight CSPHet module is designed by using HetConv to replace part of C2f modules of a YOLOv8 backbone network; S2, a CAFM module is introduced at an output layer of the backbone network; and S3, DWR is fused into a C2f module of a neck part of the YOLOv8, so that a bottleneck component in the C2f module of the neck part of the YOLOv8 is replaced, and the construction of the model is completed.The detection model of the application replaces part of C2f modules of a backbone by a cross-stage local heterogeneous convolution, realizes the dual improvement of model light weight and detection precision, introduces a convolution and attention mixed module at an output layer of the backbone network, suppresses the interference of factors such as background and noise, and improves the attention of small targets; and a C2f-DWR based on a dilated residual attention module is designed to replace part of C2f modules of a neck part, so that the multi-scale feature extraction capability of the model is enhanced, and the missing detection rate of small targets is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of insulator defect detection, in particular to the field of construction and detection method, equipment and storage medium of insulator defect detection model based on CDC-YOLOv8. BACKGROUND

[0002] As a key component of the power transmission line, the insulator is mainly responsible for mechanical fixation, connection of electric wires and cables, and electrical insulation of the power transmission line. The insulator is easily eroded by rainwater, contaminated, and affected by climate change and lightning, which may cause self-explosion and falling, posing a significant threat to the safe operation of the power transmission line. In severe cases, it may lead to large-scale power outages in the region, affecting the normal life of enterprises and urban and rural residents. Therefore, accurately detecting the defects of the insulator is an important measure to ensure the normal operation of the power transmission system. Unmanned aerial vehicle inspection is gradually replacing manual inspection and helicopter inspection due to its low cost, good flexibility, and high efficiency. In the unmanned aerial vehicle inspection task, the images taken usually include a complex background composed of towers, mountains, rivers, and grasslands. The number of pictures collected is large, and the size of the insulator varies greatly. The insulator target information is not prominent due to the influence of complex environmental factors such as light and weather, which affects the accuracy of insulator defect detection.

[0003] In the prior art, the detection of insulator defects mainly relies on manual inspection or detection methods based on traditional machine learning algorithms. Patent document CN113298789A (publication date 2021.08.24) proposes an insulator defect detection method based on a multi-head self-attention mechanism. By combining a deep convolutional neural network with a self-attention module, the precision and efficiency of insulator defect detection in unmanned aerial vehicle aerial images in the power grid scenario are improved. However, this method has the disadvantages of high model complexity, high computational cost, and the detection effect of small targets needs to be further improved. In addition, the generalization ability and noise suppression effect of this model are also limited in complex backgrounds and diverse environments.

[0004] To overcome the above-mentioned deficiencies of the prior art, a construction and detection method, equipment and storage medium of an insulator defect detection model based on CDC-YOLOv8 are proposed. This method introduces a cross-stage local heterogeneous convolution module (CSPHet) and a convolution and attention hybrid module (CAFM), which significantly reduces the complexity and memory consumption of the model while ensuring detection accuracy. The C2f-DWR structure used can better fuse multi-scale features, especially in small target detection, significantly reducing the missed detection rate. This method also improves the generalization ability of the model through data enhancement techniques and enhances the suppression effect of complex backgrounds and noise, further improving the accuracy and stability of the detection. SUMMARY

[0005] The application provides a construction and detection method, equipment and storage medium of a CDC-YOLOv8-based insulator defect detection model, to solve the problems of high model complexity, high calculation cost and poor detection effect on small targets in existing insulator defect detection.

[0006] To achieve the above object, the technical scheme adopted by the application is as follows:

[0007] A construction method of a CDC-YOLOv8-based insulator defect detection model, the CDC-YOLOv8-based insulator defect detection model comprising an input module, a backbone network, a neck and a head;

[0008] The input module is used to load an original image into the insulator defect detection model for preprocessing, the preprocessing being adjusting the pixels of the original image to 640x640x3px, and then transmitting the preprocessed image to the backbone network, the original image being an image of an insulator to be detected;

[0009] The backbone network is used to extract feature information of the received image and generate a feature map from the feature information;

[0010] The neck fuses the upper and lower information flows of the network by combining FPN and PAN;

[0011] The head adopts a decoupled head structure, uses two parallel branches to extract class features and position features respectively, and then uses one layer of 1x1 convolution to complete the classification and positioning tasks, uses binary cross-entropy loss for the classification task, and uses distribution focal loss and complete intersection over union for the regression task of the bounding box boundary;

[0012] Further, the insulator defect detection model construction method comprises:

[0013] Step one: a lightweight CSPHet module is designed by using HetConv to replace part of the C2f module of the YOLOv8 backbone network;

[0014] Step two: a CAFM module is introduced at the output layer of the backbone network;

[0015] Step three: DWR is fused into the C2f module of the neck of the YOLOv8, replacing the bottleneck component in the C2f of the neck of the YOLOv8, to complete the construction of the model.

[0016] Further, the method further comprises an optimization step of the detection model:

[0017] S1. Obtain a plurality of insulator images, and preprocess all the images;

[0018] S2. Label all image data to form an insulator defect image dataset, and divide the dataset into a training set and a test set according to an 8:2 ratio;

[0019] S3. Construct an insulator defect detection model based on CDC-YOLOv8;

[0020] S4. Train and test the insulator defect detection model using the training set and the test set to obtain a target insulator defect detection model, and perform performance evaluation. When the evaluation result meets the requirements, save the weight, and the insulator defect detection model optimization is completed; otherwise, adjust the network parameters and continue training.

[0021] Further, in step S2, all image data is labeled according to the defect conditions of the insulator, and the labeling information includes but is not limited to: insulator wire loosening, insulator damage, insulator contamination, insulator self-explosion and normal insulator.

[0022] Further, the specific way of replacing part of the C2f module of the YOLOv8 backbone network with a lightweight CSPHet module designed by HetConv is: first, performing convolution operation on the feature map, and then performing Split operation to divide the shallow feature map into two parts in the channel dimension; one part is propagated to the back through n HetConv for feature extraction, and the other part is directly concatenated with the output of the feature extraction module through the cross-stage hierarchical structure.

[0023] Further, the specific way of introducing a CAFM module at the output layer of the backbone network is: first, using a 1x1 convolution to adjust the channel dimension in the local branch, and then using a channel shuffle operation to further mix and fuse the channel information. The channel shuffle divides the input tensor into multiple groups along the channel dimension, uses a depth separable convolution to cause channel shuffle in each group, then connects the output tensors of each group along the channel dimension to generate a new output tensor, and finally uses a 3x3x3 convolution to extract features.

[0024] Further, the specific way of fusing DWR into the C2f module of the neck of YOLOv8 is:

[0025] First step, regional residualization, which is realized by traditional 3x3 convolution combined with BN layer and ReLU layer, for generating a series of concise feature maps and outputting to morphological filtering;

[0026] Second step, semantic residualization, which uses multi-rate dilated depth convolution to perform morphological filtering on features of different size regions. In the multi-rate dilated depth convolution, different dilation rates are used to construct convolution kernels of multiple scales, and each scale of convolution kernel is used to capture the context information of the corresponding range;

[0027] Thirdly, after capturing the context information of different ranges of multiple scales, the multiple outputs are aggregated, all feature maps are connected and then batch normalized, and the features are merged using point-wise convolution to form the final residual;

[0028] Fourthly, the final residual is added to the input feature map.

[0029] An insulator defect detection method is implemented by using an insulator defect detection model obtained by the construction method of the insulator defect detection model based on CDC-YOLOv8.

[0030] Further, the insulator image is obtained by being photographed by a UAV, and the resolution of the insulator image is at least 640*640*3px.

[0031] An insulator defect detection device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are in communication with each other through the communication bus; the memory is used for storing a computer program; and the processor is used for executing the program stored in the memory to implement the construction method of the insulator defect detection model based on CDC-YOLOv8.

[0032] A computer readable storage medium has a computer program stored thereon, and the computer program is executed by a processor to implement the construction method of the insulator defect detection model based on CDC-YOLOv8.

[0033] The present application has the following advantages:

[0034] (1) The cross-stage local heterogeneous convolution module (CSPHet) is introduced into the backbone network (Backbone), which can improve the detection accuracy while reducing the model complexity, and realizes the dual improvement of model lightweight and detection accuracy.

[0035] (2) The convolution and attention mixed module (CAFM) is introduced into the output layer of the backbone network (Backbone), so that the two-branch structure effectively enhances the local and global feature extraction capability, suppresses the interference of background and noise and other factors, improves the attention of small targets, reduces the attention of the network to the background, and increases the attention to the defect area, solving the problem of complex image background.

[0036] (3) This invention integrates the dilated residual module (DWR) into the C2f module of the YOLOv8 neck, replacing the bottleneck component in the original network C2f. Through deep separation dilated convolution and two-step residual feature extraction method, the multi-scale feature extraction capability of the model is enhanced and the false negative rate of small targets is reduced.

[0037] This invention can be widely applied to the detection and identification of insulators in power systems, thereby improving the operational safety and stability of power systems. Attached Figure Description

[0038] Figure 1 This is a flowchart of a detection method based on the CDC-YOLOv8 insulator defect detection model provided by an embodiment of the present invention;

[0039] Figure 2 This is a network structure diagram of a method for constructing an insulator defect detection model based on CDC-YOLOv8 provided by an embodiment of the present invention;

[0040] Figure 3 This is a structural diagram of the cross-stage local heterogeneous convolutional module (CSPHet) module of a method for constructing an insulator defect detection model based on CDC-YOLOv8 provided by an embodiment of the present invention.

[0041] Figure 4 This is a structural diagram of the convolution and attention hybrid module (CAFM) of a method for constructing an insulator defect detection model based on CDC-YOLOv8 provided in an embodiment of the present invention.

[0042] Figure 5 This is a structural diagram of the C2f-DWR module in a method for constructing an insulator defect detection model based on CDC-YOLOv8 provided by an embodiment of the present invention.

[0043] Figure 6 This is a diagram of the defect detection results for power transmission lines obtained using a standard YOLOv8 model.

[0044] Figure 7 This is a transmission line defect detection result image obtained from an insulator defect detection model based on CDC-YOLOv8, provided by an embodiment of the present invention. The detection location is... Figure 6 same. Detailed Implementation

[0045] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0046] Embodiment one, in combination Figure 1 The present embodiment is described as follows:

[0047] A detection method of an insulator defect detection model based on CDC-YOLOv8,

[0048] (1) An insulator image is acquired, and the image is preprocessed;

[0049] (2) The image data is labeled to constitute an insulator defect image dataset, and the dataset is randomly divided into a training set and a test set according to a proportion;

[0050] (3) An insulator defect detection model based on CDC-YOLOv8 is established;

[0051] (4) The insulator defect detection model based on CDC-YOLOv8 is trained and tested based on the insulator defect image dataset to obtain a target insulator defect detection model, and performance evaluation is performed;

[0052] (5) The obtained target insulator defect detection model is used to detect insulator images to be detected in an actual scene to obtain an insulator defect detection result.

[0053] Embodiment two, in combination Figure 2 The present embodiment is described as follows:

[0054] A construction method of an insulator defect detection model based on CDC-YOLOv8, the insulator defect detection model based on CDC-YOLOv8 comprising: an input module, a backbone network, a neck, and a head;

[0055] The input module is configured to load an original image into the insulator defect detection model for preprocessing, the preprocessing being to adjust pixels of the original image to 640x640x3px, and then to pass the preprocessed image to the backbone network, the original image being an image of an insulator to be detected;

[0056] The backbone network is configured to extract feature information of the received image, and to generate a feature map from the feature information;

[0057] The neck is configured to fuse the up and down information flows of the network by combining FPN and PAN;

[0058] The head adopts a decoupling head structure, uses two parallel branches to extract category features and position features respectively, and then uses a layer of 1x1 convolution to complete the classification and positioning tasks, uses binary cross-entropy loss for the classification task, and uses distribution focal loss and complete intersection over union for the regression task of the bounding box boundary;

[0059] Further, the insulator defect detection model construction method comprises:

[0060] Step one: a lightweight CSPHet module is designed by HetConv to replace part of the C2f module of the YOLOv8 backbone network;

[0061] Step two: introduce a CAFM module at the output layer of the backbone network;

[0062] Step three: fuse DWR into the C2f module of the YOLOv8 neck, replace the bottleneck component in the YOLOv8 neck C2f, and complete the construction of the model.

[0063] Further, the method further comprises an optimization step of the detection model:

[0064] S1. Obtain a plurality of insulator images, and pre-process all the images;

[0065] The insulator image is obtained by using a high-resolution unmanned aerial vehicle to take a photo of the insulator scene, and the video taken by the aerial vehicle is framed into image data for image preprocessing.

[0066] The image preprocessing specifically comprises:

[0067] The original data set is cleaned to eliminate blurred and poor quality images, and clear images of transmission line defects under different angles and environments are selected;

[0068] The insulator image is data enhanced, and the data is enhanced by random rotation, proportional scaling, adding Gaussian noise Mosaic and mixed enhancement Mixup method, the number of samples is increased, the generalization ability of the model is improved, and the diversity of the data is improved.

[0069] The Mosaic method is: randomly select n pictures in the training set, n∈4×N, N is a positive integer, and take part of the picture as a training picture, the advantage of which is that it can improve the resolution of the image, and also can improve the quality of the image;

[0070] The Mixup method is: randomly select two images from two different batches of training sets, and generate a new image with λ as a parameter.

[0071] S2. Label all image data to form an insulator defect image dataset, and divide the dataset into a training set and a test set according to an 8:2 ratio;

[0072] The LabelImg image labeling software is used to label the obtained images, and a YOLO data label format is generated, wherein the label includes five types of insulator wire loosening, insulator damage, insulator contamination, insulator self-explosion and normal insulator, and labeled information with a marked box is obtained to form an insulator defect image dataset, and the dataset is divided into a training set and a test set according to an 8:2 ratio.

[0073] The image labeling specifically includes: importing the processed image into LabelImg, finding the area where the insulator is located in the image, and then labeling it to obtain the identification box of the area where the insulator is located; according to the insulator state, five types of insulator wire loosening, insulator damage, insulator contamination, insulator self-explosion and normal insulator are labeled to generate a YOLO data label format; the insulator defect dataset labeled by the present method includes 269 insulator contamination images, 725 insulator self-explosion images, 234 insulator wire loosening images, 404 insulator damage images, and a total of 1632 images, and 500 normal insulator images.

[0074] S3. Construct an insulator defect detection model based on CDC-YOLOv8;

[0075] The input module (Input) is responsible for loading the original image data into the model for preprocessing, adjusting the picture size to 640x640x3px, and processing the results through each layer of the network for calculation and learning;

[0076] The backbone network is mainly used to extract feature information of the image and generate feature maps of different scales. As shown in Figure 3 , a lightweight cross-stage local heterogeneous convolution module (CSPHet) is designed by using heterogeneous convolution (HetConv) to replace part of the C2f module, which can reduce the complexity of the model while improving the detection accuracy, and further reduce the parameter amount of the model while ensuring the accuracy rate is improved or unchanged. As shown in Figure 4 , in order to make the detection model pay more attention to the key information in the input features and less attention to the background information, a convolution and attention mixed module (CAFM) is introduced at the output layer of the backbone, and the two-branch structure enhances the local and global feature extraction capability, reduces the attention to the background, and increases the attention to the defect area;

[0077] Neck: By combining feature pyramid network (FPN) and path aggregation network (PAN), responsible for feature fusion and information transmission between different levels of feature maps, realizing the fusion of upper and lower information flow of the network. As shown in Figure 5 To solve the problem of insufficient feature fusion between different scales, the dilated residual module (DWR) is integrated into the C2f module, replacing the bottleneck component in the original network C2f. This module can reduce the difficulty of multi-scale context information extraction, better fuse the multi-scale features of the target and background information through deep separation dilated convolution and two-step residual feature extraction method, and reduce the small target miss detection rate.

[0078] Head: The decoupled head structure is adopted, and two parallel branches are used to extract class features and position features respectively, and then a 1x1 convolution layer is used to complete the classification and positioning tasks, avoiding the interference caused by the network when processing different tasks. The loss function mainly includes positive and negative sample allocation strategy and Loss calculation, Loss calculation includes classification and regression two branches, using binary cross entropy loss for classification task, using distribution focal loss (DFL) and complete intersection over union (CIoU) for regression task of prediction box boundary, using anchor-free instead of traditional anchor-base method, reducing the number of anchor, thereby further improving the performance of the model.

[0079] S4. The insulator defect detection model is trained and tested using the insulator defect image dataset to obtain a target insulator defect detection model, and the performance is evaluated. When the evaluation result meets the requirements, the weight is saved for insulator defect detection; otherwise, the network parameters are adjusted for further training.

[0080] The performance evaluation of the test set input trained model includes:

[0081] The detection accuracy measurement indicators mainly include accuracy (Precision), recall (Recall), average precision (AP(Average Precision)), and mean average precision (mAP(mean Average Precision)). The specific expressions are as follows:

[0082]

[0083]

[0084] Wherein, TP represents the number of predicted positive samples, FP represents the number of false positive samples, FN represents the number of false negative samples, AP is the average precision value of a single category, that is, the area of the P-R curve and the coordinate axis, and mAP is the average value of the precision of all detection categories;

[0085] The measurement indicators of the detection speed mainly include forward pass time (FPT), frames per second (FPS), and floating point operations per second (FLOPS).

[0086] The values of the detection accuracy and the detection speed are set, if the value of the detection accuracy or the detection speed is less than the set value, the network parameters are adjusted for continuous training, and if the value of the detection accuracy or the detection speed is greater than the set value, the weight is saved for insulator defect detection.

[0087] In the embodiment, the initial learning rate is set to 0.01, the momentum is set to 0.937, the weight decay coefficient is set to 0.0005, the batch size is set to 32, the total training rounds are set to 300, the SGD optimizer is used, the input image size is converted to 640x640, the Mosaic enhancement is turned off in the last 10 rounds, and the early stop is set to 50. The operating system used is Windows 10, the GPU is NVIDIA GeForce RTX 4090 (24G), the deep learning framework is Pytorch 2.3.0, and the programming language is Python 3.9.18.

[0088] Embodiment three, in combination Figure 3 The embodiment is described:

[0089] Further, the specific way of using HetConv to design a lightweight CSPHet module to replace part of the C2f module of the YOLOv8 backbone network is: first, performing convolution operation on the feature map, and then performing Split operation to divide the shallow feature map into two parts in the channel dimension; one part is propagated backward through n HetConvs for feature extraction, and the other part is directly concatenated with the output of the feature extraction module through the cross-stage hierarchical structure.

[0090] As shown in Figure 3 The cross-stage local network (CSPNet) is used to design a cross-stage local heterogeneous convolution module (CSPHet):

[0091] First, the feature map is convolved, and then the shallow feature map is divided into two parts in the channel dimension through the Split operation;

[0092] Secondly, a part of feature extraction via n heterogeneous kernel convolution (HetConv) is back-propagated;

[0093] Finally, another part is merged (Concat) with the output of the feature extraction module directly through a cross-stage hierarchy to achieve more abundant gradient combination, reduce the complexity of the network while maintaining the accuracy.

[0094] Among them, the kernel of HetConv is usually composed of 3x3 grouped convolution and 1x1 pointwise convolution, and the kernel of standard convolution is usually composed of 3x3 convolution. Heterogeneous kernel convolution (HetConv) introduces a parameter P to control the number of different types of kernels in the convolution filter. 1 / P part of the total kernel will be used for KxK kernel, and the remaining (1-1 / P) will be used for 1x1 kernel;

[0095] In the standard convolution layer, it is assumed that the size of the input is D i ×D i ×M. D i is the spatial width and height of the input feature map, and M is the input depth (the number of input channels). The size of the output feature map is D o ×D o ×N. D o is the spatial width and height of the output feature map, and N is the output depth (the number of output channels). The output feature map is obtained by N filters with a size of KxKxM, where K is the kernel size. Therefore, the total computation at layer L is:

[0096] FL S =D o ×D o ×M×N×K×K

[0097] The computation of KxK size kernel in HetConv filter with part P on layer L is:

[0098] FL K =(D o ×D o ×M×N×K×K) / P

[0099] The computation is reduced by P times, only M / P kernels with size KxK, instead of M kernels with size KxK;

[0100] The remaining (M-M / P) kernels have a size of 1x1. The computation of the remaining 1x1 kernel is:

[0101]

[0102] Therefore, the total computation at layer L is:

[0103] FLHC =FL K +FL1

[0104] Compared to standard convolution, the computational cost is reduced:

[0105]

[0106] In summary, heterogeneous convolutional filters ensure that the filters cover the spatial correlation on certain channels by keeping the isomorphic convolutional filters of some channels as 3×3, while reducing the isomorphic convolutional filters of other channels to 1×1 to reduce the spatial range. Compared with other convolution methods, there is no delay, and the floating-point operation (FLOPS) can be reduced while maintaining accuracy.

[0107] Implementation method four, combined with Figure 4 Description of this implementation method:

[0108] Furthermore, the specific method of introducing the CAFM module into the output layer of the backbone network is as follows: in the local branch, 1×1 convolution is first used to adjust the channel dimension, and then channel shuffling operation is used to further mix and fuse channel information. The channel shuffling divides the input tensor into multiple groups along the channel dimension, and depthwise separable convolution is used in each group to cause channel shuffling. Then, the output tensors obtained from each group are connected along the channel dimension to generate a new output tensor. Finally, 3×3×3 convolution is used to extract features.

[0109] like Figure 4 The diagram shows the architecture of the Convolutional and Attention Hybrid Module (CAFM), which specifically includes:

[0110] Local branches employ convolution and channel shuffling for local feature extraction, as detailed below:

[0111] First, use a 1×1 convolution to adjust the channel dimensions;

[0112] Following this, channel shuffling is used to further mix and fuse channel information. Channel shuffling divides the input tensor into groups along the channel dimension, and within each group, depthwise separable convolution is used to induce channel shuffling.

[0113] Subsequently, the output tensors obtained from each group are concatenated along the channel dimension to generate a new output tensor;

[0114] Finally, 3×3×3 convolutions are used to extract features, and the formula for the local branch is:

[0115] F conv =W 3×3×3 (CS(W 1×1 (Y)))

[0116] Among them, F convIt is the output of a local branch, W 1×1 W represents a 1×1 convolution. 3×3×3 This represents a 3×3×3 convolution, CS represents channel shuffling operation, and Y is the input feature;

[0117] In the global branch, the attention mechanism is used to model long-range feature dependencies. The specific process is as follows:

[0118] First, a query Q, a key K, and a value V are generated using 1×1 convolution and 3×3 depthwise convolution, resulting in three shapes. tensor;

[0119] Secondly, Q is K is

[0120] Finally, through and The interaction is used to calculate the attention feature map. With the computational size is The conventional attention feature map reduces computational cost, and the output F of the global branch is... att Defined as:

[0121]

[0122] Here, α is a learnable scaling parameter used to control the softmax function. and The magnitude of matrix multiplication;

[0123] The output of the Convolution and Attention Hybrid Module (CAFM) is computed as follows:

[0124] F out =F att +F conv

[0125] Implementation method five, combined with Figure 5 Description of this implementation method:

[0126] Furthermore, the specific method for integrating DWR into the C2f module of the YOLOv8 neck is as follows:

[0127] The first step is region residualization, which is achieved by combining traditional 3x3 convolution with BN and ReLU layers to generate a series of concise feature maps and output them to morphological filtering.

[0128] This is achieved by combining traditional 3x3 convolutions with batch normalization (BN) layers and rectified linear unit (ReLU) layers to generate a series of concise feature maps of different sizes, which will be used as input for the second step of morphological filtering.

[0129] Second step, semantic residualization, morphological filtering of features of different size regions is performed using multi-rate dilated deep convolution, in the multi-rate dilated deep convolution, different dilation rates are used to construct convolution kernels of multiple scales, and each scale of the convolution kernel is used to capture context information of a corresponding range;

[0130] Morphological filtering of features of different size regions is performed using multi-rate dilated deep convolution. In the multi-rate dilated deep convolution, different dilation rates are used to construct convolution kernels of multiple scales, and each scale of the convolution kernel can capture context information of a different range. By extracting features at different scales, the network can better process input data of different scales and obtain more rich feature representations. Only one desired receptive field is applied to each channel feature to prevent possible redundancy;

[0131] Third step, after capturing context information of different ranges at multiple scales, multiple outputs are aggregated, all feature maps are connected and then batch normalized, and features are merged using point-wise convolution to form a final residual;

[0132] Fourth step, the final residual is added to the input feature map to construct a stronger and more comprehensive feature representation.

[0133] Fusing DWR into C2f to construct C2f-DWR, enhancing the generalization ability of the network when processing targets of different scales, making it more adaptable to environmental changes, which is crucial for stability and reliability in practical applications.

[0134] Embodiment six, in combination with Figure 6 and Figure 7 This embodiment is described:

[0135] As shown in Figure 6 and Figure 7 , by comparing the power line defect detection results obtained by detecting the same image using the YOLOv8 model and the detection model in the embodiment of the present application, it can be seen that:

[0136] Figure 6 In the first image in the above, the YOLOv8 model missed an insulator contamination defect;

[0137] Figure 6 In the second image in the above, the YOLOv8 model mistakenly recognized a normal insulator as an insulator contamination;

[0138] Figure 6 In the third image in the above, the YOLOv8 model mistakenly recognized a normal insulator as an insulator damage defect.

[0139] By comparing the above images, the detection model in the embodiment of the present application effectively reduces false positives and misses.

[0140] Therefore, the application can effectively improve the detection precision of small targets under the premise of ensuring the calculation efficiency, and can overcome the interference and shielding of complex background, and realize fast and accurate transmission line defect detection.

[0141] For the embodiments of the present specification, the "computer readable medium" can be any device that can contain, store, communicate, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device. More specific examples (non-exhaustive list) of computer readable medium include the following: electrical connections having one or N wires (electronic devices), portable computer diskette (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CD ROM). In addition, the computer readable medium can even be paper or other suitable medium on which the program can be printed, as the program can be electronically obtained, for example, by optical scanning of the paper or other medium, followed by editing, interpreting or otherwise processing, if necessary, in other suitable manner, to be electronically obtained and then stored in the computer memory. It should be understood that parts of the present application can be implemented in hardware, software, firmware or a combination thereof. In the above embodiments, the N steps or methods can be implemented by software or firmware stored in the memory and executed by a suitable instruction execution system. As in another embodiment, if implemented in hardware, any of the following technologies known in the art or their combinations can be used: discrete logic circuit with logic gate circuit for implementing logical functions on data signals, application specific integrated circuit with suitable combination logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA), etc.

Claims

1. A method for constructing an insulator defect detection model based on CDC-YOLOv8, characterized in that, The insulator defect detection model based on CDC-YOLOv8 includes: an input module, a backbone network, a neck, and a head; The input module is used to load the original image into the insulator defect detection model for preprocessing. The preprocessing involves adjusting the pixels of the original image to 640×640×3px and then transmitting the preprocessed image to the backbone network. The original image is the image of the insulator to be detected. The backbone network is used to extract feature information from the received image and generate a feature map from the feature information; The neck section integrates the upstream and downstream information flows of the network by combining FPN and PAN; The head adopts a decoupled head structure, using two parallel branches to extract category features and location features respectively. Then, each branch uses a 1×1 convolution layer to complete the classification and localization tasks. Binary cross-entropy loss is used for classification, and distributed focus loss and perfect intersection-union ratio are used for regression of the predicted bounding box boundaries. The method for constructing the insulator defect detection model includes: Step 1: Design a lightweight CSPHet module using HetConv to replace some of the C2f modules in the YOLOv8 backbone network; The replacement method is as follows: First, the feature map is convolved, and then the shallow feature map is divided into two parts in the channel dimension by a split operation; one part is extracted and propagated backward through n HetConvs, and the other part is directly concatted with the output of the feature extraction module through a cross-stage hierarchical structure. Step 2: Introduce a CAFM module at the output layer of the backbone network; Step 3: Integrate DWR into the C2f module of the YOLOv8 neck, replacing the bottleneck component in the YOLOv8 neck C2f module, and complete the model construction.

2. The construction method according to claim 1, characterized in that, The method also includes an optimization step for the detection model: S1. Acquire multiple insulator images and preprocess all images to obtain image data; the insulator images are images of insulators with known defects; S2. Label all image data to form an insulator defect image dataset, and divide the dataset into a training set and a test set in an 8:2 ratio; S3. Construct an insulator defect detection model based on CDC-YOLOv8; S4. Train and test the insulator defect detection model using the training set and test set to obtain the target insulator defect detection model. Perform performance evaluation. If the evaluation results meet the requirements, save the weights, and the optimization of the insulator defect detection model is completed; otherwise, adjust the network parameters and continue training.

3. The construction method according to claim 1, characterized in that, In step S2, all image data are labeled according to the defects of the insulators. The labeling information includes: loose insulator wires, broken insulators, dirty insulators, spontaneously exploded insulators, and normal insulators.

4. The construction method according to claim 1, characterized in that, The specific way to introduce the CAFM module into the output layer of the backbone network is as follows: First, 1×1 convolution is used in the local branch to adjust the channel dimension, and then channel shuffling is used to further mix and fuse channel information. The channel shuffling divides the input tensor into multiple groups along the channel dimension. In each group, depthwise separable convolution is used to cause channel shuffling. Then, the output tensors obtained from each group are connected along the channel dimension to generate a new output tensor. Finally, 3×3×3 convolution is used to extract features.

5. The construction method according to claim 1, characterized in that, The specific method for integrating DWR into the C2f module of the YOLOv8 neck is as follows: The first step is region residualization, which is achieved by combining traditional 3x3 convolution with BN and ReLU layers to generate a series of concise feature maps and output them to morphological filtering. The second step is semantic residualization, which uses multi-rate dilated depthwise convolution to perform morphological filtering on features of different sized regions. In multi-rate dilated depthwise convolution, different dilation rates are used to construct convolution kernels of multiple scales, and each scale convolution kernel is used to capture contextual information of the corresponding range. The third step involves capturing contextual information at different scales and ranges, aggregating multiple outputs, concatenating all feature maps and then batch normalizing them, and using pointwise convolution to merge features to form the final residual. The fourth step is to add the final residual to the input feature map.

6. A method for detecting defects in insulators, characterized in that, The detection method is implemented using an insulator defect detection model obtained by the construction method of an insulator defect detection model based on CDC-YOLOv8 as described in any one of claims 1-5. The detection method is as follows: acquire an image of the insulator to be detected, input it into the insulator defect detection model, and obtain the detection result.

7. The insulator defect detection method according to claim 6, characterized in that, The insulator image was obtained by taking pictures with a drone, and the resolution of the insulator image is at least 640×640×3px.

8. An insulator defect detection device, characterized in that, The device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor, when executing the program stored in the memory, implements the method for constructing an insulator defect detection model based on CDC-YOLOv8 as described in any one of claims 1-5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements a method for constructing an insulator defect detection model based on CDC-YOLOv8 as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Insulator defect detection method and system, electronic equipment and readable storage medium

    CN113298789A

  • Road defect target detection method and system based on SCDD-YOLO network

    CN118115444A

  • PCB small target defect detection method based on improved YOLOv8s

    CN118587188A

  • Insulator defect detection method based on improved YOLOv8

    CN118839245A