SDEYOLOv8-based high-voltage wire broken and scattered strand detection method

By using the SDE_YOLOv8 model in the detection of broken strands of high-voltage wires, combining polygon annotation and dynamic background technology, embedding the DCNV4 structure and EMA attention mechanism, and replacing the loss function, the problems of low detection efficiency and low accuracy in the existing technology are solved. Efficient and accurate detection results are achieved.

CN118675067APending Publication Date: 2024-09-20GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410678278.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

The existing technology has the problems of low efficiency, low accuracy and vulnerability to image noise in detecting broken strands of high-voltage wires. It is particularly ineffective in detecting small targets, and the memory usage of the neural network model is too large and the detection speed is slow.

Method used

A detection method based on SDE_YOLOv8 is used to collect data sets through drones, use polygon annotation and dynamic background technology to generate virtual data sets, modify the C2f module in the YOLOv8 network to embed the DCNV4 structure, introduce the EMA attention mechanism, and replace the loss function with Shape -IOU loss function to improve the model's attention to the target shape and size.

Benefits of technology

It has improved the accuracy and speed of detecting broken strands of high-voltage wires, reduced over-fitting of the model, improved detection accuracy and efficiency, enhanced the ability to learn from irregular changes, and ensured the meticulousness of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675067A
    Figure CN118675067A
Patent Text Reader

Abstract

The invention discloses a method for detecting broken and scattered strands of a high-voltage wire based on SDEYOLOv8. The method comprises the following steps: collecting broken and scattered strand data of the high-voltage wire; expanding and integrating the data set; enhancing learning of data features; an EMA attention mechanism is introduced to improve SDEYOLOv8 extraction and attention feature information; a YOLOv8 loss function is improved, and the loss function in the YOLOv8 is replaced with a Shape-IOU loss function, so that the attention of the model on the shape and size of the target is enhanced, and the detection performance is improved; and predicting a result and outputting a detection result. According to the method, the DCNv4Net is embedded into the YOLOv8, so that the learning and induction of the model to irregular changes can be improved, the detection accuracy of the model is improved, and the SDEYOLOv8 model can accurately and efficiently detect the broken and scattered strand fault of the high-voltage wire. According to the method, a direction is provided for small sample target detection, the model learning speed and the target detection quality are improved, and the detection effect is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision and image detection, and relates to a method for detecting broken strands of a high-voltage wire, in particular to a method for detecting broken strands of a high-voltage wire based on SDE_YOLOv8. Background Art

[0002] In recent years, target detection has been widely used in various industrial fields, such as electricity, manufacturing, and automobiles. In the manufacturing industry, product defect detection is crucial to ensure product quality and production efficiency. Traditional defect detection methods usually rely on manual visual inspection or the use of specific sensors, but there are problems such as low efficiency and susceptibility to subjective factors. Therefore, defect detection based on neural network deep learning has become the main force in target detection in defect recognition due to its efficient recognition and automatic detection that is not interfered by subjective factors.

[0003] As an important foundation and guarantee for modern economic development and social progress, the power grid has achieved remarkable achievements. my country's demand for electricity is very large. However, in some areas, the problem of high-voltage wires breaking and loosening has caused serious safety accidents and huge economic losses. It is particularly important to find and deal with the problem in time. However, due to the large number of high-voltage wires and the inconvenience of their location, it is difficult to use manual elimination methods to diagnose the problem.

[0004] How to accurately detect the broken strand fault of high-voltage conductors has become a difficult problem in current research. There are currently two main research methods: one is to use traditional image recognition methods to identify the obtained high-voltage conductor photos one by one, and the other is to use neural networks to identify defects.

[0005] Traditional image processing and recognition are mainly based on threshold segmentation, grayscale image processing, straight line ladder diagram and other methods. The main process of this type of method is to perform grayscale processing after denoising the high-voltage wires photographed in segments, so that the background and high-voltage wires display different grayscales, and then use the straight line detection operator to use Hough and Freeman operators to determine and segment the wires. By comparing the slope of the normal straight line area and the slope of the broken strand area, it is determined whether there is a broken strand. Traditional image processing and recognition methods are inefficient and low in accuracy, and are easily affected by image noise before and after processing.

[0006] Deep learning based on neural networks has several significant advantages over traditional image recognition methods. One is that end-to-end deep learning maps from original images to target detection results, without the need to manually design complex feature extractors, which can make the model more quickly and more generalized and deployed in various scenarios. Second, deep learning models can effectively utilize the information of targets and non-targets in images. Through deep structures such as convolutional neural networks, the model can understand images at different scales and levels, thereby better understanding the relationship between targets and non-targets.

[0007] However, neural network is a technology that is highly dependent on the number of features. It has high accuracy in detecting large objects because large objects contain richer target information, but there are problems with false detection and missed detection for small targets, especially for small samples (small target detection with a small number of samples). In fact, to solve the above problems, many researchers have improved the detection effect by improving the network structure, enhancing network performance and data enhancement. However, there are disadvantages such as excessive memory usage, difficulty in implementing the technology, and low detection speed. Summary of the invention

[0008] The purpose of the present invention is to provide a method for detecting broken strands of high-voltage wires based on SDE_YOLOv8 in view of the shortcomings of the prior art. This method improves the detection accuracy and detection speed, so that the detection effect is better.

[0009] The technical solution for achieving the purpose of the present invention is:

[0010] A method for detecting broken strands of high-voltage wires based on SDE_YOLOv8, comprising the following steps:

[0011] 1) Collect the data set of broken high-voltage wires:

[0012] A dataset of broken high-voltage wires was collected by drones, and Labelme was used to mark abnormal locations in the wires. Polygonal annotation was used instead of bounding box annotation to avoid useless background features contained in bounding box annotations that would interfere with later detection results during data expansion.

[0013] Dynamic background technology is used to extract the environment where the high-voltage line is located. Based on the sliding window method of dynamic step size and random scale, the image is divided into background images of different scales. Finally, the dynamically generated background image is fused with the labeled target image to obtain a virtual data set.

[0014] 2) Data expansion and integration:

[0015] The broken strands of high-voltage wires captured in real scenes and the virtual data generated by the dynamic background in step 1) are integrated into a large data set, and the data set is divided into a training set and a test set in a ratio of 8:2;

[0016] 3) Enhanced learning of data features:

[0017] Modify the C2f module in the YOLOv8 network and embed it into the DCNV4 structure to obtain the SDE_YOLOv8 network model. Input the training set images in step 2) into the SDE_YOLOv8 network model. After each image is convolved with the initial features of YOLOv8, it is input into the DCNV4_Net structure. DCNv4_Net uses a similar idea of ​​separable convolution to calculate the mask depth-wise and the offset point-wise. Finally, it outputs the offset and shape change parameters of the horizontal and vertical coordinates of each pixel. These parameter weights adaptively adapt to the feature position in the input information, thereby improving the feature expression ability and helping the model converge faster. Finally, the best parameter weights in the training process are obtained through the SDE_YOLOv8 network model and packaged into a weight file.

[0018] 4) Introducing the EMA attention mechanism to improve SDE_YOLOv8’s ability to extract and focus on feature information;

[0019] 5) Improve the YOLOv8 loss function and replace the loss function in YOLOv8 with the Shape-IOU loss function, so that the model pays more attention to the shape and size of the target and improves the detection performance;

[0020] 6) Result prediction:

[0021] The weights of the abnormal feature map learned by SDE_YOLOv8 are matched with the images of the test set in step 2), and the abnormal features of the image are predicted by the learned weights. The Anchor-free mechanism is used to mark potential targets during prediction. Finally, the results of multiple prediction boxes are screened by NMS (non-maximum suppression), and the one with the highest score is retained as the prediction box. The prediction box is the abnormal fault location detected in the broken strands of the high-voltage line conductor.

[0022] Furthermore, the process of collecting the high-voltage line broken strand data set in steps 1) and 2) is as follows:

[0023] The high-voltage wire images are captured by the high-definition camera of the drone, where the camera resolution is set to no less than 8000x6000 pixels. Polygon annotation and dynamic background technology are used to generate virtual data for the original images. The real data set and the virtual data set are then merged into a large data set. The image annotation tool Labelimg is then used to annotate the merged large data set with two high-voltage wire states, and the annotation categories are “Normal_Wire” (normal high-voltage wire) and “Adnoraml_Wire” (abnormal high-voltage wire).

[0024] Furthermore, the steps of calculating the offset and shape change parameters of the pixel points in step 3) are as follows:

[0025] 3.1) There are two convolution kernels in the C2f module of YOLOv8. The size of these two convolution kernels is 3*3. The size of the feature map output by the two convolution kernels remains unchanged. The DCNv4_Net structure also has a 3*3 convolution kernel that can calculate the required offset and change parameters without changing the size of the feature map. The second 3*3 convolution in the C2f module is replaced by DCNv4_Net to obtain DCNv4-YOLOv4;

[0026] 3.2) Input the training set images of step 2) into the SDE_YOLOv8 network model. Each image first passes through the default first few layers of feature transformation of YOLOv8 in the SDE_YOLOv8 network model, and then passes it to the C2f module in YOLOv8, which is embedded with the DCNv4_Net structure. The features pass through a layer of 1*1 convolution kernel in the C2f module, and a layer of Split feature segmentation layer divides the features into two according to the number of channels. One part is passed to the DCNv4_Net structure and waits for feature concatenation Concat, and the other part is passed to the CNv4_Net structure. In this structure, the features pass through a layer of 3*3 convolution layer and a CNv4 convolution layer. The DCNv4 convolution layer is a separable convolution composed of a 3*3 convolution and a linear projection, which separates the original convolution weight wk into a depth part and a point-by-point part. The depth part is responsible for the original position-aware modulation scalar mk, and the point-by-point part is the projection weight w shared between the sampling points. The features pass through this separable convolution to obtain the horizontal and vertical coordinate offsets of the sampling points and the offset adjustment scale:

[0027]

[0028] Where: G is the number of aggregation groups; for the gth group, w g ∈R C×C' , C'=C / G is the projection weight at different positions; K is the number of sampling points; m gk ∈R is the modulation factor of the kth sampling point. Unlike DCNv3, DCNv4 cancels the final softmax normalization, reducing unnecessary calculations and speeding up model calculations.

[0029] 3.3) Perform a BatchNorm2d normalization operation on the feature output including offset and scale obtained by DCNv4_Net:

[0030]

[0031] Where: x is the input eigenvalue, E[x] represents the mean, Var[x] represents the variance. These two parameters can be directly calculated in the forward propagation. γ and β are the adjusted variance and adjusted mean, with initial values ​​of 1 and 0 respectively. These two parameters are continuously updated and learned by the model in the back propagation formula. eps is to ensure the stability of the calculation and avoid the situation where the denominator is 0. The default value is 1e-5.

[0032] 3.4) Use the Relu function to perform an intensification operation on the output result, output the input values ​​greater than 0 completely, and assign the input values ​​less than 0 to 0.

[0033] Furthermore, the specific steps of using the EMA attention mechanism described in step 4) are as follows:

[0034] 4.1) The feature output obtained after the Backbone part of SDE_YOLOv8 is passed into the EMA attention mechanism. Assuming that the size of the feature map is H×W×C, feature extraction will make the model pay more attention to the output of the feature position. The features will be divided into g groups in the input EMA attention mechanism. One branch will go through the one-dimensional horizontal global pooling operation of "X Avg Pool", and one branch will be input into the one-dimensional vertical global pooling operation of "Y Avg Pool"; one branch will extract features through 3×3 convolution, and the remaining part will be used as a cross-dimensional interaction module to be merged;

[0035] 4.2) The two global pooling outputs obtained in 4.1) are subjected to sigmoid function and weighted multiplication with the cross-dimensional module to realize the interaction between feature maps. Then, a layer of GN is used to perform group normalization on the interactive feature maps to adjust the feature distribution within each group. The obtained outputs are used as two inputs, one of which is input into the Sofmax function to obtain the output out_1, and the other is input into the avg global pooling to obtain the output out_2;

[0036] 4.3) The 3×3 convolution output obtained in 4.1) is also used as two inputs, one is input to the Sofmax function to obtain the output out_3, and the other is input to the avg global pooling to obtain the output out_4;

[0037] 4.4) Perform matrix multiplication on the output out_1 obtained in 4.2) and the output out_4 obtained in 4.3), and matrix multiplication on out_2 and out_3. Finally, combine these two outputs and perform weighted multiplication and Sigmoid activation function on the cross-dimensional module in 4.1) to obtain the final output. The size of the output feature map is consistent with the size of the input, which is H×W×C.

[0038] Furthermore, the specific steps of using the Shape-IOU loss function described in step 5) are as follows:

[0039] Replace the loss function in YOLOv8 with the Shape-IOU loss function. The loss function formula is as follows:

[0040] L Shape-IoU =1-IoU+distance shape +0.5×Ω shape

[0041] In the formula, IOU represents the ratio of the intersection and union of the predicted box area and the real box area, and distance shape and Ω shape It is the penalty term for the shape and size of the box by the prediction box regression. The formulas are as follows:

[0042]

[0043] Where: B represents the area of ​​the prediction box, Bgt represents the area of ​​the real target box;

[0044]

[0045]

[0046] Where scale is the scaling factor, which is related to the size of the target in the dataset, ww and hh represent the weight coefficients in the horizontal and vertical directions respectively, whose values ​​are related to the shape of the real box, and c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the real box;

[0047]

[0048] The Shape-IOU loss function allows the model to focus on the shape and scale of the bounding box during the learning process, thereby improving detection accuracy and convergence speed.

[0049] Further, the result prediction described in step 6) is specifically performed in the following steps:

[0050] 6.1) Match the weights learned in step 5) with the validation set images in step 2), and predict the features of the images using the Anchor-Free method. In Anchor-Free, the input image is divided into a grid of a fixed size, and each grid unit replicates the detection of the target contained within it. Each grid unit is represented by the center point coordinates (x, y);

[0051] 6.2) Bounding box prediction: by performing convolution operations on the feature maps extracted by the YOLOv8 backbone network, for each grid unit, the offset value (tx, ty, tw, th) of each bounding box is calculated through the convolution layer. The offset value is relative to the center coordinates (x, y) of the current network unit and the width and height of the bounding box;

[0052] 6.3) Object category detection: Object category detection is also achieved by performing convolution operations on the feature maps extracted by the backbone network. For each grid unit, the probability of each bounding box corresponding to each object category is calculated through the convolution layer, and the softmax function is used to convert these probability values ​​into probability distribution;

[0053] 6.4) In the predicted bounding box, there may be multiple duplicate boxes. In order to remove redundant detection results, the non-maximum NMS algorithm is usually used to sort all bounding boxes according to the confidence level. Then, starting from the box with the highest confidence level, the boxes whose overlap with the box is higher than the set threshold are gradually removed until a predicted box is retained. This predicted box is the predicted result of the high-voltage wire broken strand detection.

[0054] Compared with the existing methods, the method for detecting broken strands of high-voltage conductors of the present invention has the following advantages:

[0055] 1. The SDE_YOLOv8 model in the method of the present invention can accurately and efficiently detect the broken strand fault of high-voltage wires.

[0056] 2. Compared with ordinary data enhancement, the virtual data generation in the method of the present invention is more realistic and helps to alleviate the overfitting of the model.

[0057] 3. The method of the present invention embeds DCNv4_Net into YOLOv8 to improve the model's learning and induction of irregular changes and improve the model's detection accuracy.

[0058] 4. The method of the present invention uses the EMA attention mechanism, through the cross-dimensional interaction module and the idea of ​​group processing, to effectively aggregate multi-scale spatial structure information, establish short-term and long-term information dependencies, make the feature information richer, the model pays more attention to the feature position, and improve the recognition accuracy of the model.

[0059] 5. The method of the present invention uses the Shape-IOU loss function, which makes the model pay more attention to the shape and size of the bounding box on the basis of the original model, thereby improving the detection accuracy. This method has high detection accuracy and makes the detection effect more detailed. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 This is a flow chart of a method for detecting broken strands of a high-voltage conductor according to the present invention;

[0061] Figure 2 This is a schematic diagram of the network structure of SDE_YOLOv8 in the embodiment;

[0062] Figure 3 It is a schematic diagram of the structure of DCNv4_Net in the embodiment;

[0063] Figure 4 Schematic diagram of EMA attention mechanism in the embodiment;

[0064] Figure 5 It is a schematic diagram of the convergence of the SDE_YOLOv8 network model in the embodiment;

[0065] Figure 6 This is a diagram showing the actual detection effect of using the method of the present invention to detect broken strands of a high-voltage conductor. DETAILED DESCRIPTION

[0066] The present invention is further described in detail below with reference to the accompanying drawings and embodiments, but the present invention is not limited thereto.

[0067] Example:

[0068] A method for detecting broken strands of high-voltage wires based on SDE_YOLOv8. Figure 1 As shown, the following steps are included:

[0069] 1) Collect the data set of broken strands of high-voltage conductors;

[0070] 2) Data set expansion and integration;

[0071] Integrate the broken strands of high-voltage wires captured in real scenes and the virtual data generated by the dynamic background in step 1) into a large data set, and divide the data set into a training set and a test set in a ratio of 8:2;

[0072] 3) Enhanced learning of data features:

[0073] Modify the C2f module in the YOLOv8 network and embed it into the DCNV4 structure to obtain the SDE_YOLOv8 network model, as shown in Figure 2 As shown in Figure 2, the training set images in step 2) are input into the SDE_YOLOv8 network model. Each image is input into the DCNV4_Net structure after the initial feature convolution of YOLOv8, as shown in Figure 2. Figure 3As shown in the figure, DCNv4_Net uses a similar idea of ​​separable convolution to calculate the mask depth-wise and the offset point-wise, and finally outputs the offset and shape change parameters of the horizontal and vertical coordinates of each pixel. These parameter weights adaptively adapt to the feature position in the input information, thereby improving the feature expression ability and helping the model converge faster. Finally, the best parameter weights in the training process are obtained through the SDE_YOLOv8 network model and packaged into a weight file.

[0074] 4) Introducing the EMA attention mechanism (such as Figure 4 Improve SDE_YOLOv8 to extract and focus on feature information;

[0075] 5) Improve the YOLOv8 loss function and replace the loss function in YOLOv8 with the Shape-IOU loss function, so that the model pays more attention to the shape and size of the target and improves the detection performance;

[0076] 6) Result prediction and output of detection results.

[0077] Step 1) The process of collecting the high-voltage line broken strand data set is as follows:

[0078] The high-voltage wire images were captured by the drone’s high-definition camera, where the camera resolution was set to no less than 8000x6000 pixels. Labelme was used to mark abnormal locations in the wires, and polygonal annotation was used to avoid useless background features contained in bounding box annotations that would interfere with later detection results during data expansion.

[0079] Dynamic background technology is used to extract the environment where the high-voltage line is located. The dynamic background algorithm based on the sliding window method is used to divide the image into background images of different scales. In this process, the size of each sub-image needs to be determined. Usually, a suitable size can be selected based on comprehensive factors such as the image size and computing resources. Then the original image is divided into several sub-images. If the size of the boundary sub-image exceeds the boundary when processing the sub-image, the window is traced back to the result of the nearest most suitable size. The extracted background sub-image and the defect extracted in step 1) are image fused to obtain a virtual generated data set.

[0080] Step 2) Dataset expansion and integration, specifically: integrate the broken high-voltage wire strands captured in real life and the virtual data generated by the dynamic background in step 1) into a large data set, then merge the real data set and the virtual data set into a large data set, and then use the image annotation tool Labelimg to annotate the merged large data set with two high-voltage wire states, and classify them as "Normal_Wire" and "Adnormal_Wire", and divide the data set into a training set and a test set in a ratio of 8:2.

[0081] Step 3) The training set obtained is input into SDE_YOLOv8, such as Figure 2 As shown, the training set will perform feature learning in the SDE_YOLOv8 network structure. When the learning reaches the set number of epochs, the training output will be terminated and a weight file will be saved. The weight file contains the best training weight in this training and the last training weight result.

[0082] The steps for calculating the pixel offset and shape change parameters in step 3) are:

[0083] 3.1) There are two convolution kernels in the C2f module of YOLOv8. Replace the second 3*3 convolution in the C2f module with DCNv4_Net to obtain DCNv4-YOLOv4.

[0084] 3.2) DCNv4_Net structure (such as Figure 3 The features in the figure will first pass through a layer of 1*1 convolution kernel, and then pass through a layer of Split feature segmentation layer to divide the features into two according to the number of channels. One part is passed to the DCNv4_Net structure and waits for feature concatenation Concat, and the other part is passed to the DCNv4_Net structure. In this structure, the features pass through a layer of 3*3 convolution layer and a DCNv4 convolution layer. The DCNv4 convolution layer is a separable convolution composed of a 3*3 convolution and a linear projection, which separates the original convolution weight wk into a depth part and a point-by-point part. The depth part is the original position-aware modulation scalar mk, and the point-by-point part is the projection weight w shared between the sampling points. The features pass through this separable convolution to obtain the horizontal and vertical coordinate offsets of the sampling points and the offset adjustment scale:

[0085]

[0086] Where: G is the number of aggregation groups; for the g-th group, wg∈RC×C', C'=C / G is the projection weight at different positions; K is the number of sampling points; mgk∈R is the modulation factor of the k-th sampling point, and unlike DCNv3, DCNv4 cancels the final softmax normalization, reducing unnecessary calculations and speeding up the model calculation speed;

[0087] 3.3) Perform a BatchNorm2d normalization operation on the feature output including offset and scale obtained by DCNv4_Net:

[0088]

[0089] Where: x is the input eigenvalue, E[x] represents the mean, Var[x] represents the variance. These two parameters can be directly calculated in the forward propagation. γ and β are the adjusted variance and adjusted mean, with initial values ​​of 1 and 0 respectively. These two parameters are continuously updated and learned by the model in the back propagation formula. eps is to ensure the stability of the calculation and avoid the situation where the denominator is 0. The default value is 1e-5.

[0090] 3.4) Use the Relu function to perform an intensification operation on the output result, output the input values ​​greater than 0 completely, and assign the input values ​​less than 0 to 0.

[0091] Step 4) uses the EMA attention mechanism (such as Figure 4 The specific steps are as follows:

[0092] 4.1) The feature output obtained after the Backbone part of SDE_YOLOv8 is passed into the EMA attention mechanism. Assuming that the size of the feature map is H×W×C, feature extraction will make the model pay more attention to the output of the feature position. The features will be divided into g groups in the input EMA attention mechanism. One branch will go through the one-dimensional horizontal global pooling operation of "X Avg Pool", and one branch will be input into the one-dimensional vertical global pooling operation of "Y Avg Pool"; one branch will extract features through 3×3 convolution, and the remaining part will be used as a cross-dimensional interaction module to be merged;

[0093] 4.2) The two global pooling outputs obtained in 4.1) are subjected to sigmoid function and weighted multiplication with the cross-dimensional module to realize the interaction between feature maps. Then, a layer of GN is used to perform group normalization on the interactive feature maps to adjust the feature distribution within each group. The obtained outputs are used as two inputs, one of which is input into the Sofmax function to obtain the output out_1, and the other is input into the avg global pooling to obtain the output out_2;

[0094] 4.3) The 3×3 convolution output obtained in 4.1) is also used as two inputs, one is input to the Sofmax function to obtain the output out_3, and the other is input to the avg global pooling to obtain the output out_4;

[0095] 4.4) Matrix multiply the output out_1 obtained in 4.2) with the output out_4 obtained in 4.3), matrix multiply out_2 with out_3, and finally combine these two outputs with the cross-dimensional module in 4.1) for weighted multiplication and Sigmoid activation function to obtain the final output. The size of the output feature map is consistent with the size of the input, which is H×W×C;

[0096] After step 4.2), the feature continues to follow Figure 2 The network model shown in the figure performs the remaining training, and outputs and saves the weight file of the model learning result after the specified number of training times.

[0097] The weights of the abnormal feature map learned by SDE_YOLOv8 are matched with the images of the test set in step 2), and the abnormal features of the image are predicted by the learned weights. The Anchor-free mechanism is used to mark potential targets during prediction. Finally, the results of multiple prediction boxes are screened by NMS (non-maximum suppression), and the one with the highest score is retained as the prediction box. The prediction box is the abnormal fault location detected in the broken strands of the high-voltage line conductor.

[0098] The result prediction described in step 6) is as follows:

[0099] 6.1) Match the weights learned in step 5) with the validation set images in step 2) and predict the features of the images using the Anchor-Free method. In Anchor-Free, the input image is divided into a grid of a fixed size, and each grid unit replicates the detection of the target contained within it. Each grid unit is represented by the center point coordinates (x, y);

[0100] 6.2) Bounding box prediction: by performing convolution operations on the feature maps extracted by the YOLOv8 backbone network, for each grid unit, the offset value (tx, ty, tw, th) of each bounding box is calculated through the convolution layer. The offset value is relative to the center coordinates (x, y) of the current network unit and the width and height of the bounding box;

[0101] 6.3) Object category detection: Object category detection is also achieved by performing convolution operations on the feature maps extracted by the backbone network. For each grid unit, the probability of each bounding box corresponding to each object category is calculated through the convolution layer, and the softmax function is used to convert these probability values ​​into probability distribution;

[0102] 6.4) In the predicted bounding box, there may be multiple duplicate boxes. In order to remove redundant detection results, the non-maximum NMS algorithm is usually used to sort all bounding boxes according to the confidence level. Then, starting from the box with the highest confidence level, the boxes whose overlap with the box is higher than the set threshold are gradually removed until a predicted box is retained. This predicted box is the predicted result of the high-voltage wire broken strand detection.

[0103] SDE_YOLOv8 network model convergence verification:

[0104] The training set is trained using the SDE_YOLOv8 network model, and the training is iterated 300 times on the GPU. During the training process, the log information of each iterative training of the SDE_YOLOv8 network model is collected. Through the visualization of the information, the SDE_YOLOv8 network model continues to converge during the training process. In the 300 iterations, the loss function gradually converges. The convergence status is shown in the figure. Figure 5 As shown, the results show that the SDE_YOLOv8 network model of this embodiment can reach a stable state quickly during the training process.

[0105] Performance evaluation:

[0106] Taking the precision rate (P) and the accuracy rate (R) as evaluation indicators, the method of this embodiment is compared with different improvement strategies respectively using the same data set under the same experimental environment. The detection results of broken strands of high-voltage wires are shown in Table 1:

[0107] Table 1 Performance comparison of different improvement strategy models

[0108]

[0109] As can be seen from the table above, the SDE_YOLOv8 network has the highest precision and recall, and the model comprehensive score indicators F1 and Map scores are also the highest. The reason is that the SDE_YOLOv8 structure allows the feature map to pass through the DCNv4 deformable convolution, and the convolution weights that focus on irregular shapes are very friendly to the irregular shapes of broken high-voltage wires. At the same time, the EMA attention mechanism enables the model to enhance the global perspective and features of different scales, and further model the global context and global information. The Shape-IOU loss function also learns the size and scale of the bounding box when regressing the prediction box, making the prediction box more consistent with the real target box. Therefore, the network has higher precision and recall. The network with the highest detection is YOLOv8, because the improved network algorithm increases the number of network layers and the complexity of calculation, thus increasing the detection time. Through the SDE_YOLOv8 structure, the precision rate is improved by 3 percentage points compared with the original YOLOv8. For the detection of broken strands of high-voltage wires, the importance of recall rate takes precedence over recall rate. The recall rate of SDE_YOLOv8 is also 6.8 percentage points higher than that of the original YOLOv8 model.

[0110] The actual detection effect of the method of the present invention on detecting the broken strands of high-voltage wires is as follows: Figure 6 As shown in the figure, it can be seen that the detection method of the present invention has a more detailed detection effect on abnormal high-voltage wire broken strands and a high detection accuracy.

Claims

1. A method for detecting broken strands of high-voltage wires based on SDE_YOLOv8, characterized in that: The steps include: 1) Collect the data set of broken high-voltage wires: A dataset of broken high-voltage wire strands was collected using drones, and Labelme was used to mark abnormal locations in the wires using polygonal annotation. Dynamic background technology is used to extract the environment where the high-voltage line is located. Based on the sliding window method of dynamic step size and random scale, the image is divided into background images of different scales. Finally, the dynamically generated background image is fused with the labeled target image to obtain a virtual data set. 2) Dataset expansion and integration: The broken strands of high-voltage wires captured in real scenes and the virtual data generated by the dynamic background in step 1) are integrated into a large data set, and the data set is divided into a training set and a test set in a ratio of 8:2; 3) Enhanced learning of data features: Modify the C2f module in the YOLOv8 network and embed it into the DCNV4 structure to obtain the SDE_YOLOv8 network model. Input the training set images in step 2) into the SDE_YOLOv8 network model. After each image is convolved with the initial features of YOLOv8, it is input into the DCNV4_Net structure. DCNv4_Net uses a similar idea of ​​separable convolution to calculate the mask depth-wise and the offset point-wise. Finally, it outputs the offset and shape change parameters of the horizontal and vertical coordinates of each pixel. Finally, the best parameter weights in the training process are obtained through the SDE_YOLOv8 network model and packaged into a weight file. 4) Introducing the EMA attention mechanism to improve SDE_YOLOv8’s ability to extract and focus on feature information; 5) Improve the YOLOv8 loss function and replace the loss function in YOLOv8 with the Shape-IOU loss function, so that the model pays more attention to the shape and size of the target and improves the detection performance; 6) Result prediction: The weights of the abnormal feature map learned by SDE_YOLOv8 are matched with the images of the test set in step 2), and the abnormal features of the image are predicted by the learned weights. The Anchor-free mechanism is used to mark potential targets during prediction. Finally, the results of multiple prediction boxes are screened by NMS, and the box with the highest score is retained as the prediction box. The prediction box is the abnormal fault location detected in the broken strands of the high-voltage line conductor.

2. The method for detecting broken strands of high-voltage wires based on SDE_YOLOv8 according to claim 1, characterized in that: The process of collecting the data set of broken strands of high-voltage wires in steps 1) and 2) is as follows: the high-voltage wire images are captured by the high-definition camera of the drone, where the camera resolution is set to be no less than 8000x6000 pixels, and the original images are labeled with polygons and dynamic background technology to generate virtual data. The real data set and the virtual data set are then merged into a large data set. The image annotation tool Labelimg is then used to annotate the merged large data set with two high-voltage wire states, and the annotation categories are "Normal_Wire" and "Adnormal_Wire".

3. The method for detecting broken strands of high-voltage wires based on SDE_YOLOv8 according to claim 1, characterized in that: The steps for calculating the offset and shape change parameters of the pixel points described in step 3) are: 3.1) There are two convolution kernels in the C2f module of YOLOv8. The size of these two convolution kernels is 3*3. The size of the feature map output by the two convolution kernels remains unchanged. The DCNv4_Net structure also has a 3*3 convolution kernel that can calculate the required offset and change parameters without changing the size of the feature map. The second 3*3 convolution in the C2f module is replaced by DCNv4_Net to obtain DCNv4-YOLOv4; 3.2) Input the training set images in step 2) into the SDE_YOLOv8 network model. Each image first undergoes the default first few layers of feature transformation in the SDE_YOLOv8 network model, and then is passed to the C2f module in YOLOv8. The module is embedded in the DCNv4_Net structure. The features are passed through a layer of 1*1 convolution kernel in the C2f module, and a layer of Split feature segmentation layer divides the features into two according to the number of channels. One part is passed to the DCNv4_Net structure and waits for feature splicing C2f. oncat, and the other part is passed to the DCNv4_Net structure, in which the features pass through a 3*3 convolution layer and a DCNv4 convolution layer. The DCNv4 convolution layer is a separable convolution composed of a 3*3 convolution and a linear projection, which separates the original convolution weight wk into a depth part and a point-by-point part. The depth part is the original position-aware modulation scalar mk, and the point-by-point part is the projection weight w shared between the sampling points. The features pass through this separable convolution to obtain the horizontal and vertical coordinate offsets of the sampling points and the offset adjustment scale: Where: G is the number of aggregation groups; for the g-th group, wg∈RC×C', C'=C / G is the projection weight at different positions; K is the number of sampling points; mgk∈R is the modulation factor of the k-th sampling point, and unlike DCNv3, DCNv4 cancels the final softmax normalization, reducing unnecessary calculations and speeding up the model calculation speed; 3.3) Perform a BatchNorm2d normalization operation on the feature output including offset and scale obtained by DCNv4_Net: Where: x is the input eigenvalue, E[x] represents the mean, Var[x] represents the variance. These two parameters can be directly calculated in the forward propagation. γ and β are the adjusted variance and adjusted mean, with initial values ​​of 1 and 0 respectively. These two parameters are continuously updated and learned by the model in the back propagation formula. eps is to ensure the stability of the calculation and avoid the situation where the denominator is 0. The default value is 1e-5. 3.4) Use the Relu function to perform an intensification operation on the output result, output the input values ​​greater than 0 completely, and assign the input values ​​less than 0 to 0.

4. The method for detecting broken strands of high-voltage wires based on SDE_YOLOv8 according to claim 1, characterized in that: The specific steps of using the EMA attention mechanism described in step 4) are as follows: 4.1) The feature output obtained after the Backbone part of SDE_YOLOv8 is passed into the EMA attention mechanism. Assuming that the size of the feature map is H×W×C, feature extraction will make the model pay more attention to the output of the feature position. The features will be divided into g groups in the input EMA attention mechanism. One branch will go through the one-dimensional horizontal global pooling operation of "X Avg Pool", and one branch will be input into the one-dimensional vertical global pooling operation of "Y Avg Pool"; one branch will extract features through 3×3 convolution, and the rest will be used as a cross-dimensional interaction module to be merged; 4.2) The two global pooling outputs obtained in 4.1) are subjected to sigmoid function and weighted multiplication with the cross-dimensional module to realize the interaction between feature maps. Then, a layer of GN is used to perform group normalization on the interactive feature maps to adjust the feature distribution within each group. The obtained outputs are used as two inputs, one of which is input into the Sofmax function to obtain the output out_1, and the other is input into the avg global pooling to obtain the output out_2; 4.3) The 3×3 convolution output obtained in 4.1) is also used as two inputs, one is input to the Sofmax function to obtain the output out_3, and the other is input to the avg global pooling to obtain the output out_4; 4.4) Perform matrix multiplication on the output out_1 obtained in 4.2) and the output out_4 obtained in 4.3), and matrix multiplication on out_2 and out_3. Finally, combine these two outputs and perform weighted multiplication and Sigmoid activation function on the cross-dimensional module in 4.1) to obtain the final output. The size of the output feature map is consistent with the size of the input, which is H×W×C.

5. The method for detecting broken strands of high-voltage wires based on SDE_YOLOv8 according to claim 1, characterized in that: The specific steps of using the Shape-IOU loss function described in step 5) are as follows: Replace the loss function in YOLOv8 with the Shape-IOU loss function. The loss function formula is as follows: LShape-IoU = 1-IoU + distance shape + 0.5 × Ωshape In the formula, IOU represents the ratio of the intersection and union of the predicted box area and the true box area, distance shape and Ωshape are the penalty terms of the predicted box regression on the shape and size of the box, and the formulas are as follows: Where: B represents the area of ​​the prediction box, Bgt represents the area of ​​the real target box; Where scale is the scaling factor, which is related to the size of the target in the dataset, ww and hh represent the weight coefficients in the horizontal and vertical directions respectively, whose values ​​are related to the shape of the real box, and c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the real box; By replacing the Shape-IOU loss function, the model focuses on the shape and scale of the bounding box during learning, thereby improving detection accuracy and convergence speed.

6. The method for detecting broken strands of high-voltage wires based on SDE_YOLOv8 according to claim 1, characterized in that: The result prediction described in step 6) is as follows: 6.1) Match the weights learned in step 5) with the validation set images in step 2) and predict the features of the images using the Anchor-Free method. In Anchor-Free, the input image is divided into a grid of a fixed size, and each grid unit replicates the detection of the target contained within it. Each grid unit is represented by the center point coordinates (x, y); 6.2) Bounding box prediction: by performing convolution operations on the feature maps extracted by the YOLOv8 backbone network, for each grid unit, the offset value (tx, ty, tw, th) of each bounding box is calculated through the convolution layer. The offset value is relative to the center coordinates (x, y) of the current network unit and the width and height of the bounding box; 6.3) Object category detection: Object category detection is also achieved by performing convolution operations on the feature maps extracted by the backbone network. For each grid unit, the probability of each bounding box corresponding to each object category is calculated through the convolution layer, and the softmax function is used to convert these probability values ​​into probability distribution; 6.4) In the predicted bounding box, there may be multiple duplicate boxes. In order to remove redundant detection results, the non-maximum NMS algorithm is usually used to sort all bounding boxes according to the confidence level. Then, starting from the box with the highest confidence level, the boxes whose overlap with the box is higher than the set threshold are gradually removed until a predicted box is retained. This predicted box is the predicted result of the high-voltage wire broken strand detection.