A transmission line fault detection method based on super-resolution preprocessing and improved YOLOv5x
By combining super-segment preprocessing and improving the YOLOv5x model in transmission line fault detection, the problem of insufficient detection accuracy of complex environments and small targets is solved, and high-precision and high-real-time fault detection are achieved, which significantly improves the power safety of transmission line.
Patent Information
- Application Number
- CN202210284065.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-22
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-03-22
AI Technical Summary
The prior art has insufficient identification accuracy in complex environments and small object detection, resulting in failure of transmission line location and potential power safety hazards.
The detection method based on super-segment preprocessing and improved YOLOv5x is adopted, and the image super-resolution reconstruction is carried out through USRNet, and the YOLOv5x model structure and border loss function are adjusted to improve the detection accuracy and real-time performance of complex environments and small targets.
It realizes more accurate detection of insulators and fault targets in transmission line images, improves the recognition effect of complex environments and small targets, and speeds up the convergence speed and overall performance of the detection model.
Smart Images

Figure CN114743084B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power transmission lines, and in particular to a method for detecting power transmission line insulators and faults thereof based on super-resolution preprocessing and improved YOLOv5x. Background Art
[0002] Insulators are important components that provide electrical insulation and mechanical support for power transmission and distribution lines. They are exposed to harsh outdoor environmental conditions for a long time, facing various challenges such as temperature and humidity, lightning, strong electric fields, dirt, and natural disasters. When there are impurities or defects inside the insulator, it is affected by external pressure, and the internal and external forces are unbalanced, causing the insulator ring to burst, that is, the insulator self-explosion phenomenon. At this time, the insulator will lose its original function, causing the function of the power transmission and distribution line to be damaged. In severe cases, it may even cause large-scale power outages in the region, affecting the normal operation of enterprises and the normal life of urban and rural residents.
[0003] Super-resolution technology refers to the process of upgrading the original low-resolution image to a high-resolution image through a certain method, so that the original image can obtain more detailed information and more delicate image quality. The solution to the super-resolution problem involves many basic problems in the fields of image processing, computer vision, optimization theory, etc., such as image registration, image segmentation, image compression, image feature extraction, image quality evaluation, machine learning, optimization algorithms, etc. Super-resolution is a specific application field of these basic problems, and it also promotes their research progress. Therefore, the research on the super-resolution problem itself has important theoretical significance. At present, the super-resolution problem has become one of the hot spots in related research fields.
[0004] The main task of target detection is to locate the target of interest from the input image, then accurately determine the category of each target of interest and mark it with a rectangular frame. At present, target detection technology has been widely used in daily life safety, robot navigation, intelligent video surveillance, traffic scene detection, power transmission line scene detection, aerospace and other fields, and has achieved many important achievements. At the same time, target detection also faces many problems and challenges, such as target recognition in complex environments, small target recognition, strict requirements for system real-time and stability, and detection of appearance features of various shapes.
[0005] In terms of eliminating complex background interference, although the image preprocessing methods in existing research can improve image quality and enhance detection accuracy, they often increase the amount of detection model calculations and reduce the target detection speed; in terms of small target detection, although current research has achieved certain results, it has not been able to solve the problem of small target information loss during the downsampling process, which often leads to fault location failure in transmission line detection, causing potential safety hazards to power supply. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a detection method for insulators and their fault targets in the transmission line UAV power inspection scenario. The present invention detects transmission line insulators and their fault targets by combining USRNet with improved YOLOv5x, which can not only improve the detection accuracy of complex environment targets and small targets, but also has good real-time performance.
[0007] To solve the above technical problems, the technical solution adopted by the present invention is: To solve the above technical problems, the technical solution adopted by the present invention is: a transmission line fault detection method based on super-resolution preprocessing and improved YOLOv5x, comprising the following steps:
[0008] 1. After obtaining and expanding the transmission line inspection image data, randomly divide it into training set, validation set and test set according to the proportion, and mark the insulators and their fault targets in the training set and validation set;
[0009] 2. Clustering the marked frames obtained in step 1 to generate anchor frames suitable for detecting insulators and their fault targets;
[0010] 3. Perform super-resolution reconstruction on the test set images;
[0011] Fourth, modify some structures of the YOLOv5x model to enhance the model's ability to detect small targets and adjust the bounding box loss function;
[0012] 5. Train the improved YOLOv5x model in step 4, input the super-resolution test set images obtained in step 3 into the trained improved YOLOv5x model for target detection, identify the insulators and their fault targets in the image, and evaluate the results.
[0013] Preferably, the real transmission line image dataset in step one comes from a state grid company, which includes 2000 normal insulator images and 400 defective insulator images.
[0014] Since the difference between the number of defective insulator images and the number of normal insulators is too large, the imbalance of positive and negative samples will affect the model convergence speed and the final recognition accuracy. Therefore, the faulty insulator images are expanded by mirroring and rotating. Finally, 1,600 faulty insulator images are obtained, and a total of 3,600 normal insulator images are used for training and verification of the target detection algorithm.
[0015] The rotation methods are clockwise rotation of 90 degrees and counterclockwise rotation of 90 degrees. The ratio of the number of training sets, validation sets and test sets is 8:1:1, and the division method is random division. After the division is completed, the labelimg tool is used to mark the insulators and their fault targets in the training set and the test set with rectangular boxes.
[0016] Preferably, the clustering method in step 1 is K-means++, and the number of cluster centers is 12;
[0017] The target marker box obtained in step 1 is clustered by the K-means++ clustering algorithm to obtain the anchor box size suitable for transmission line insulators and their faults. The specific steps are as follows:
[0018] 1) Randomly select a sample target box as the initial cluster center, and calculate the minimum IOU distance A(x) between the remaining sample boxes and the current cluster center:
[0019] ;
[0020] Among them, IOU represents the intersection-over-union ratio between two rectangular boxes, x is the sub-target labeled sample box, and c represents the center of the cluster;
[0021] 2) Calculate the probability O(x) of each insulator sample box being selected as the next cluster center, and use the roulette wheel method to select the next cluster center.
[0022] ;
[0023] Among them, X is the total sample of the target label box,
[0024] 3) Repeat steps 1) and 2) until K cluster centers are selected;
[0025] 4) Calculate the distance from each sample x in the data set to the K cluster centers, and divide the sample into the class corresponding to the cluster center with the smallest distance, recalculate the cluster center of each category cl, and repeatedly update the classification and cluster center until the anchor box size remains unchanged.
[0026] ;
[0027] Where l=1,…,K, K is the number of anchor boxes of different sizes, and its value is determined by the number of anchor boxes of the detection model. Since the detection model in this paper contains 4 detection feature maps, each feature map corresponds to three anchor boxes, so K=12.
[0028] Preferably, the super-resolution reconstruction technology used in step 3 is USRNet;
[0029] The USRNet model is divided into two parts. The first part uses the formula modeling method to model the common problems of super-resolution, and the second part uses a neural network method to iteratively solve the common problems of super-resolution that have been modeled.
[0030] The specific steps of formula modeling are as follows:
[0031] In the framework of maximum a posteriori probability inference, the optimization goal of super-resolution problems can be described by the following formula:
[0032] ;
[0033] Where x is the HR image, y is the LR image, g is the blur kernel, and s is the bicubic downsampling factor. That is, the error between the HR image and the corresponding original LR image after being blurred by the blur kernel g and bicubic downsampling by s times needs to be minimized. After considering an additional prior knowledge of noise intensity, we get:
[0034] ;
[0035] Among them, the first item is the data item, and the second item is the prior item. is the noise intensity, To control the hyperparameter of noise intensity, is the noise level. In order to minimize the error E(x), USRNet uses a semi-quadratic splitting algorithm to introduce an auxiliary variable z, which is equivalent to:
[0036] ;
[0037] in To control the penalty parameter of the gap between x and z. In order to make the model match any noise and downsampling, the data term and the prior term are decoupled:
[0038] ;
[0039] ;
[0040] At this point, the optimization objectives x and z can be solved iteratively, and the solution process requires the use of the idea of neural networks.
[0041] like Figure 2 The neural network structure in is mainly divided into three parts: module D, module P, and module H. Modules D and P use the hyperparameters generated by module H and other related parameters to optimize z and k through iterative calculation to clarify the HR image.
[0042] The first part, the data module (Data module D), is used to solve z k, which uses pytorch to implement the fast Fourier transform and its complex conjugate transform, introducing hyperparameters Minimize z k :
[0043] ;
[0044] in, ;
[0045] ;
[0046] The solution process can be simplified as:
[0047] ;
[0048] in, Obtained by nearest neighbor interpolation from y.
[0049] The second part of the prior module (Prior module P) uses U-Net with a residual term to reduce the noise of the original image to solve the formula x k , the noise level is:
[0050] ;
[0051] The noise reduction process can be simplified as:
[0052] ;
[0053] The third part, the hyper-parameter module (Hyper-parameter module H), is used to calculate the α required for each iteration. k , β k :
[0054] ;
[0055] The module consists of three fully connected layers, each with 64 hidden nodes. The activation function of the first two layers is ReLU, and the last layer is Softplus.
[0056] The loss function used for end-to-end training of the overall model is L1_Loss.
[0057] Preferably, the Neck structure modification is specifically as follows:
[0058] After the 80×80 feature layer, we continue to add convolutional layers and upsampling, and then fuse the 2x upsampling feature layer with the 160×160 feature layer to obtain a detection feature map of size 160×160 for detecting small targets.
[0059] Preferably, the border loss function in step 4 is adjusted from CIOU_LOSS to EIOU_LOSS.
[0060] The loss function of YOLOv5x consists of three parts: category loss function BECLogits, confidence loss function BCEclsloss, and border loss function CIOU_Loss:
[0061] ;
[0062] Where IOU represents the intersection-over-union ratio between the real box and the predicted box. The distance between the two frames is the aspect ratio:
[0063] ;
[0064] is a weight coefficient:
[0065] ;
[0066] CIOU_Loss considers the overlapping area, center point distance and aspect ratio of bounding box regression, but ignores the real difference between width and height and their confidence, which hinders the effectiveness of model optimization.
[0067] In order to compensate for the problem of slower model training convergence caused by the increase in structure and improve the overall performance of the model, EIOU_Loss is replaced with a new border loss function. The penalty term of EIOU_loss includes three parts: overlap loss, center distance loss, and width and height loss. The formula is as follows:
[0068] ;
[0069] The first two continue the method in CIOU_Loss. In order to make the convergence speed faster, the width and height loss directly sets the optimization target to the minimum difference between the width and height of the real box and the predicted box. and C h It is the width and height of the minimum bounding box covering the true box and the predicted box.
[0070] Preferably, the model training and evaluation indicators in step 5 are specifically:
[0071] During model training, the image input scale was 640×640, the batch training data size was 64, the training momentum was 0.8, the initial learning rate was set to 0.001, the weight decay was 0.0005, the training process lasted for 300 batches, and stochastic gradient descent was used as the optimization function to train the model.
[0072] The target detection performance is mainly verified through indicators such as precision (P), recall (R), mean average precision (mAP) and frames per second (FPS).
[0073] The mean average precision mAP is obtained by the average precision (AP), and the formula is as follows:
[0074] ;
[0075] ;
[0076] ;
[0077] ;
[0078] Among them, TP (true positive) is the number of positive samples accurately identified, FP (false positive) is the number of negative samples accurately identified, FN (false negative) is the number of unidentified positive samples, precision P is the probability that a sample is actually a positive sample when it is predicted to be a positive sample, recall R is the probability that a sample is predicted to be a positive sample when it is actually a positive sample, and h is the number of categories set by the model. In this article, h=2, corresponding to insulators and insulator fault locations.
[0079] Compared with the prior art, the beneficial effects of the present invention include:
[0080] The present invention provides a transmission line fault detection method based on super-resolution preprocessing and improved YOLOv5x, which can accurately detect insulators and their fault targets in transmission line images, and the recognition effects of complex environment targets and small targets are improved, and at the same time, it has good real-time performance. Compared with the original border loss function CIOU_Loss, the EIOU_Loss adopted in this paper can accelerate the convergence speed of the detection model, and can improve the model performance to a certain extent, and reduce the difference between the predicted frame and the real frame; on the basis of the original detection model, the detection head added for the small target of the transmission line fault contains a larger detection feature map, which can make full use of the small target information in the shallow feature map and improve the small target detection accuracy; USRNet is used to super-reconstruct the transmission line image with low quality and complex background, which can effectively enhance the contour features of the target to be detected to distinguish it from the complex background, making it easier to be detected by the detection model. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0082] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0083] Figure 1 It is a schematic diagram of a method for detecting insulator faults and targets of transmission lines according to the present invention;
[0084] Figure 2 This is a structural diagram of the image super-resolution reconstruction technology USRNet used in an embodiment of the present invention;
[0085] Figure 3 It is a structural diagram of the improved YOLOv5x algorithm used in the embodiment of the present invention;
[0086] Figure 4a Comparison of loss value curves of different models in specific embodiment 1 of the present invention;
[0087] Figure 4b Comparison of mean average accuracy curves of different models in specific embodiment 1 of the present invention;
[0088] Figure 5a The test results of experimental method 1 in specific embodiment 2 of the present invention are as follows;
[0089] Figure 5b The test results of Experimental Method 2 in Specific Example 2 of the present invention are as follows;
[0090] Figure 5c The test results of Experimental Method 3 in Specific Example 2 of the present invention are as follows;
[0091] Figure 5d This is the detection result of the method in specific embodiment 2 of the present invention. DETAILED DESCRIPTION
[0092] The method of the present invention is as follows Figure 1 As shown, the present invention elaborates on the construction and annotation, preprocessing, and target detection and recognition of a power transmission line image dataset, including the following steps:
[0093] 1. After obtaining and expanding the transmission line inspection image data, randomly divide it into training set, validation set and test set according to the proportion, and mark the insulators and their fault targets in the training set and validation set;
[0094] 2. Clustering the marked frames obtained in step 1 to generate anchor frames suitable for detecting insulators and their fault targets;
[0095] 3. Perform super-resolution reconstruction on the test set images;
[0096] Fourth, modify some structures of the YOLOv5x model to enhance the model's ability to detect small targets and adjust the bounding box loss function;
[0097] 5. Train the improved YOLOv5x model in step 4, input the super-resolution test set image obtained in step 3 into the trained improved YOLOv5x model for target detection, and identify the insulators and their fault targets in the image;
[0098] Preferably, the real transmission line image dataset comes from a state grid company, which includes 2000 normal insulator images and 400 defective insulator images.
[0099] Since the difference between the number of defective insulator images and the number of normal insulators is too large, the imbalance of positive and negative samples will affect the model convergence speed and the final recognition accuracy. Therefore, the faulty insulator images are expanded by mirroring and rotating. Finally, 1,600 faulty insulator images are obtained, together with 3,600 normal insulator images, for training and verification of the target detection algorithm.
[0100] The rotation methods are clockwise rotation of 90 degrees and counterclockwise rotation of 90 degrees. The ratio of the number of training sets, validation sets and test sets is 8:1:1, and the division method is random division. After the division is completed, the labelimg tool is used to mark the insulators and their fault targets in the training set and the test set with rectangular boxes.
[0101] Preferably, the target marking frame obtained in step 1 is clustered by using a K-means++ clustering algorithm to obtain an anchor frame size suitable for the transmission line insulator and its fault target. The specific steps are as follows:
[0102] 1) Randomly select a sample target box as the initial cluster center, and calculate the minimum IOU distance A(x) between the remaining sample boxes and the current cluster center:
[0103]
[0104] Among them, IOU represents the intersection-over-union ratio between two rectangular boxes, x is the sub-target labeled sample box, and c represents the center of the cluster;
[0105] 2) Calculate the probability O(x) of each insulator sample box being selected as the next cluster center, and use the roulette wheel method to select the next cluster center.
[0106] ;
[0107] Among them, X is the total sample of the target label box,
[0108] 3) Repeat steps 1) and 2) until K cluster centers are selected;
[0109] 4) Calculate the distance from each sample x in the data set to the K cluster centers, and divide the sample into the class corresponding to the cluster center with the smallest distance, and recalculate each class c l The cluster center of the anchor box is updated repeatedly until the size of the anchor box remains unchanged.
[0110] ;
[0111] Where l=1,…,K, K is the number of anchor boxes of different sizes, and its value is determined by the number of anchor boxes of the detection model. Since the detection model in this paper contains 4 detection feature maps, each feature map corresponds to three anchor boxes, so K=12.
[0112] As shown in Table 1, the anchor box size obtained by clustering the target marker box is:
[0113] Table 1 Optimized anchor boxes
[0114]
[0115] After anchor frame optimization, the model of 4 detection heads corresponds to all feature maps and anchor frames in Table 1; the model of 3 detection heads corresponds to 80×80, 40×40, and 20×20 feature maps and corresponding anchor frames in Table 1.
[0116] Preferably, USRNet is used to perform super-resolution reconstruction on the test set obtained in step 1. The USRNet model is divided into two parts. The first part uses a formula modeling method to model the common problem of super-resolution, and the second part uses a neural network method to iteratively solve the common problem of super-resolution that has been modeled.
[0117] The specific steps of formula modeling are as follows:
[0118] In the framework of maximum a posteriori probability inference, the optimization goal of super-resolution problems can be described by the following formula:
[0119] ;
[0120] Where x is the HR image, y is the LR image, g is the blur kernel, and s is the bicubic downsampling factor. That is, the error between the HR image and the corresponding original LR image after being blurred by the blur kernel g and bicubic downsampling by s times needs to be minimized. After considering an additional prior knowledge of noise intensity, we get:
[0121] ;
[0122] Among them, the first item is the data item, and the second item is the prior item. is the noise intensity, To control the hyperparameter of noise intensity, is the noise level. In order to minimize the error E(x), USRNet uses a semi-quadratic splitting algorithm to introduce an auxiliary variable z, which is equivalent to:
[0123] ;
[0124] in To control the penalty parameter of the gap between x and z. In order to make the model match any noise and downsampling, the data term and the prior term are decoupled:
[0125] ;
[0126] ;
[0127] At this point, the optimization objectives x and z can be solved iteratively, and the solution process requires the use of the idea of neural networks.
[0128] like Figure 2 The neural network structure in is mainly divided into three parts: module D, module P, and module H. Modules D and P use the hyperparameters generated by module H and other related parameters to optimize z and k through iterative calculation to clarify the HR image.
[0129] The first part, the data module (Data module D), is used to solve z k , which uses pytorch to implement the fast Fourier transform and its complex conjugate transform, introducing hyperparameters Minimize z k :
[0130] ;
[0131] in, ;
[0132] ;
[0133] The solution process can be simplified as:
[0134] ;
[0135] in, Obtained by nearest neighbor interpolation from y.
[0136] The second part of the prior module (Prior module P) uses U-Net with a residual term to reduce the noise of the original image to solve the formula x k , the noise level is:
[0137] ;
[0138] The noise reduction process can be simplified as:
[0139] ;
[0140] The third part, the hyper-parameter module (Hyper-parameter module H), is used to calculate the α required for each iteration. k , β k :
[0141] ;
[0142] The module consists of three fully connected layers, each with 64 hidden nodes. The activation function of the first two layers is ReLU, and the last layer is Softplus.
[0143] The loss function used for end-to-end training of the overall model is L1_Loss.
[0144] Preferably, in order to enhance the sensitivity of YOLOv5x to small targets, the Neck part structure of the YOLOv5x model is changed to add a detection head for detecting small targets and corresponding anchor frames of three sizes, such as Figure 3 The improved YOLOv5x structure diagram is shown as follows:
[0145] The improvement of the present invention changes the number of channels of the convolution kernel in the red frame from 256 to 512, and then changes the number of channels of the concat layer in the red frame from 512 to 1024, so that the original output feature map here is changed from 512*80*80 to 1024*80*80; then, the Bottleneck-CSP layer and the convolution layer are added in sequence so that the output result can be changed to 256*160*160 through the upsampling layer; finally, a feature map to be detected with a size of 160×160 is obtained, which corresponds to the anchor in Table 1 to detect smaller insulator targets.
[0146] Preferably, the border loss function of the original YOLOv5x is replaced.
[0147] like Figure 1 As shown, the loss function of YOLOv5x consists of three parts: category loss function BECLogits, confidence loss function BCEclsloss, and border loss function CIOU_Loss:
[0148] ;
[0149] Where IOU represents the intersection-over-union ratio between the real box and the predicted box. The distance between the two frames is the aspect ratio:
[0150] ;
[0151] is a weight coefficient:
[0152] ;
[0153] CIOU_Loss considers the overlapping area, center point distance and aspect ratio of bounding box regression, but ignores the real difference between width and height and their confidence, which hinders the effectiveness of model optimization.
[0154] In order to compensate for the problem of slower model training convergence caused by the increase in structure and improve the overall performance of the model, EIOU_Loss is replaced with a new border loss function. The penalty term of EIOU_loss includes three parts: overlap loss, center distance loss, and width and height loss. The formula is as follows:
[0155] ;
[0156] The first two continue the method in CIOU_Loss. In order to make the convergence speed faster, the width and height loss directly sets the optimization target to the minimum difference between the width and height of the real box and the predicted box. and C h It is the width and height of the minimum bounding box covering the true box and the predicted box.
[0157] Preferably, the model training and evaluation indicators in step 5 are specifically:
[0158] During model training, the image input scale was 640×640, the batch training data size was 64, the training momentum was 0.8, the initial learning rate was set to 0.001, the weight decay was 0.0005, the training process lasted for 300 batches, and stochastic gradient descent was used as the optimization function to train the model.
[0159] The target detection performance is mainly verified through indicators such as precision (P), recall (R), mean average precision (mAP) and frames per second (FPS).
[0160] The mean average precision mAP is obtained by the average precision (AP), and the formula is as follows:
[0161] ;
[0162] ;
[0163] ;
[0164] ;
[0165] Among them, TP (true positive) is the number of positive samples accurately identified, FP (false positive) is the number of negative samples accurately identified, FN (false negative) is the number of unidentified positive samples, precision P is the probability that a sample is actually a positive sample when it is predicted to be a positive sample, recall R is the probability that a sample is predicted to be a positive sample when it is actually a positive sample, and h is the number of categories set by the model. In this article, h=2, corresponding to insulators and insulator fault locations. Specific embodiment 1
[0167] In this specific embodiment, a total of three models are trained, namely model a, model b, and the model of this paper, as shown in Table 2:
[0168] Table 2 Parameter settings of each model
[0169] Loss Function Number of detection heads Model a CIOU_Loss 3 Model b EIOU_Loss 3 This article model EIOU_Loss 4
[0170] Among them, model a is the original YOLOv5x model, and the test sets used by all models in Table 2 have been super-resolved. The loss value curves of each model are shown in Figure 4 (a). After 250 iterations, they are basically stable at around 1%, and the training results can all converge. The horizontal axis is the number of training times, and the vertical axis is the loss value during training.
[0171] Compared with model a, although model b has a larger initial loss value because EIOU_Loss separates the width and height losses into separate calculations, model b shows a better decrease rate and convergence ability than model a after about 25 iterations; this verifies that EIOU_Loss is beneficial to speed up the decrease rate of the detection model loss and shorten its convergence time.
[0172] The convergence speed of the proposed model is slightly slower than that of model B due to the addition of the network structure. After 70 iterations, its loss value is 2.12%, which is significantly lower than that of models A and B. This is because the small target detection head added to the proposed model improves the accuracy of small target detection. The proposed model finally converged and stabilized at 0.72%, and the final loss value was significantly reduced, proving that the improved model with loss function adjustment and detection head addition can achieve better training and detection effects.
[0173] Table 3 shows the detection results of each model in the super-resolution test set.
[0174] Table 3 Comparison of evaluation indicators of different models
[0175]
[0176] As shown in Table 3, the proposed model has the highest detection accuracy in the detection of transmission line faults, with an accuracy of 95.4%, a recall of 97.2%, and a mAP of 98.8%, which can accurately detect fault targets. Compared with model b, the improvement of the model structure by adding a detection head significantly improves the detection accuracy, but it sacrifices part of the inference speed, resulting in a decrease in the number of images detected per second by the model. The comparison curve of the mean average precision of different models when the intersection-over-union ratio is 0.5 is shown in Figure 4(b). It can be seen that as the number of iterations increases during the training process, the mAP values of the three models rise to about 80% after 70, 30, and 45 iterations, respectively, and finally rise to about 98%. The convergence ability of model b and the proposed model after the loss function adjustment has been significantly improved. Specific embodiment 2
[0178] This specific embodiment designs 4 different insulator and fault detection experiments for comparative analysis. Four groups of experimental methods are set up by combining different test sets with different models to conduct comparative analysis of the results of complex background targets and small targets. The experimental method parameters are set as shown in Table 4.
[0179] 4 Parameter settings for each experimental method
[0180] Experimental group number Model No. Test Set Experimental Group 1 Model a original Experimental Group 2 This article model original Experimental Group 3 Model a Super Resolution Methods This article model Super Resolution
[0181] The evaluation indicators of the four experimental methods are shown in Table 5. The comparison between experimental methods 1 and 2 and experimental method 3 and the method in this paper shows that after the image is processed by super-resolution reconstruction, the evaluation indicators of various detection results are improved; the results of the detection under the original and super-resolution test sets respectively show that the experimental method using the improved model in this paper has better results in various evaluation indicators. The method in this paper achieves a fault detection accuracy of 95.4% and a mAP value of 98.8%, which are higher than the other three methods, and has obvious advantages in improving the performance of transmission line fault detection.
[0182] Table 5 Comparison results of different insulators and their fault detection methods
[0183] Experimental group number 1 2 3 Precision(%) 92.6 93.5 95.4 Recall(%) 93.5 95.6 97.2 mAP (%) @ 0.5 96.1 97.5 98.8
[0184] The detection results of the four experimental methods are shown in Figure 5. The missed targets in Figure 5(a) correspond to Figure 1 There are small fault targets A and B, a blurred target C, and an obscured target D. The detection frame of the insulator where target B is located fails to cover it well.
[0185] Using the experimental method 2 after the improved model in this paper, as shown in Figure 5(b), the fault small target A is detected, and due to the replacement of the loss function, although target B is missed, the detection frame of the insulator where it is located is closer to the real frame than that of experimental method 1. Therefore, adding a small target detection head can effectively improve the accuracy of the model in detecting small targets, but targets B, C, and D are not detected, indicating that the complex background still interferes with the detection.
[0186] Experimental method 3 using the super-resolution test set, as shown in Figure 5(b), both the blurred target C and the occluded target D are detected, but the small target faults A and B are still missed. This proves that the image super-resolution processing can effectively eliminate the interference of complex background, but it cannot improve the detection effect of small targets.
[0187] The proposed method using the improved model and super-resolution dataset at the same time, as shown in Figure 5(d), targets A, B, C, and D are all detected. Therefore, adding a small target detection head to the original model improves the accuracy of small target detection; at the same time, using USRNet to improve the image quality effectively eliminates the interference of complex backgrounds and improves the accuracy of target detection under complex backgrounds.
[0188] The above embodiments are only preferred technical solutions of the present invention and should not be regarded as limiting the present invention. The protection scope of the present invention shall be the technical solutions recorded in the claims, including equivalent replacement solutions of the technical features in the technical solutions recorded in the claims. That is, equivalent replacement improvements within this scope are also within the protection scope of the present invention.
Claims
1. A transmission line fault detection method based on super-resolution preprocessing and improved YOLOv5x, characterized in that: The specific steps are:
1. After obtaining and expanding the transmission line inspection image data, randomly divide it into training set, validation set and test set, and mark the insulators and their fault targets in the training set and validation set; 2. Clustering the marked frames obtained in step 1 to generate anchor frames suitable for detecting insulators and their fault targets; 3. Perform super-resolution reconstruction on the test set images; Fourth, modify some structures of the YOLOv5x model to enhance the model's ability to detect small targets and adjust the bounding box loss function; 5. Train the improved YOLOv5x model in step 4, input the super-resolution test set images obtained in step 3 into the trained improved YOLOv5x model for target detection, identify the insulators and their fault targets in the image, and evaluate the results; The Neck structure of the YOLOv5x model is modified as follows: After the 80×80 feature layer, we continue to add convolutional layers and upsampling, and then fuse the 2x upsampling feature layer with the 160×160 feature layer to obtain a detection feature map of size 160×160 for detecting small targets. In step 4, the border loss function is adjusted from CIOU_LOSS to EIOU_LOSS. The loss function of YOLOv5x consists of three parts: category loss function BECLogits, confidence loss function BCEclsloss, and border loss function CIOU_Loss: ; Where IOU represents the intersection-over-union ratio between the real box and the predicted box. The distance between the two frames is the aspect ratio: ; is a weight coefficient: ; CIOU_Loss considers the overlapping area, center point distance and aspect ratio of bounding box regression, but ignores the real difference between width and height and their confidence, which hinders the effectiveness of model optimization; In order to compensate for the problem of slower model training convergence caused by the increase in structure and improve the overall performance of the model, EIOU_Loss is replaced with a new border loss function. The penalty term of EIOU_loss includes three parts: overlap loss, center distance loss, and width and height loss. The formula is as follows: ; The first two continue the method in CIOU_Loss. In order to make the convergence speed faster, the width and height loss directly sets the optimization target to the minimum difference between the width and height of the real box and the predicted box. and C h It is the width and height of the minimum bounding box covering the true box and the predicted box.
2. According to claim 1, a transmission line fault detection method based on super-resolution preprocessing and improved YOLOv5x is characterized in that: The sample expansion of the faulty insulator image in step 1 is performed by using a mirror image and a rotation method, and finally a faulty insulator image is obtained, which is used together with a normal insulator image as training and verification of the target detection algorithm; The rotation methods are clockwise rotation of 90 degrees and counterclockwise rotation of 90 degrees. The ratio of the number of training sets, validation sets and test sets is 8:1:1, and the division method is random division. After the division is completed, the labelimg tool is used to mark the insulators and their fault targets in the training set and the test set with rectangular boxes.
3. According to claim 1, a transmission line fault detection method based on super-resolution preprocessing and improved YOLOv5x is characterized in that: The clustering method in step 2 is K-means++, and the number of cluster centers is 12; The target marker box obtained in step 1 is clustered by the K-means++ clustering algorithm to obtain the anchor box size suitable for the transmission line insulator and its fault target. The specific steps are as follows: 1) Randomly select a sample target box as the initial cluster center, and calculate the minimum IOU distance A(x) between the remaining sample boxes and the current cluster center: ; Among them, IOU represents the intersection-over-union ratio between two rectangular boxes, x is the sub-target labeled sample box, and c represents the center of the cluster; 2) Calculate the probability O(x) of each insulator sample box being selected as the next cluster center, and use the roulette wheel method to select the next cluster center; ; Among them, X is the total sample of the target label box, 3) Repeat steps 1) and 2) until K cluster centers are selected; 4) Calculate the distance from each sample x in the data set to the K cluster centers, and divide the sample into the class corresponding to the cluster center with the smallest distance, and recalculate each class c l The cluster center of the anchor box is updated repeatedly until the size of the anchor box remains unchanged; ; Among them, l=1,…,K, K is the number of anchor boxes of different sizes, and its value is determined by the number of anchor boxes of the detection model.
4. According to claim 1, a transmission line fault detection method based on super-resolution preprocessing and improved YOLOv5x is characterized in that: The super-resolution reconstruction technology used in step 3 is USRNet; The USRNet model is divided into two parts. The first part uses the formula modeling method to model the common problem of super-resolution, and the second part uses the neural network method to iteratively solve the common problem of super-resolution that has been modeled. The specific steps of formula modeling are as follows: In the framework of maximum a posteriori probability inference, the optimization goal of super-resolution problems can be described by the following formula: ; Where x is the HR image, y is the LR image, g is the blur kernel, and s is the bicubic downsampling factor. That is, the error between the HR image and the corresponding original LR image after being blurred by the blur kernel g and bicubic downsampling by s times needs to be minimized. After considering an additional prior knowledge of noise intensity, we get: ; Among them, the first item is the data item, and the second item is the prior item. is the noise intensity, To control the hyperparameter of noise intensity, is the noise level; in order to minimize the error E(x), USRNet uses a semi-quadratic splitting algorithm to introduce an auxiliary variable z, which is equivalent to: ; in To control the penalty parameter of the gap between x and z; in order to make the model match arbitrary noise and downsampling, the data term and the prior term are decoupled: ; ; So far, the optimization objectives of x and z are solved iteratively, and the idea of neural network is used in the solution process; The neural network structure is divided into three parts: module D, module P, and module H. Modules D and P use the hyperparameters generated by module H and other related parameters to optimize z and k through iterative calculation to clarify the HR image; The first part of the data module is used to solve z k , which uses pytorch to implement the fast Fourier transform and its complex conjugate transform, introducing hyperparameters Minimize z k : ; in, ; ; The solution process can be simplified as: ; in, Obtained by y through nearest neighbor interpolation; The second part of the prior module uses U-Net with a residual term to denoise the original image to solve the equation x k , the noise level is: ; The noise reduction process can be simplified as: ; The third part of the hyperparameter module is used to calculate the α required for each iteration k , β k : ; The module consists of three fully connected layers, each with 64 hidden nodes. The activation function of the first two layers is ReLU, and the last layer is Softplus. The loss function used for end-to-end training of the overall model is L1_Loss.
5. The method for detecting power line faults based on super-resolution preprocessing and improved YOLOv5x according to claim 1, characterized in that: The specific model training and evaluation indicators in step 5 are: The target detection performance is verified through the accuracy P, recall R, mean average precision mAP and frames per second FPS indicators. The mean average precision mAP is obtained by the average precision AP, and the formula is as follows: ; ; ; ; Among them, TP is the number of accurately identified positive samples, FP is the number of accurately identified negative samples, FN is the number of unidentified positive samples, precision P is the probability that a sample is actually a positive sample when it is predicted to be a positive sample, recall R is the probability that a sample is predicted to be a positive sample when it is actually a positive sample, h is the number of categories set by the model, h=2, corresponding to insulators and insulator fault locations; During model training, the image input scale was 640×640, the batch training data size was 64, the training momentum was 0.8, the initial learning rate was set to 0.001, the weight decay was 0.0005, the training process lasted for 300 batches, and stochastic gradient descent was used as the optimization function to train the model.
