Construction method and detection method of insulator defect detection model based on CDC-YOLOv8, equipment and storage medium
By using the CDC-YOLOv8 model in insulator defect detection, combined with CSPHet, CAFM and DWR technologies, the problems of high model complexity and poor detection of small targets in the existing detection methods are solved, and efficient and accurate insulator defect detection are achieved.
Patent Information
- Application Number
- CN202411733061.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The existing insulator defect detection methods have the shortcomings of high model complexity, high calculation cost, and the need to improve the detection effect of small targets. In complex backgrounds and diversified environments, the generalization ability and noise suppression effects are limited.
Using the insulator defect detection model based on CDC-YOLOv8, the cross-stage local heterogeneous convolution module (CSPHet) and the convolution and attention mixing module (CAFM) are introduced, combined with the DWR structure, the model complexity is reduced and the detection accuracy is improved, and the processing capability of small targets and complex backgrounds is enhanced.
The dual improvement of model lightweighting and detection accuracy is achieved, which significantly reduces the detection rate of small targets, improves the generalization ability of the model and the suppression effect of noise, and improves the accuracy and stability of detection.
Smart Images

Figure CN119741584A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of insulator defect detection, and in particular to the field of construction of an insulator defect detection model based on CDC-YOLOv8 and a detection method, device and storage medium. Background Art
[0002] As a key component of the transmission line, insulators are mainly responsible for mechanical fixation, connection of wires and cables, and electrical insulation of the transmission line. Insulators are exposed to complex natural environments for a long time, and are susceptible to self-explosion and falling off due to rain erosion, dirt, climate change, lightning and other factors, posing a major threat to the safe operation of the transmission line. In severe cases, it will cause large-scale power outages in the region, affecting the normal life of enterprises and urban and rural residents. Therefore, accurately detecting the defects of insulators is an important measure to ensure the normal operation of the transmission system. UAV inspections are gradually replacing manual inspections and helicopter inspections with their advantages of low cost, good flexibility, and high efficiency. In the UAV inspection mission, the images captured usually include complex backgrounds composed of poles, mountains, rivers, and grasslands. The number of collected pictures is large and the sizes of insulators vary greatly. They are easily affected by complex environmental factors such as light and weather, resulting in the insulator target information not being prominent, which in turn affects the accuracy of insulator defect detection.
[0003] In the prior art, the detection of insulator defects mostly relies on manual inspections 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 accuracy and efficiency of insulator defect detection in drone aerial images in power grid scenarios are improved. However, this method has the shortcomings of high model complexity, high computational cost, and the need to further improve the detection effect of small targets. In addition, in complex backgrounds and diverse environments, the generalization ability and noise suppression effect of the model also have certain limitations.
[0004] In view of the shortcomings of the above-mentioned prior art, an insulator defect detection model construction and detection method, device and storage medium 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). While ensuring the detection accuracy, the complexity and memory consumption of the model are greatly reduced. At the same time, the adopted C2f-DWR structure can better integrate multi-scale features, especially in the detection of small targets, and significantly reduces the missed detection rate. The method also improves the generalization ability of the model through data enhancement technology, and enhances the suppression effect of complex background and noise, further improving the detection accuracy and stability. Summary of the invention
[0005] The present invention proposes a construction and detection method, device and storage medium of an insulator defect detection model based on CDC-YOLOv8, so as to solve the shortcomings of the existing insulator defect detection, such as high model complexity, high calculation cost and the need to further improve the detection effect of small targets.
[0006] To achieve the above objectives, the technical solutions adopted by the present invention are as follows:
[0007] A method for constructing an insulator defect detection model based on CDC-YOLOv8, wherein the insulator defect detection model based on CDC-YOLOv8 comprises: an input module, a backbone network, a neck, and a head;
[0008] The input module is used to load the original image into the insulator defect detection model for preprocessing, wherein the preprocessing is to adjust the pixels of the original image to 640×640×3px, and then transfer the preprocessed image to the backbone network, wherein the original image is an image of the 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 category features and position features respectively, and then uses a layer of 1×1 convolution to complete the classification and positioning tasks, uses binary cross entropy loss for classification tasks, and uses distribution focus loss and complete intersection-over-union ratio for regression tasks of predicting box boundaries;
[0012] Furthermore, the insulator defect detection model construction method includes:
[0013] Step 1: Use HetConv to design a lightweight CSPHet module to replace some C2f modules of the YOLOv8 backbone network;
[0014] Step 2: Introduce a CAFM module into the output layer of the backbone network;
[0015] Step 3: Integrate DWR into the C2f module of the YOLOv8 neck, replace the bottleneck component in the YOLOv8 neck C2f, and complete the model construction.
[0016] Furthermore, the method also includes the step of optimizing the detection model:
[0017] S1. Acquire multiple insulator images and preprocess all the images;
[0018] S2. Annotate 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. Build an insulator defect detection model based on CDC-YOLOv8;
[0020] S4. Use the training set and the test set to train and test the insulator defect detection model to obtain the target insulator defect detection model, and perform performance evaluation. When the evaluation result meets the requirements, the weight is saved and the insulator defect detection model optimization is completed; otherwise, the network parameters are adjusted to continue training.
[0021] Furthermore, in step S2, all image data are annotated according to the defects of the insulators, and the annotated information includes but is not limited to: loose insulator wires, damaged insulators, contaminated insulators, self-explosion of insulators, and normal insulators.
[0022] Furthermore, the specific method of using HetConv to design a lightweight CSPHet module to replace part of the C2f modules of the YOLOv8 backbone network is: first perform a convolution operation on the feature map, and then divide the shallow feature map into two parts in the channel dimension through a Split operation; one part is back-propagated through n HetConvs for feature extraction, and the other part is directly Concat-operated with the output of the feature extraction module through a cross-stage hierarchical structure.
[0023] Furthermore, the specific method of introducing the CAFM module in the output layer of the backbone network is: first use 1×1 convolution in the local branch to adjust the channel dimension, and then use channel shuffling operation to further mix and fuse channel information. The channel shuffling divides the input tensor into multiple groups along the channel dimension, and uses depthwise separable convolution in each group to cause channel shuffling. Then, the obtained output tensors of each group are connected along the channel dimension to generate a new output tensor. Finally, 3×3×3 convolution is used to extract features.
[0024] Furthermore, the specific method of integrating DWR into the C2f module of the YOLOv8 neck is:
[0025] The first step is regional residualization, which is achieved through traditional 3x3 convolution combined with BN layer and ReLU layer to generate a series of concise feature maps and output them to morphological filtering;
[0026] The second step is semantic residualization, which uses multi-rate dilated deep convolution to perform morphological filtering on the features of regions of different sizes. In the multi-rate deep dilated convolution, different dilation rates are used to construct convolution kernels of multiple scales. The convolution kernel of each scale is used to capture the context information of the corresponding range.
[0027] In the third step, after capturing contextual information of different ranges at multiple scales, multiple outputs are aggregated. All feature maps are concatenated and then batch normalized, and point-wise convolution is used to merge features to form the final residual.
[0028] The fourth step is to add the final residual to the input feature map.
[0029] An insulator defect detection method is implemented using an insulator defect detection model obtained by a method for constructing an insulator defect detection model based on CDC-YOLOv8 described in the present application. The detection method comprises the following steps: collecting an insulator image to be detected, inputting the image into the insulator defect detection model, and obtaining a detection result.
[0030] Furthermore, the insulator image is obtained by photographing with a drone, and the resolution of the insulator image is at least 640×640×3px.
[0031] An insulator defect detection device, the device comprising 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; the processor is used to implement a method for constructing an insulator defect detection model based on CDC-YOLOv8 described in the present application when executing the program stored in the memory.
[0032] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements a method for constructing an insulator defect detection model based on CDC-YOLOv8 as described in the present application.
[0033] The beneficial effects of the present invention are:
[0034] (1) The present invention introduces a cross-stage local heterogeneous convolutional module (CSPHet) into the backbone network, which can improve detection accuracy while reducing model complexity, thereby achieving a dual improvement in model lightweighting and detection accuracy.
[0035] (2) The present invention introduces a convolution and attention hybrid module (CAFM) into the output layer of the backbone network, so that the two-branch structure effectively enhances the local and global feature extraction capabilities, suppresses the interference of factors such as background and noise, improves the attention of small targets, reduces the network's attention to the background, and increases the attention to defective areas, solving the problem of complex image background.
[0036] (3) The present invention integrates the dilated residual module (DWR) into the C2f module of the YOLOv8 neck (Neck), replacing the bottleneck component in the original network C2f. Through the deep separation of dilated convolution and two-step residual feature extraction method, the multi-scale feature extraction capability of the model is enhanced, and the small target missed detection rate is reduced.
[0037] The present invention can be widely used in the detection and identification of insulators in power systems, thereby improving the operational safety and stability of power systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flow chart of a detection method of an insulator defect detection model based on CDC-YOLOv8 provided in an embodiment of the present invention;
[0039] Figure 2 It is a network structure diagram of a method for constructing an insulator defect detection model based on CDC-YOLOv8 provided in an embodiment of the present invention;
[0040] Figure 3 It is a structural diagram of a cross-stage local heterogeneous convolution module (CSPHet) module of a method for constructing an insulator defect detection model based on CDC-YOLOv8 provided in an embodiment of the present invention;
[0041] Figure 4 It is a structural diagram of a convolution and attention hybrid module (CAFM) module 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 It is a structural diagram of a C2f-DWR module of a method for constructing an insulator defect detection model based on CDC-YOLOv8 provided in an embodiment of the present invention;
[0043] Figure 6 This is the result of power line defect detection obtained by the conventional YOLOv8 model;
[0044] Figure 7 This is a transmission line defect detection result diagram obtained by an insulator defect detection model based on CDC-YOLOv8 provided in an embodiment of the present invention, and the detection location and Figure 6 same. DETAILED DESCRIPTION
[0045] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] Implementation method 1: Combination Figure 1 This embodiment is described:
[0047] A detection method for insulator defect detection model based on CDC-YOLOv8,
[0048] (1) Obtaining an insulator image and preprocessing the image;
[0049] (2) Annotate the image data to form an insulator defect image dataset, and randomly divide the dataset into a training set and a test set according to the ratio;
[0050] (3) Establish an insulator defect detection model based on CDC-YOLOv8;
[0051] (4) The insulator defect detection model of CDC-YOLOv8 was trained and tested based on the insulator defect image dataset to obtain the target insulator defect detection model and perform performance evaluation;
[0052] (5) The obtained target insulator defect detection model is used to detect the insulator image to be defect-detected in the actual scene to obtain the insulator defect detection result.
[0053] Implementation method 2: combining Figure 2 This embodiment is described:
[0054] A method for constructing an insulator defect detection model based on CDC-YOLOv8, wherein the insulator defect detection model based on CDC-YOLOv8 comprises: an input module, a backbone network, a neck, and a head;
[0055] The input module is used to load the original image into the insulator defect detection model for preprocessing, wherein the preprocessing is to adjust the pixels of the original image to 640×640×3px, and then transfer the preprocessed image to the backbone network, wherein the original image is an image of the insulator to be detected;
[0056] The backbone network is used to extract feature information of the received image and generate a feature map from the feature information;
[0057] The neck fuses the upper and lower information flows of the network by combining FPN and PAN;
[0058] The head adopts a decoupled head structure, uses two parallel branches to extract category features and position features respectively, and then uses a layer of 1×1 convolution to complete the classification and positioning tasks, uses binary cross entropy loss for classification tasks, and uses distribution focus loss and complete intersection-over-union ratio for regression tasks of predicting box boundaries;
[0059] Furthermore, the insulator defect detection model construction method includes:
[0060] Step 1: Use HetConv to design a lightweight CSPHet module to replace some C2f modules of the YOLOv8 backbone network;
[0061] Step 2: Introduce a CAFM module into the output layer of the backbone network;
[0062] Step 3: Integrate DWR into the C2f module of the YOLOv8 neck, replace the bottleneck component in the YOLOv8 neck C2f, and complete the model construction.
[0063] Furthermore, the method also includes the step of optimizing the detection model:
[0064] S1. Acquire multiple insulator images and preprocess all the images;
[0065] The insulator image is acquired by using a high-resolution UAV to take aerial photos of the insulator scene, and the aerial video is extracted into image data for image preprocessing.
[0066] Image preprocessing specifically includes:
[0067] Clean the original data set, remove blurry and poor-quality images, and select clear images of transmission line defects at different angles and environments;
[0068] The insulator images are enhanced by random rotation, scaling, adding Gaussian noise Mosaic and Mixup methods to increase the number of samples, improve the generalization ability of the model and enhance the diversity of the data.
[0069] The Mosaic method is: randomly select n photos in the training set, n∈4×N, N is a positive integer, and take some of them to piece together into the training picture. Its advantage is that it can improve the resolution of the image and also improve the quality of the image;
[0070] The Mixup method is: randomly select two images from two different batches of training sets, and generate new images with λ as the parameter.
[0071] S2. Annotate 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 acquired images were annotated using LabelImg image annotation software to generate the YOLO data label format, in which the labels included five types: loose insulator wire, damaged insulator, contaminated insulator, self-explosion of insulator and normal insulator. The annotation information with marked boxes was obtained to form an insulator defect image dataset, which was divided into a training set and a test set in a ratio of 8:2.
[0073] Image annotation specifically includes: importing the processed image into LabelImg, finding the area where the insulator is located in the image, and then annotating it, thereby obtaining the identification frame of the insulator area; according to the insulator status, five types of loose insulator wire, damaged insulator, dirty insulator, self-explosion of insulator and normal insulator are used for annotation to generate the YOLO data label format; the insulator defect dataset annotated by this method includes 269 images of dirty insulator, 725 images of self-explosion of insulator, 234 images of loose insulator wire, 404 images of damaged insulator, a total of 1632 images, and 500 images of normal insulator.
[0074] S3. Build an insulator defect detection model based on CDC-YOLOv8;
[0075] Input module: responsible for loading the original image data into the model for preprocessing, resizing the image to 640×640×3px, and the processed results are calculated and learned through various layers of the network;
[0076] Backbone network: mainly used to extract feature information of images and generate feature maps of different scales. Figure 3 As shown in the figure, a lightweight cross-stage local heterogeneous convolution module (CSPHet) is designed using heterogeneous convolution (HetConv) to replace some C2f modules, which can improve the detection accuracy while reducing the complexity of the model, and further reduce the number of model parameters while ensuring that the accuracy is improved or unchanged. Figure 4 As shown in the figure, 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 hybrid module (CAFM) is introduced in the output layer of the backbone. The two-branch structure enhances the local and global feature extraction capabilities, reduces the attention to the background, and increases the attention to the defect area;
[0077] Neck: By combining the Feature Pyramid Network (FPN) and the Path Aggregation Network (PAN), it is responsible for feature fusion and information transmission between feature maps at different levels, thus realizing the fusion of the upper and lower information flows of the network. Figure 5 As shown in the figure, in order to solve the problem of insufficient feature fusion between different scales, the dilated residual module (DWR) is integrated into the C2f module to replace the bottleneck component in the original network C2f. This module can reduce the difficulty of extracting multi-scale context information. Through the deep separation of dilated convolution and two-step residual feature extraction method, the multi-scale features and background information of the target are better integrated, and the small target missed detection rate is reduced.
[0078] Head: It adopts a decoupled-head structure and uses two parallel branches to extract category features and position features respectively. Then, a 1×1 convolution layer is used to complete the classification and positioning tasks respectively to avoid interference caused by the network when processing different tasks. The loss function mainly includes the positive and negative sample allocation strategy and Loss calculation. The Loss calculation includes two branches: classification and regression. The binary cross entropy loss is used for classification tasks. The distribution focus loss (DFL) and the complete intersection-over-union (CIoU) are used for the regression task of predicting the box boundary. The anchor-free box (Anchor-Free) replaces the traditional anchor-base method to reduce the number of anchor boxes (Anchor), thereby further improving the performance of the model.
[0079] S4. Use the insulator defect image dataset to train and test the insulator defect detection model to obtain the target insulator defect detection model, and perform performance evaluation. When the evaluation result meets the requirements, save the weights for insulator defect detection; otherwise, adjust the network parameters to continue training.
[0080] The test set is input into the trained model for performance evaluation, including:
[0081] The measurement indicators of detection accuracy mainly include accuracy (Precision), recall rate (Recall), average precision (AP (Average Precision)), mean average precision (mAP (mean Average Precision)), the specific expressions are as follows:
[0082]
[0083]
[0084] Among them, TP represents the number of samples predicted as positive, FP represents the number of samples wrongly predicted as positive, FN represents the number of samples wrongly predicted as negative, AP is the average precision value of a single category, that is, the area surrounded by the PR curve and the coordinate axis, and mAP is the average precision of all detection categories;
[0085] The main indicators for measuring detection speed include forward pass time (FPT), frames per second (FPS), and floating point operations (FLOPS).
[0086] Set the detection accuracy and detection speed. If the detection accuracy or detection speed is less than the set value, adjust the network parameters to continue training; if the detection accuracy or detection speed is greater than the set value, save the weights for insulator defect detection.
[0087] In this implementation, the hyperparameters are set to an initial learning rate of 0.01, a momentum of 0.937, a weight decay coefficient of 0.0005, a batch size of 32, a total number of training rounds of 300, an SGD optimizer is used, the input image size is converted to 640×640, 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] Implementation method three: combining Figure 3 This embodiment is described:
[0089] Furthermore, the specific method of using HetConv to design a lightweight CSPHet module to replace part of the C2f modules of the YOLOv8 backbone network is: first perform a convolution operation on the feature map, and then divide the shallow feature map into two parts in the channel dimension through a Split operation; one part is back-propagated through n HetConvs for feature extraction, and the other part is directly Concat-operated with the output of the feature extraction module through a cross-stage hierarchical structure.
[0090] like Figure 3 As shown in the figure, the idea of cross-stage local heterogeneous convolution module (CSPHet) is designed using the cross-stage local network (CSPNet):
[0091] First, the feature map is convolved, and then the shallow feature map is split into two in the channel dimension through a split operation.
[0092] Secondly, a part of it is propagated backward through n heterogeneous kernel convolutions (HetConv) for feature extraction;
[0093] Finally, the other part is directly merged (Concat) with the output of the feature extraction module through a cross-stage hierarchy to achieve richer gradient combinations and reduce the complexity of the network while maintaining accuracy.
[0094] Among them, the kernel of HetConv is usually composed of 3×3 grouped convolution and 1×1 point-by-point convolution, and the kernel of standard convolution is usually composed of 3×3 convolution. Heterogeneous kernel convolution (HetConv) introduces the parameter P to control the number of different types of kernels in the convolution filter. 1 / P of the total kernel will be used for K×K kernels, and the rest (1-1 / P) will be used for 1×1 kernels;
[0095] In a standard convolutional layer, assuming the input size is D i ×D i ×M.D i is the input feature map spatial width and height, 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 of size K×K×M, where K is the kernel size. Therefore, the total amount of computation at layer L is:
[0096] FL S =D o ×D o ×M×N×K×K
[0097] The computational cost of a K×K kernel in a 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 a factor of P, with only M / P kernels of size K×K instead of M kernels of size K×K.
[0100] The size of the remaining (MM / P) kernel is 1×1. The computational effort of the remaining 1×1 kernel is:
[0101]
[0102] Therefore, the total computation at layer L is:
[0103] FLHC =FL K +FL1
[0104] Compared with standard convolution, the amount of calculation is reduced:
[0105]
[0106] In summary, the heterogeneous convolution filter ensures that the filter covers the spatial correlation on certain channels by retaining the homogeneous convolution filters of some channels as 3×3, and reducing the homogeneous convolution filters of other channels to 1×1, reducing the spatial range. Compared with other convolution methods, there is no delay, which can reduce the floating-point operations (FLOPS) while ensuring accuracy.
[0107] Implementation method 4: Combination Figure 4 This embodiment is described:
[0108] Furthermore, the specific method of introducing the CAFM module in the output layer of the backbone network is: first use 1×1 convolution in the local branch to adjust the channel dimension, and then use channel shuffling operation to further mix and fuse channel information. The channel shuffling divides the input tensor into multiple groups along the channel dimension, and uses depthwise separable convolution in each group to cause channel shuffling. Then, the obtained output tensors of 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 As shown in the figure, the structure of the convolution and attention hybrid module (CAFM) includes:
[0110] The local branch uses convolution and channel shuffling to extract local features. The specific process is as follows:
[0111] First, use 1×1 convolution to adjust the channel dimension;
[0112] After that, a channel shuffle operation is performed to further mix and fuse channel information. Channel shuffle divides the input tensor into groups along the channel dimension, and uses depth-wise separable convolution within each group to cause channel shuffle;
[0113] Subsequently, the resulting output tensors from each group are concatenated along the channel dimension to generate a new output tensor;
[0114] Finally, a 3×3×3 convolution is 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 convis the output of the local branch, W 1×1 represents 1×1 convolution, W 3×3×3 represents 3×3×3 convolution, CS represents channel shuffle operation, and Y is the input feature;
[0117] The attention mechanism in the global branch is used to model long-range feature dependencies. The specific process is as follows:
[0118] First, query Q, key K, and value V are generated through 1×1 convolution and 3×3 depth convolution, and three shapes are obtained. Tensor of ;
[0119] Secondly, Q is K is
[0120] Finally, through and The interaction of With the calculated size The conventional attention feature map reduces the amount of calculation, and the output F of the global branch att Defined as:
[0121]
[0122] Among them, α is a learnable scaling parameter used to control the softmax function before and The magnitude of the matrix multiplication of ;
[0123] The output of the Convolutional and Attention Hybrid Module (CAFM) calculation is calculated as:
[0124] F out =F att +F conv
[0125] Implementation method five: combining Figure 5 This embodiment is described:
[0126] Furthermore, the specific method of integrating DWR into the C2f module of the YOLOv8 neck is:
[0127] The first step is regional residualization, which is achieved through traditional 3x3 convolution combined with BN layer and ReLU layer to generate a series of concise feature maps and output them to morphological filtering;
[0128] This is achieved through traditional 3x3 convolution combined 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 morphological filtering;
[0129] The second step is semantic residualization, which uses multi-rate dilated deep convolution to perform morphological filtering on the features of regions of different sizes. In the multi-rate deep dilated convolution, different dilation rates are used to construct convolution kernels of multiple scales. The convolution kernel of each scale is used to capture the context information of the corresponding range.
[0130] Multi-rate dilated deep convolution is used to perform morphological filtering on features of regions of different sizes. In multi-rate deep dilated convolution, different dilation rates are used to construct convolution kernels of multiple scales, and each scale of convolution kernel can capture contextual information of different ranges. By extracting features at different scales, the network can better process input data of different scales and obtain richer feature representations. Only one desired receptive field is applied to each channel feature to prevent possible redundancy;
[0131] In the third step, after capturing contextual information of different ranges at multiple scales, multiple outputs are aggregated. All feature maps are concatenated and then batch normalized, and point-wise convolution is used to merge features to form the final residual.
[0132] In the fourth step, the final residual is added to the input feature map to build a stronger and more comprehensive feature representation.
[0133] By integrating DWR into C2f and constructing C2f-DWR, the generalization ability of the network is enhanced when dealing with targets of different scales, making it more adaptable to environmental changes, which is crucial for stability and reliability in practical applications.
[0134] Implementation method six: combining Figure 6 and Figure 7 This embodiment is described:
[0135] like Figure 6 and Figure 7 As shown in FIG. 1 , by comparing the transmission line defect detection results obtained by detecting the same image using the YOLOv8 model and the detection model in the embodiment of the present invention, it can be seen that:
[0136] Figure 6 In the first image, the YOLOv8 model missed an insulator contamination defect;
[0137] Figure 6 In the second picture, the YOLOv8 model mistook the normal insulator as a dirty insulator;
[0138] Figure 6 In the third picture, the YOLOv8 model mistook a normal insulator as an insulator damage defect.
[0139] Compared with the above figures, the detection model in the embodiment of the present invention effectively reduces false detection and missed detection.
[0140] This proves that the present invention can effectively improve the detection accuracy of small targets while ensuring computational efficiency, and can overcome the interference and occlusion of complex backgrounds to achieve fast and accurate transmission line defect detection.
[0141] For the purposes of the present specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use with an instruction execution system, device or equipment or in conjunction with these instruction execution systems, devices or equipment. More specific examples of computer-readable media (non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program may be printed, because the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting or processing in other suitable ways as necessary, and then stored in a computer memory. It should be understood that the various parts of the present invention may be implemented in hardware, software, firmware or a combination thereof. In the above embodiments, the N steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a 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, wherein the preprocessing is to adjust the pixels of the original image to 640×640×3px, and then transfer the preprocessed image to the backbone network, wherein the original image is an image of the insulator to be detected; The backbone network is used to extract feature information of the received image and generate a feature map from the feature information; The neck fuses the upper and lower information flows of the network by combining FPN and PAN; The head adopts a decoupled head structure, uses two parallel branches to extract category features and position features respectively, and then uses a layer of 1×1 convolution to complete the classification and positioning tasks, uses binary cross entropy loss for classification tasks, and uses distribution focus loss and complete intersection-over-union ratio for regression tasks of predicting box boundaries; The method for constructing the insulator defect detection model includes: Step 1: Use HetConv to design a lightweight CSPHet module to replace some C2f modules of the YOLOv8 backbone network; Step 2: Introduce a CAFM module into the output layer of the backbone network; Step 3: Integrate DWR into the C2f module of the YOLOv8 neck, replace the bottleneck component in the YOLOv8 neck C2f, and complete the model construction.
2. The construction method according to claim 1, characterized in that: The method also includes the step of optimizing the detection model: S1. Acquire multiple insulator images, and preprocess all images to obtain image data; the insulator image is an image of an insulator with a known defect; S2. Annotate 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; S3. Build an insulator defect detection model based on CDC-YOLOv8; S4. Use the training set and the test set to train and test the insulator defect detection model to obtain the target insulator defect detection model, and perform performance evaluation. When the evaluation result meets the requirements, the weight is saved and the insulator defect detection model optimization is completed; otherwise, the network parameters are adjusted to continue training.
3. The construction method according to claim 1, characterized in that: In step S2, all image data are annotated according to the defects of the insulators, and the annotated information includes but is not limited to: loose insulator wires, damaged insulators, dirty insulators, self-explosion of insulators and normal insulators.
4. The construction method according to claim 1, characterized in that: The specific method of using HetConv to design a lightweight CSPHet module to replace part of the C2f modules of the YOLOv8 backbone network is as follows: first, the feature map is convolved, and then the shallow feature map is divided into two parts in the channel dimension through a Split operation; one part is extracted and propagated backward through n HetConvs, and the other part is directly Concat-operated with the output of the feature extraction module through a cross-stage hierarchical structure.
5. The construction method according to claim 1, characterized in that: The specific method of introducing the CAFM module in the output layer of the backbone network is: first use 1×1 convolution in the local branch to adjust the channel dimension, and then use channel shuffling operation to further mix and fuse channel information. The channel shuffling divides the input tensor into multiple groups along the channel dimension, and uses depthwise separable convolution in each group to cause channel shuffling. Then, the obtained output tensors of each group are connected along the channel dimension to generate a new output tensor. Finally, 3×3×3 convolution is used to extract features.
6. The construction method according to claim 1, characterized in that: The specific method of integrating DWR into the C2f module of the YOLOv8 neck is: The first step is regional residualization, which is achieved through traditional 3x3 convolution combined with BN layer and ReLU layer 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 deep convolution to perform morphological filtering on the features of regions of different sizes. In the multi-rate deep dilated convolution, different dilation rates are used to construct convolution kernels of multiple scales. The convolution kernel of each scale is used to capture the context information of the corresponding range. In the third step, after capturing contextual information of different ranges at multiple scales, multiple outputs are aggregated. All feature maps are concatenated and then batch normalized, and point-wise convolution is used to merge features to form the final residual. The fourth step is to add the final residual to the input feature map.
7. An insulator defect detection method, characterized in that: The detection method is implemented by using an insulator defect detection model obtained by the method for constructing an insulator defect detection model based on CDC-YOLOv8 as described in any one of claims 1 to 6. The detection method is: collecting an insulator image to be detected, inputting it into the insulator defect detection model, and obtaining a detection result.
8. The insulator defect detection method according to claim 7, characterized in that: The insulator image is obtained by photographing with a drone, and the resolution of the insulator image is at least 640×640×3px.
9. 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; the processor is used to implement a method for constructing an insulator defect detection model based on CDC-YOLOv8 as described in any one of claims 1-6 when executing the program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for constructing an insulator defect detection model based on CDC-YOLOv8 as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Insulator defect detection method and system, electronic equipment and readable storage medium
CN113298789A
Cancer cell image detection and segmentation method based on Mask R-CNN algorithm
CN111489327A
Bearing fault diagnosis method based on improved lightweight deep convolutional neural network
CN115452376A
Insulator defect detection method based on improved YOLOv5
CN116994161A
Lightweight insulator defect detection method based on improved YOLOv7-tiny
CN117392102A
Cited By
Partial multi-scale attention lightweight asphalt road defect detection method and system
CN121053451A