Insulator defect type detection method and equipment based on YOLOv8
By introducing the DRR-YOLO model, DRR module, DWR module, LSKA attention mechanism and nner-MPDIoU loss function into the YOLOv8 model, the existing technology for insulator defect detection that relies on manual labor, low identification accuracy and complex background defects is solved. Detection problems, achieving high-precision and multi-category defect detection capabilities.
Patent Information
- Application Number
- CN202411168789.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2025-01-21
AI Technical Summary
The existing insulator defect detection technology relies on manual labor, has low recognition accuracy, and cannot effectively detect the defect types of insulators in complex backgrounds.
The insulator defect type detection method based on YOLOv8 is used to build a DRR-YOLO model and combine the DRR module and the DWR module to enhance the model's detection ability for targets of different scales, and improve the detection accuracy through the LSKA attention mechanism and nner-MPDIoU loss function.
The accuracy and practicality of insulator defect detection are improved, multiple types of insulator defects can be accurately detected under complex backgrounds, and the adaptability and generalization ability of the model are enhanced.
Smart Images

Figure CN119338742A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system transmission network, and in particular to a method and device for detecting insulator defect types based on YOLOv8. Background Art
[0002] With the continuous increase in electricity demand, transmission lines have spread all over the country. As an important component of insulators, they have good mechanical support and electrical insulation performance, and play the role of electrical insulation and wire connection. However, insulators are in strong electric field environments and harsh environments for a long time, and are easily affected by bad weather such as rain, snow and extreme temperatures, resulting in self-explosion, breakage, dirty flashover, bird nests and other faults. These faults may trigger a series of cascading faults, which pose a huge hidden danger and threat to the safe and stable operation of transmission lines. According to statistics, the most frequent failures in the power system are caused by insulator defects. Therefore, it is particularly important to quickly and accurately detect defective insulators and replace them in time for the safe operation of the entire transmission system.
[0003] At present, defect detection of insulators can be divided into manual observation, traditional image processing and deep learning-based methods. Among them, the manual observation method is time-consuming and labor-intensive, and there are certain safety hazards. The method based on traditional image processing requires manual setting of target features, and different features need to be set for different targets. The recognition accuracy is low, which is easy to cause false detection or missed detection. The method based on traditional image processing cannot automatically extract the features of insulators, so it can only accurately identify defective insulators in specific environments. However, insulators are usually in complex background environments such as rivers, farmlands, construction sites and forests. This method cannot accurately extract and identify insulators.
[0004] Therefore, there is an urgent need for an insulator defect type detection method with high recognition accuracy and the ability to detect insulator defect information from images. Summary of the invention
[0005] The purpose of the present invention is to overcome the problems of existing insulator detection technology in the prior art, such as reliance on manual labor, low recognition accuracy and relatively single defect type recognition, and to provide an insulator defect type detection method based on YOLOv8.
[0006] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:
[0007] A method for detecting insulator defect types based on YOLOv8, comprising the following steps:
[0008] a: Get the image to be detected;
[0009] b: Input the image to be detected into the pre-trained evaluation model and output the corresponding detection result;
[0010] The pre-training of the evaluation model includes the following steps:
[0011] Collecting sample images of insulators and annotating the sample images;
[0012] Expand sample images and automatically generate corresponding labels to build a data set;
[0013] Construct a DRR-YOLO model; wherein the DRR-YOLO model uses the YOLOv8 model as the backbone network, and replaces the C2f module of the YOLOv8 model with a pre-built DRR module;
[0014] The DRR-YOLO model is trained using the data set to obtain an evaluation model.
[0015] As a preferred solution of the present invention, the DRR module uses the C2f module as a framework, and adds the FDR module and the DWR module;
[0016] The FDR module is arranged at the input end of the C2f module, and includes a plurality of serial large convolution kernels and inserted zero values, so as to expand the receptive field;
[0017] The DWR module is arranged at the output end of the C2f module and is used to extract multi-scale context information.
[0018] As a preferred solution of the present invention, the FDR module also includes reducing the number of parameters and the amount of calculation of the model through re-parameterization technology.
[0019] As a preferred solution of the present invention, an LSKA attention mechanism is added to the tail SPPF module of the Backbone network in the C2f module of the DRR module. The LSKA attention mechanism adopts horizontally and vertically cascaded kernels to reduce memory usage and improve computing efficiency.
[0020] As a preferred solution of the present invention, the output expression of the LSKA attention mechanism is:
[0021]
[0022] A C =W 1×1 *Z C ,
[0023]
[0024] Among them, * and Represent convolution and Hadamard product respectively; This is a round down operation; Represents the output result of the first process; Z C Indicates the output result of the second process; and They represent the convolution kernels of size (2d-1)×1 and size 1×(2d-1) respectively; F C ∈R C*H*W is the feature map, C, H, and W are the number of channels, height, and width of the input feature map respectively; and Respectively represent the size and size The convolution kernel of C is the attention map; W 1×1 is a convolution kernel of size 1×1; is the output of the LKSA attention mechanism; k is the maximum receptive field; d is the expansion rate.
[0025] As a preferred solution of the present invention, the DRR-YOLO model adopts the nner-MPDIoU function as the loss function of the model, and its expression is:
[0026]
[0027] Among them, MPDIoU is the nner-MPDIoU loss function, A and B are the real box and the predicted box respectively, IoU is the IoU loss function, d1 and d2 represent the relative distances between a set of diagonals of the predicted bounding box and the actual bounding box respectively, w and h represent the width and height of the bounding box, and Respectively represent the coordinates of a set of diagonal corners of the predicted bounding box; and Represents the coordinates of a set of opposite corners of the actual bounding box.
[0028] As a preferred embodiment of the present invention, the data set includes a randomly divided training set, a validation set, and a test set; training the DRR-YOLO model using the data set includes the following steps:
[0029] Training the DRR-YOLO model using the training set, and outputting a preliminary evaluation model after the model converges;
[0030] Verifying the model generalization ability of the preliminary evaluation model through the verification set, and performing parameter adjustment and model selection to obtain an evaluation model;
[0031] The test set is input into the evaluation model for testing. If the accuracy meets the preset threshold, the evaluation model is output; otherwise, the evaluation model is retrained.
[0032] An insulator defect type detection device based on YOLOv8, comprising at least one processor and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the methods described above.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present invention proposes an insulator defect type detection method based on YOLOv8. Based on the ideas of DRB and DWR, the present invention proposes a new DRR module. After combining it with the C2f module of the YOLOv8 model, the detection effect of the model on targets of different scales is enhanced, and the accuracy of defect detection is effectively improved. At the same time, according to the designed network model, the test set is input into the evaluation model to output the insulator defect detection result, so that multiple types of defects of multiple insulators can be detected and identified simultaneously in the same picture through the model, which effectively improves the practicability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of a flow chart of a method for detecting insulator defect types based on YOLOv8 according to Embodiment 1 of the present invention;
[0036] Figure 2 This is a schematic diagram of the structure of a DRR module in a method for detecting insulator defect types based on YOLOv8 according to Embodiment 2 of the present invention;
[0037] Figure 3 A schematic diagram for comparing the FDR module and the DRB module in a method for detecting insulator defect types based on YOLOv8 according to Embodiment 2 of the present invention;
[0038] Figure 4 This is a flowchart of the Bottleneck module in the insulator defect type detection method based on YOLOv8 described in Example 2 of the present invention;
[0039] Figure 5 This is a structural schematic diagram of a DWR module in a method for detecting insulator defect types based on YOLOv8 according to Embodiment 2 of the present invention;
[0040] Figure 6 This is a structural schematic diagram of an LSPPF module in an insulator defect type detection method based on YOLOv8 according to Embodiment 2 of the present invention;
[0041] Figure 7A schematic diagram of calculating the MPDIoU loss function in a method for detecting insulator defect types based on YOLOv8 according to Embodiment 2 of the present invention;
[0042] Figure 8 This is a structural schematic diagram of an insulator defect type detection device based on YOLOv8 described in Example 3 of the present invention, which utilizes the insulator defect type detection method based on YOLOv8 described in Example 1. DETAILED DESCRIPTION
[0043] The present invention is further described in detail below in conjunction with test examples and specific implementation methods. However, this should not be understood as the scope of the above subject matter of the present invention being limited to the following embodiments, and all technologies realized based on the content of the present invention belong to the scope of the present invention.
[0044] Example 1
[0045] like Figure 1 As shown, a method for detecting insulator defect types based on YOLOv8 includes the following steps:
[0046] a: Get the image to be detected.
[0047] b: Input the image to be detected into the pre-trained evaluation model and output the corresponding detection result.
[0048] The pre-training of the evaluation model includes the following steps:
[0049] Sample images of insulators are collected and annotated.
[0050] Expand sample images and automatically generate corresponding labels to build a dataset.
[0051] Construct a DRR-YOLO model; wherein the DRR-YOLO model uses the YOLOv8 model as the backbone network, and replaces the C2f module of the YOLOv8 model with a pre-constructed DRR (Dilated Re-param Residual) module.
[0052] The DRR-YOLO model is trained using the data set to obtain an evaluation model.
[0053] Example 2
[0054] This embodiment is a specific implementation scheme of the evaluation model described in the insulator defect type detection method based on YOLOv8 described in Example 1, and specifically includes:
[0055] The DRR-YOLO model uses the YOLOv8 model as the backbone network, and replaces the C2f module of the YOLOv8 model with the DRR module.
[0056] The DRR module is a pre-built dilated re-parameterized residual module. Figure 2 As shown, the DRR module uses the C2f module as a framework, and adds a FDR (Fast Dilated Re-param) module and a DWR (Dilation-wise Residual) module.
[0057] Among them, the C2f module is a network design that is currently based on the ideas of the C3 module and ELAN. This design allows YOLOv8 to obtain richer gradient flow information while ensuring lightweight. Further, the DRR module includes a CBS (Conv2d_BN_SiLU) module, an FDR module, a split module, a Bottleneck module, a Concat module, a DWR module, and a CBS module connected in sequence. After the data is input (this embodiment takes In_h*w*c as input), it is processed by the CBS module and the FDR module and outputs Out_h*w*c. After the split module is divided into several Out_h*w*0.5c data, they are respectively sent to the Bottleneck module (the data sent to this module is sent to the Concat module after processing) and the Concat module. The Concat module combines the various data to generate Out_h*w*0.5(n+2)c data, which are sent to the DWR module and the CBS module for processing and output.
[0058] Furthermore, the FDR module is arranged at the input end of the C2f module, and includes a plurality of serial large convolution kernels and inserted zero values, so as to expand the receptive field; and reduce the number of parameters and the amount of calculation of the model through the reparameterization technology.
[0059] The present invention draws on the idea of SPPF (Spatial Pyramid Pooling-Fast) proposed in the YOLOv5 model, and proposes a new module FDR based on DRB. Different from the original DRB parallel method, the present invention uses a serial method with a large convolution kernel to expand the convolution. The output after each batch normalization process is used as the input of the next dilated convolution. In this process, zero values are inserted to expand the receptive field, reduce redundant operations, and improve the running speed. The comparison between FDR and DRB modules is shown in Figure 2. Figure 3As shown in the figure. By using convolution kernels with different expansion rates, the feature information of targets of different scales can be better extracted. At the same time, the reparameterization technology is used to reduce the number of model parameters and the amount of calculation, further accelerating the training and detection speed of the model.
[0060] Furthermore, the Bottleneck module is a residual module, which reduces the amount of computation by reducing the number of channels in the middle layer while maintaining the network's expressive power. Figure 4 As shown, the Bottleneck module controls whether to perform residual connection according to the shortcut parameter.
[0061] Furthermore, the DWR module is arranged at the output end of the C2f module to extract multi-scale context information.
[0062] The present invention adds a DWR module to the output part of the tail, extracts features of different scales through the expansion convolution operation of the DWR module, enhances the perception ability and extraction effect of the model, better captures the input context information, and improves the model detection performance; Figure 5 As shown, the DWR module achieves the above effects through several convolutional layers (where D-1, D-2, D-3, and D-5 are 3*3 convolutional layers, and D-4 is a 1*1 convolutional layer) and BN (Batch Norm, normalization layer).
[0063] The present invention integrates FDR and DWR into the C2f module of the model, and designs a new module C2f_DRR, namely the dilated reparameterized residual module DRR. This module combines the large receptive field provided by the large convolution kernel and the characteristics of the DWR module in extracting multi-scale context information, and enhances the model's feature extraction capabilities for different defect categories and sizes. Both FDR and DWR are modular structures and can be integrated into various deep learning models. This combination can make the model more flexible to adapt to different application scenarios, thereby improving the adaptability and scalability of the model. At the same time, it reduces the training time and the use of computing resources, and improves training efficiency and performance. It brings new ideas and methods to the design and application of deep learning models.
[0064] Furthermore, an LSKA (Large Separable Kernel Attention) attention mechanism is added to the tail SPPF module of the Backbone network in the C2f module of the DRR module (referred to as the LSPPF module in this embodiment). The LSKA attention mechanism uses horizontally and vertically cascaded kernels to reduce memory usage and improve computing efficiency.
[0065] Since insulators are often in complex environments, their defective parts account for a small proportion of the image, making it difficult for the algorithm to effectively identify and extract relevant feature information. In order to enhance the extraction of target feature information, the researchers introduced the attention mechanism. The core of this mechanism is to make the network focus on the target area in the image rather than the entire image, thereby enhancing the recognition of the target's appearance features. In this way, the algorithm can more accurately focus on the target's feature information, ignore irrelevant information, and thus improve its detection efficiency. In recent years, the attention mechanism has been widely used in computer vision tasks such as target detection and image segmentation, and has occupied an important position in the field of deep learning.
[0066] Attention mechanisms are mainly divided into channel attention mechanisms and spatial attention mechanisms, which focus on channel dimensions and spatial dimensions respectively. Channel attention processes the distribution relationship of feature map channels, such as SE and ECA channel attention modules. Spatial attention makes the neural network pay more attention to the target area in the image and ignore unimportant areas, such as NL and SGE spatial attention mechanisms. And CBAM, a combination of spatial and channel attention mechanisms. These attention modules can help the model to enhance its ability to extract target feature information, but they cannot solve the problems caused by large convolution kernels.
[0067] Although the proposed DRR module improves the training speed and detection performance to a certain extent, it does not solve the problem of large computation and memory usage caused by large convolution kernels. Therefore, the present invention introduces the LSKA attention mechanism in the tail SPPF module of the Backbone network. The network structure is as follows: Figure 6 As shown, it includes a CBS module, a maximum pooling layer (MaxPool), a connection layer (Concat) and an LSKA attention mechanism; the CBS module includes a Conv layer, a BN layer and a Silu layer.
[0068] Among them, k represents the maximum receptive field, d represents the dilation rate, Represents the rounding down operation. Assume that a feature map F is given C ∈R C*H*W , C, H, W are the number of channels, height and width of the input feature map respectively. Then the output expression of the LSKA attention mechanism is:
[0069]
[0070] A C =W 1×1 *Z C ,
[0071]
[0072] Among them, * and Represent convolution and Hadamard product respectively; This is a round down operation; Represents the output result of the first process; Z C Indicates the output result of the second process; and They represent convolution kernels of size (2d-1)×1 and size 1×(2d-1) respectively; and Respectively represent the size and size The convolution kernel of C is the attention map; W 1×1 is a convolution kernel of size 1×1; is the output of the LKSA attention mechanism; k is the maximum receptive field; d is the expansion rate.
[0073] The core idea of LSKA is to decompose the 2D convolution kernel into two 1D convolution kernels connected in series. When performing the convolution operation, the depthwise separable convolution (DW-Conv) and the depthwise separable dilated convolution are executed in series, and the performance is maintained at the same level as the standard Large Kernel Attention (LKA) module. Unlike LKA, LSKA uses horizontally and vertically cascaded kernels to further reduce memory usage and improve computational efficiency. The present invention introduces LSKA in the SPPF module, which effectively solves the negative effects caused by the DRR module. The present invention proposes an LSPPF module to replace the SPPF in the original model, which simplifies the structure while enabling the model to better preserve the feature information of the target.
[0074] Furthermore, the DRR-YOLO model adopts the nner-MPDIoU function as the loss function of the model.
[0075] At present, the loss function of the YOLOv8 model includes a combination of classification loss and regression loss function, where the classification loss adopts Binary Cross Entropy (BCE) loss and the regression loss adopts the form of CIOU_Loss+DFL. BCE_Loss is an improved cross entropy loss function, which calculates the loss value based on the difference between the true label of each sample and the label predicted by the model, judges whether each category is "this category", and outputs the confidence. At the same time, it also considers the association information between each sample and other samples, so that it can better handle the mutual influence between multiple tasks and better measure the accuracy of model prediction. The calculation process is as follows:
[0076]
[0077] Among them, L is the BCE_Loss loss function, N represents the weight of each category of the data set, and y i represents the value of the true label, p i Indicates the result predicted by the model. i When it is 1, the first term of the loss function takes effect, and the model's prediction result p i The closer it is to 1, the smaller the corresponding loss; when y i When it is 0, the second term of the loss function takes effect, and the model's prediction result p i The closer it is to 0, the smaller the corresponding loss.
[0078] IoU_Loss is the earliest proposed target detection loss function, but it only considers the overlapping area of the detection box and the target box, which has certain defects. The emergence of the GIoU_Loss loss function has solved the shortcomings of IoU_Loss to a certain extent, but it also has shortcomings such as inaccurate boundary regression and slow convergence. The subsequent DIoU_Loss loss function takes into account the overlapping area and the distance from the center point, and speeds up the convergence speed, but does not take into account the aspect ratio factor. In response to the above shortcomings, the CIoU_Loss loss function takes into account the overlapping area, the distance from the center point and the influencing factor αυ of the aspect ratio. The YOLOv8 model uses CIoU_Loss as the regression loss function, and its calculation formula is shown below.
[0079]
[0080] Among them, CIoU is the CIoU_Loss loss function, IoU is the IoU loss function, b represents the center coordinate of the prediction box, b gt Represents the parameters of the center of the real target bounding box, gt is the ground truth (real target). 2 represents the Euclidean distance between two center points, d represents the diagonal length of the minimum circumscribed rectangle of the two rectangles, and υ is used to measure the consistency of the aspect ratio and is a weight function. The values of α and υ are shown below.
[0081]
[0082] IoU loss is the most common loss function in target detection, which represents the intersection-over-union ratio of the real box and the predicted box. The calculation formula is as follows.
[0083]
[0084] Among them, A and B are the real box and the predicted box respectively.
[0085] After the YOLOv8 model introduced Anchor-Free, the output of the model changed from "offset of the anchor box size" to "the distance from the center point of the left, top, right, and bottom borders of the predicted target box". At the same time, in order to cooperate with Anchor-Free and improve the generalization performance of the model, v8 also introduced the DFL loss function, which takes into account the distribution of samples and the imbalance between positive and negative samples, increases the robustness of sample distribution, and strengthens the generalization of occlusion and object movement. To convert to the form of DFL labels, the label value xyhw must first be converted to ltrb (ltrb = left, top, right, bottom), and then their values are calculated and converted to the integral form required by DFL, (predicted value + adjacent predicted value). In the actual training process, DFL is used in combination with CIoU loss. First, the bounding box distribution probability and the label distribution probability loss are calculated through DFL, and then the bounding box distribution probability is restored back to the predicted box. The loss of the predicted box and the actual box of the label is calculated through CIoU loss to optimize the overall predicted box.
[0086] Therefore, the present invention chooses to introduce the MPDIoU loss function in the model to improve the accuracy of detection. MPDIoU is a bounding box loss function based on the minimum point distance. It fully considers all relevant factors and calculates IoU by minimizing the point distance between the predicted bounding box and the true bounding box, thereby simplifying the calculation process, allowing the model to converge faster during training and improve training efficiency. At the same time, it enables the model to adapt to different application scenarios and improve the generalization ability of the model.
[0087] At the same time, the present invention also combines the characteristics of Inner-IoU that it pays more attention to the internal overlapping part of the bounding box, and designs Inner-MPDIoU as the loss function of the model. By focusing on the core part of the bounding box, the detection effect of the overlapping area is enhanced. At the same time, the size of the auxiliary bounding box can be adjusted to achieve detection of different data sets, with better generalization performance. Its calculation principle and process are as follows Figure 7 And as shown below.
[0088]
[0089] Among them, MPDIoU is the nner-MPDIoU loss function, A and B are the real box and the predicted box respectively, IoU is the IoU loss function, d1 and d2 represent the relative distances between a set of diagonals of the predicted bounding box and the actual bounding box respectively, w and h represent the width and height of the bounding box, and Respectively represent the coordinates of a set of diagonal corners of the predicted bounding box; and Represents the coordinates of a set of opposite corners of the actual bounding box.
[0090] Furthermore, the data set includes a randomly divided training set, a validation set, and a test set; and training the DRR-YOLO model using the data set includes the following steps:
[0091] Training the DRR-YOLO model using the training set, and outputting a preliminary evaluation model after the model converges;
[0092] Verifying the model generalization ability of the preliminary evaluation model through the verification set, and performing parameter adjustment and model selection to obtain an evaluation model;
[0093] The test set is input into the evaluation model for testing. If the accuracy meets the preset threshold, the evaluation model is output; otherwise, the evaluation model is retrained.
[0094] Example 3
[0095] like Figure 8 As shown, an insulator defect type detection device based on YOLOv8 includes at least one processor, a memory connected to the at least one processor, and at least one input-output interface connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the insulator defect type detection method based on YOLOv8 described in the above embodiment. The input-output interface may include a display, a keyboard, a mouse, and a USB interface for inputting and outputting data.
[0096] Those skilled in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), disks or optical disks, etc. Various media that can store program codes.
[0097] When the above-mentioned integrated unit of the present invention is implemented in the form of a software functional unit and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0098] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting insulator defect types based on YOLOv8, characterized in that: The following steps are involved: a: Get the image to be detected; b: Input the image to be detected into the pre-trained evaluation model and output the corresponding detection result; The pre-training of the evaluation model includes the following steps: Collecting sample images of insulators and annotating the sample images; Expand sample images and automatically generate corresponding labels to build a data set; Construct a DRR-YOLO model; wherein the DRR-YOLO model uses the YOLOv8 model as the backbone network, and replaces the C2f module of the YOLOv8 model with a pre-built DRR module; The DRR-YOLO model is trained using the data set to obtain an evaluation model.
2. The insulator defect type detection method based on YOLOv8 according to claim 1 is characterized in that: The DRR module uses the C2f module as a framework and adds the FDR module and the DWR module; The FDR module is arranged at the input end of the C2f module, and includes a plurality of serial large convolution kernels and inserted zero values, so as to expand the receptive field; The DWR module is arranged at the output end of the C2f module and is used to extract multi-scale context information.
3. The insulator defect type detection method based on YOLOv8 according to claim 2 is characterized in that: The FDR module also includes reducing the number of parameters and the amount of calculation of the model through reparameterization technology.
4. The insulator defect type detection method based on YOLOv8 according to claim 2 is characterized in that: An LSKA attention mechanism is added to the tail SPPF module of the Backbone network in the C2f module of the DRR module. The LSKA attention mechanism uses horizontally and vertically cascaded kernels to reduce memory usage and improve computational efficiency.
5. The insulator defect type detection method based on YOLOv8 according to claim 4 is characterized in that: The output expression of the LSKA attention mechanism is: AND C =In 1×1 *WITH C , Among them, * and Represent convolution and Hadamard product respectively; This is a round down operation; Represents the output result of the first process; Z C Indicates the output result of the second process; and They represent the convolution kernels of size (2d-1)×1 and size 1×(2d-1) respectively; F C ∈R C*H*W is the feature map, C, H, and W are the number of channels, height, and width of the input feature map respectively; and Respectively represent the size and size The convolution kernel of C is the attention map; W 1×1 is a convolution kernel of size 1×1; is the output of the LKSA attention mechanism; k is the maximum receptive field; d is the expansion rate.
6. The insulator defect type detection method based on YOLOv8 according to claim 1, characterized in that: The DRR-YOLO model uses the nner-MPDIoU function as the loss function of the model, which is expressed as: Among them, MPDIoU is the nner-MPDIoU loss function, A and B are the real box and the predicted box respectively, IoU is the IoU loss function, d1 and d2 represent the relative distances of a set of diagonals between the predicted bounding box and the actual bounding box respectively, w and h represent the width and height of the bounding box, and Respectively represent the coordinates of a set of diagonal corners of the predicted bounding box; and Represents the coordinates of a set of opposite corners of the actual bounding box.
7. The insulator defect type detection method based on YOLOv8 according to claim 1 is characterized in that: The data set includes a randomly divided training set, a validation set, and a test set; and training the DRR-YOLO model using the data set includes the following steps: Training the DRR-YOLO model using the training set, and outputting a preliminary evaluation model after the model converges; Verifying the model generalization ability of the preliminary evaluation model through the verification set, and performing parameter adjustment and model selection to obtain an evaluation model; The test set is input into the evaluation model for testing. If the accuracy meets the preset threshold, the evaluation model is output; otherwise, the evaluation model is retrained.
8. An insulator defect type detection device based on YOLOv8, characterized in that: It includes at least one processor and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any one of claims 1 to 7.