Power distribution network fault detection method and device

The genetic algorithm is used to optimize the hyperparameters and frozen layers of the pre-training model, which improves the accuracy of fault detection in the distribution network, solves the problem of misjudgment of the convolutional neural network under background and sunlight changes, and ensures the stability of the power grid.

CN118587528APending Publication Date: 2024-09-03GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410689478.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

In the existing distribution network fault detection technology, the convolutional neural network (CNN) is affected by factors such as image background and sunlight changes, resulting in low fault detection accuracy, and non-faulty objects may be misjudged as faults.

Method used

Genetic algorithms are used to optimize the hyperparameters of the pre-trained model, and the most suitable number of frozen layers is determined by freezing the network layers to improve the accuracy and reliability of the fault detection model.

Benefits of technology

It improves the accuracy and reliability of distribution network fault detection, reduces the misjudgment rate, prevents power accidents caused by insulator failures, and ensures stable operation of the power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587528A
    Figure CN118587528A
Patent Text Reader

Abstract

The invention relates to a power distribution network fault detection method and device. The method comprises the following steps: performing hyper-parameter optimization on each pre-training model by adopting a genetic algorithm, performing first-stage evaluation by utilizing a training data set, and determining a candidate model which is more suitable for performing power distribution network fault detection based on a result of the first-stage evaluation, and respectively freezing corresponding network layers in the candidate model based on different preset freezing layer numbers, respectively performing second-stage evaluation according to the training data set, determining a target freezing layer number based on a result of the second-stage evaluation, obtaining a fault detection model, and detecting the to-be-detected image data according to the fault detection model. Generating a detection result; by adopting the method, hyper-parameter optimization can be carried out by adopting the genetic algorithm, the number of target frozen layers can be determined, the candidate model which is more suitable for power distribution network fault detection can be selected, and the most suitable number of target frozen layers can be determined, so that the accuracy and reliability of power distribution network fault detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart grid technology, and in particular to a distribution network fault detection method and device. Background Art

[0002] The safe and stable operation of insulators is of great significance to the stability and reliability of the power grid. Insulator failures are mainly caused by surface contamination, foreign objects close to the insulators (such as bird nests), cracks and fissures, etc. Surface contamination will increase the surface conductivity, thus leading to failures and power outages.

[0003] With the development of intelligent power grids, remote control systems help to conduct fault analysis in places that are difficult for operation and maintenance personnel to reach, reducing the time required for fault recovery during power outages. In traditional technologies, convolutional neural networks (CNNs) are often used for fault detection. However, in some scenarios, classification may be performed based on the background of the image, clarity differences caused by changes in sunlight, and objects that have not been evaluated, resulting in non-faulty objects being regarded as faults, resulting in a low accuracy rate. Summary of the invention

[0004] Based on this, it is necessary to provide a distribution network fault detection method and device that can improve the accuracy of fault detection in response to the above technical problems.

[0005] In a first aspect, the present application provides a distribution network fault detection method, the method comprising:

[0006] Acquire image data to be detected and a training data set, wherein the training data set includes image data of power devices in the distribution network in a normal state and image data of power devices in the distribution network in a fault state;

[0007] Genetic algorithms are used to optimize the hyperparameters of each pre-trained model, and the first-stage evaluation is performed using the training data set. Based on the results of the first-stage evaluation, candidate models are determined; the pre-trained models include the YOLO model;

[0008] Based on different preset freezing layers, the corresponding network layers in the candidate models are frozen respectively, and the second stage evaluation is performed according to the training data set respectively. Based on the results of the second stage evaluation, the target freezing layers are determined, and the candidate model corresponding to the target freezing layers is used as the fault detection model;

[0009] The image data to be detected is detected according to the fault detection model to generate a detection result.

[0010] In one embodiment, a genetic algorithm is used to optimize hyperparameters of each pre-trained model, including:

[0011] Create an initial population for any pre-trained model, where each individual in the initial population represents a hyperparameter combination;

[0012] Evaluate the individuals in the population based on the preset performance indicators and obtain the fitness values ​​corresponding to the individuals in each population;

[0013] A preset number of individuals of the population are selected as parent individuals according to the fitness value, a first value is randomly generated, a crossover operation is performed on the parent individuals according to the first value to generate a crossover offspring; a second value is randomly generated, a mutation operation is performed on the parent individuals according to the second value to generate a mutant offspring;

[0014] The parent individuals, crossover offspring and mutant offspring are combined into a new population, the number of iterations is increased by 1, and the performance indicators are re-evaluated until the stopping condition is reached;

[0015] When the stopping condition is met, the population individual corresponding to the highest fitness value in the new population is used as the target hyperparameter combination of any pre-trained model.

[0016] In one embodiment, the stopping condition includes the number of iterations reaching a preset number.

[0017] In one embodiment, the first stage evaluation is performed using the training data set, and the candidate model is determined based on the result of the first stage evaluation, including:

[0018] Input the training data set into any pre-trained model that has completed hyperparameter optimization to obtain the prediction results;

[0019] A candidate model is determined based on each prediction result.

[0020] In one embodiment, corresponding network layers in the candidate models are frozen based on different preset numbers of frozen layers, and a second-stage evaluation is performed based on the training data set, including:

[0021] Based on the preset number of frozen layers, the corresponding network layers in the candidate model are frozen, and the training dataset is used to perform a second-stage evaluation on the remaining layers in the candidate model.

[0022] In one embodiment, the method further comprises:

[0023] For the image data to be detected, the weight calculation method of Eigen-Cam is used to generate a thermal map, and then the fault detection map is obtained based on the thermal map.

[0024] In a second aspect, the present application also provides a distribution network fault detection device, the device comprising:

[0025] An acquisition module is used to acquire image data to be detected and a training data set, wherein the training data set includes image data of power devices in the distribution network in a normal state and image data of power devices in the distribution network in a fault state;

[0026] The first evaluation module is used to optimize the hyperparameters of each pre-trained model using a genetic algorithm, and use the training data set to perform the first stage evaluation, and determine the candidate model based on the results of the first stage evaluation; the pre-trained model includes the YOLO model;

[0027] The second evaluation module is used to freeze the corresponding network layers in the candidate model based on different preset freezing layers, and perform the second stage evaluation based on the training data set, determine the target freezing layers based on the results of the second stage evaluation, and use the candidate model corresponding to the target freezing layers as the fault detection model

[0028] The detection module is used to detect the image data to be detected according to the fault detection model and generate a detection result.

[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0030] In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when the computer program is executed by a processor.

[0031] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0032] The above-mentioned distribution network fault detection method and device use a genetic algorithm to optimize the hyperparameters of each pre-trained model, and use the training data set to perform the first stage evaluation respectively, determine the candidate model that is more suitable for distribution network fault detection based on the result of the first stage evaluation, freeze the corresponding network layers in the candidate model based on different preset freezing layers, and perform the second stage evaluation based on the training data set respectively, determine the target freezing layer number based on the result of the second stage evaluation, obtain the fault detection model, detect the image data to be detected according to the fault detection model, and generate the detection result; the present application uses a genetic algorithm to optimize the hyperparameters and confirm the target freezing layer number, selects the candidate model that is more suitable for distribution network fault detection, and determines the most appropriate target freezing layer number, so as to improve the accuracy and reliability of distribution network fault detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 A schematic diagram of a flow chart of a method for detecting a power distribution network fault in an embodiment;

[0035] Figure 2 is a schematic diagram of part of image data in a training data set in one embodiment;

[0036] Figure 3 A schematic diagram of the working principle of a YOLO model in one embodiment;

[0037] Figure 4 is a schematic diagram of a target hyperparameter combination in one embodiment;

[0038] Figure 5 A schematic diagram of the results of the first stage evaluation in one embodiment;

[0039] Figure 6 A schematic diagram of the results of the second stage evaluation in one embodiment;

[0040] Figure 7 A schematic diagram of a detection result in one embodiment;

[0041] Figure 8 is a schematic diagram of a fault detection diagram in one embodiment;

[0042] Fig. 9 is a structural block diagram of a distribution network fault detection device in one embodiment;

[0043] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0046] It is understood that terms such as "first" and "second" in this application are only used to distinguish similar objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. The "connection" appearing in the embodiments of this application refers to various connection methods such as direct connection or indirect connection to achieve communication between devices, and the embodiments of this application do not make any limitation on this.

[0047] It will be understood that “at least one” means one or more, and “plurality” means two or more.

[0048] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.

[0049] In recent years, the scale of power grids has continued to expand, and the power supply capacity has continued to increase. With the development of intelligent power grids, remote control systems can help to identify faults in places that are difficult for personnel to reach, reducing the time required for fault recovery during power outages. Due to its ability to identify nonlinear separable models, the use of deep learning to classify adverse environmental conditions (fault detection) is very popular, and convolutional neural networks (CNNs) are good at using kernels to reduce computational evaluation. In traditional technologies, convolutional neural networks (CNNs) are often used for fault detection; however, in some scenarios, classification may be based on the background of the image, the difference in clarity caused by changes in sunlight, and objects that have not been evaluated, resulting in non-fault objects being considered faults, which has a low accuracy rate.

[0050] The you only look once (YOLO) model can complete target recognition in a single step, which is usually better than the faster R-CNN model based on region-based CNN, making it a more effective target detection and classification model.

[0051] The distribution network fault detection method and device provided in the embodiments of the present application use a genetic algorithm to perform hyperparameter optimization and confirm the target number of freezing layers, select a candidate model that is more suitable for distribution network fault detection, and determine the most appropriate target number of freezing layers, so as to improve the accuracy and reliability of distribution network fault detection, prevent power accidents caused by insulator failures, and ensure stable and reliable operation of the power grid.

[0052] In an exemplary embodiment, Figure 1As shown, a distribution network fault detection method is provided, the method comprising:

[0053] S102, obtaining image data to be detected and a training data set, where the training data set includes image data of power devices in the distribution network in a normal state and image data of power devices in the distribution network in a fault state.

[0054] Specifically, the image data to be detected and the image data in the training data set are all taken during the inspection of the distribution network. Take the 240 pictures in the training data set as an example, of which 120 pictures are from power devices in good condition (normal state), and the other 120 pictures are from power devices that need maintenance (fault state) during the inspection. Considering the following situations of power devices that need maintenance: insulators are contaminated or damaged, crossheads or fuse switches are contaminated, and there are foreign objects near the structure (bird nests or firmly attached fungi on the crossheads). The pictures taken during the inspection are high-resolution, and most structures are contaminated and in good condition. Some images in the training data set can be specifically targeted at insulators. In order to record the condition of power devices in more detail, the images are partially enlarged; since pollution increases conductivity, maintenance can be performed when the concentration of pollutants on the grid support structure or insulating components is high, and image data can be obtained.

[0055] Exemplarily, the voltage level of the distribution network may be 13.8 kilovolts, using porcelain post insulators, and porcelain shell and suspension composite insulators.

[0056] It should be noted that Figure 2 The image data in some training data sets are shown as examples, including: insulators in good condition ( Figure 2 A in the above); Power devices in good condition ( Figure 2 B in the figure); insulators that require maintenance ( Figure 2 C in the above); electrical components that require maintenance ( Figure 2 D).

[0057] S104, using a genetic algorithm to optimize the hyperparameters of each pre-trained model, and using the training data set to perform a first-stage evaluation, and determining a candidate model based on the results of the first-stage evaluation; the pre-trained model includes a YOLO model.

[0058] Among them, the pre-trained model may include different variants of the YOLO model, which is not limited in the embodiments of the present application.

[0059] Specifically, a genetic algorithm can be used to optimize the hyperparameters of each pre-trained model to optimize the structure of the pre-trained model, and a training data set can be used to perform a first-stage evaluation on each pre-trained model. According to the results of the first-stage evaluation, a candidate model is determined to improve the detection accuracy and detection time, so as to maximize the distribution network fault detection performance.

[0060] For example, the hyperparameters may include lr0 (initial learning rate), lrf (cyclic learning rate), momentum (learning rate momentum), weight decay (weight decay coefficient), warmup_epochs (warm-up learning), warmup_momentum (warm-up learning momentum), warmup_bias_lr (warm-up initial learning rate), box (target box loss weight), cls (classification loss weight), cls_pw (weight of positive samples in binary cross entropy loss of classification loss), obj (confidence loss weight), obj_pw (weight of positive samples in binary cross entropy loss of confidence loss), iou_t (IoU threshold), anchor_t (aspect ratio of anchor), fl_gamma (weighting of adjustment loss function), hsv_h, hsv_s, hsv_v (enhancement parameters of hue, saturation, and brightness in HSV color space of image), translate, scale, (enhancement parameters of image translation and scaling), mosaic (data enhancement method) and anchors (predefined bounding box size).

[0061] It should be noted that the YOLO model can be built through the following steps: The YOLO model can detect objects in real time. The design of the YOLO model consists of two main parts: CNN for feature extraction and fully connected layer for target detection; CNN consists of multiple convolutional layers and maximum pooling layers to extract information from the input image. The final feature map of CNN is fed into the fully connected layer, which generates a set of bounding boxes and class probabilities. The convolutional layer is the basic component of CNN, which can extract features from the input image using a series of filters.

[0062] The mathematical operation of the convolution layer can be expressed as a convolution operation, as shown in the following formula (1):

[0063]

[0064] Here, f and g are input and filter respectively, and the output is represented by (f*g)(n).

[0065] The object recognition layer uses a multi-task loss function to predict bounding boxes and class probabilities, and is the basic mathematical component of the YOLO model. The loss function of the YOLO model is the sum of the localization loss, classification loss, and confidence loss; the localization loss is the difference between the true bounding box and the predicted bounding box of the grid cell that contains or does not contain the target. The classification loss is the difference between the expected probability and the actual probability of the grid cell containing the object. In form, it is shown in the following formula (2):

[0066]

[0067] Among them, (xi, yi, wi, hi) and The coordinates and sizes are the true bounding box and the predicted bounding box, is an indicator function that is 1 if the object exists in the i,j grid cell and bounding box, and 0 otherwise. is an indicator function that is equal to 1 if there is no object in the i, j grid cell and bounding box, otherwise it is equal to 0; S 2 is the number of grid cells in the feature map. B is the number of bounding boxes per grid cell. pi(c) is the predicted probability of class c in the i,j grid cell and bounding box. is the ground truth probability c,λ in the i,j grid cell and bounding box class coord and λ noobj is a hyperparameter used to control the relative importance of localization loss and classification loss; P(classi|x,y,w,h), P(obj|x,y,w,h), and P(x,y,w,h|obj) are the predicted probabilities of class, objectness, and bounding box, respectively, as shown in Equations (3), (4), and (5):

[0068]

[0069] P(obj|x,y,w,h)=σ(t i,j ) (4);

[0070]

[0071] Where x, y are the center of the bounding box and w, h are the width and height; during training, the loss function compares these predicted probabilities with the ground truth probabilities and adjusts the model parameters accordingly to minimize the loss of the YOLO model.

[0072] The YOLO model uses anchor boxes, which are predefined bounding boxes with different aspect ratios. The final bounding box is determined by comparing the predicted bounding box with these anchor boxes to find the one closest to the true bounding box, which allows the network to detect objects of different sizes and aspect ratios. The anchor box is determined during training. The confidence of the prediction is given by the probability of the category P(classi|object), the probability that the cell contains an object P(obj|x, y, w, h), and the product of the intersection (IoU) between the predicted bounding box and the true bounding box, as shown in the following formula (6):

[0073]

[0074] in, is the IoU between the predicted and actual bounding boxes.

[0075] To facilitate the understanding of those skilled in the art, the working principle of the YOLO model is explained below with a specific example. Figure 3 As shown:

[0076] The YOLO model can divide the original image into S*S non-overlapping small squares, and then generate an S*S feature map through convolution. Each element of the feature map corresponds to a small square in the original image. Each element is then used to predict the targets whose center points are within the small square, and the bounding box, confidence score and category probability map are obtained. The final detection result is obtained by combining the two.

[0077] In one embodiment, a genetic algorithm is used to optimize hyperparameters of each pre-trained model, including:

[0078] Create an initial population for any pre-trained model, where each individual in the initial population represents a hyperparameter combination;

[0079] Evaluate the individuals in the population based on the preset performance indicators and obtain the fitness values ​​corresponding to the individuals in each population;

[0080] A preset number of individuals of the population are selected as parent individuals according to the fitness value, a first value is randomly generated, a crossover operation is performed on the parent individuals according to the first value to generate a crossover offspring; a second value is randomly generated, a mutation operation is performed on the parent individuals according to the second value to generate a mutant offspring;

[0081] The parent individuals, crossover offspring and mutant offspring are combined into a new population, the number of iterations is increased by 1, and the performance indicators are re-evaluated until the stopping condition is reached;

[0082] When the stopping condition is met, the population individual corresponding to the highest fitness value in the new population is used as the target hyperparameter combination of any pre-trained model.

[0083] Among them, the preset number, preset performance indicators and stop conditions can all be set according to actual conditions and are not limited in the embodiments of the present application.

[0084] Specifically, the fifth-generation YOLOv5 model released by Ultralytics is used as a pre-trained model. Each pre-trained model can include YOLOv5 models of different variants (indicating different sizes and complexities), such as: YOLOv5s model, YOLOv5m model, YOLOv5l model, etc. The optimal hyperparameters (target hyperparameter combination) of each pre-trained model are determined by using a genetic algorithm, that is, a population consisting of different hyperparameter combinations is generated, and then a set of genetic operators (such as crossover and mutation) are used to evolve the population for multiple generations to find the optimal hyperparameters for optimizing performance indicators (such as mean average precision mAP). The optimal hyperparameters can be as follows: Figure 4 shown.

[0085] Exemplarily, taking the YOLOv5s model as an example, an initial population P is randomly generated, each individual in the initial population P represents a hyperparameter combination, and the crossover probability pc and the mutation probability pm are set; wherein, the crossover probability pc and the mutation probability pm can be set according to actual conditions and are not limited here.

[0086] Based on the preset performance indicators, the individuals of the population are evaluated respectively, and the fitness values ​​corresponding to the individuals of each population are obtained. According to the fitness values, a preset number of individuals of the population are selected as parent individuals to generate the next generation, and a random number between 0 and 1 (first value) is generated. If it is less than the crossover probability pc, a crossover operation is performed on the selected parent individuals to generate new offspring individuals (crossover offspring); a random number between 0 and 1 (second value) is generated. If it is less than the mutation probability pm, a mutation operation is performed on the offspring individuals to introduce new offspring individuals (mutated offspring); the parent and offspring are merged to form a new population P2; the above steps are repeated until the stop condition is reached, and the population P at this time is output. n , the new population P n The population individual with the highest fitness value is used as the target hyperparameter combination of the YOLOv5s model.

[0087] It should be noted that the YOLOv5 model can use a pre-trained model on a large dataset as a starting point to solve related but different tasks. The knowledge learned by the pre-trained model in the original task is used and transferred to the new task in the hope that it can improve the performance of the model in the new task, as shown in the following formula (7):

[0088]

[0089] Among them, Dnew is the new data set, θ is the model parameter, θpre-trained is the pre-trained model parameter, is the loss function of the model on the dataset D, with parameter θ and λ being the hyperparameter that controls the trade-off between the new task loss and the pre-training task loss.

[0090] In the embodiment of the present application, a genetic algorithm is used to optimize the hyperparameters of each pre-trained model, thereby improving multiple performance indicators, reducing computing requirements, and improving the accuracy of fault detection.

[0091] In one embodiment, the stopping condition includes the number of iterations reaching a preset number.

[0092] Among them, the preset number of times can be set according to actual conditions and is not limited in the embodiments of the present application.

[0093] Specifically, when the number of iterations reaches a preset number, the population individual corresponding to the highest fitness value in the new population is used as the target hyperparameter combination of any pre-training model.

[0094] Exemplarily, in order to avoid overfitting, an early stopping criterion may be adopted, that is, the training is terminated when there is no improvement in the pre-trained model. For practical purposes, the preset number of times may be 500.

[0095] In one embodiment, the first stage evaluation is performed using the training data set, and the candidate model is determined based on the result of the first stage evaluation, including:

[0096] Input the training data set into any pre-trained model that has completed hyperparameter optimization to obtain the prediction results;

[0097] A candidate model is determined based on each prediction result.

[0098] Specifically, taking the pre-trained models including the YOLOv5s model, the YOLOv5m model, the YOLOv5l model, the YOLOv5n model, and the YOLOv5x model as examples, the training data sets can be respectively input into the pre-trained models for completing the hyperparameter optimization to obtain the prediction results, which may include the performance values ​​corresponding to the pre-trained models, such as Figure 5 As shown, Figure 5 The bold value in the figure indicates the optimal value of this performance. Figure 5 It can be seen that the YOLOv5l model is suitable for distribution network fault detection with higher accuracy, and the YOLOv5l model is taken as a candidate model.

[0099] It should be noted that mAP[0.5] is the average precision when IoU is 0.5; mAP[0.5:0.95] represents the average precision at different IoUs (from 0.5 to 0.95, with a step size of 0.05), i.e., IoU is 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, and 0.95.

[0100] In an embodiment of the present application, by using a training data set to evaluate each pre-trained model (YOLOv5 model of different variants), it is found that the candidate model is suitable for distribution network fault detection, has higher precision, and improves the accuracy and reliability of fault detection.

[0101] S106, freezing the corresponding network layers in the candidate models based on different preset freezing layers, and performing the second stage evaluation based on the training data set, determining the target freezing layers based on the results of the second stage evaluation, and using the candidate model corresponding to the target freezing layers as the fault detection model.

[0102] Among them, the preset number of freezing layers can be set according to actual conditions and is not limited in the embodiments of the present application.

[0103] Specifically, in data training, it is usually necessary to freeze some layers of the neural network, so that the useful features learned in the pre-trained model can be maintained while adapting to the new data set. During the training process, the weights of these layers will not be updated; by freezing certain layers, back propagation through these layers can be prevented, thereby keeping the weights of these layers unchanged. In order to determine the optimal number of frozen layers (target number of frozen layers), the corresponding network layers in the candidate model are frozen based on different preset numbers of frozen layers, and the second stage evaluation is performed based on the training data set. Based on the results of the second stage evaluation, the target number of frozen layers is determined, and the fault detection model is determined.

[0104] In one embodiment, corresponding network layers in the candidate models are frozen based on different preset numbers of frozen layers, and a second-stage evaluation is performed based on the training data set, including:

[0105] Based on the preset number of frozen layers, the corresponding network layers in the candidate model are frozen, and the training dataset is used to perform a second-stage evaluation on the remaining layers in the candidate model.

[0106] Specifically, taking the preset frozen layers as 10, 15 and 24, and the candidate model as the YOLOv5l model as an example, several consecutive layers and the entire candidate model (except the last output layer of the network) can be frozen; by training several model variants with different numbers of frozen layers on the dataset: 10 program layers (CNN); 15 program layers (CNN and the first 5 layers responsible for the feature map extraction part); 24 program layers (the entire candidate model except the neural network output layer), the model performance indicators under different numbers of frozen layers can be obtained to determine the optimal number of frozen layers, such as Figure 6 As shown, it can be concluded that the optimal number of frozen layers corresponding to the YOLOv5l model is 15 layers.

[0107] Exemplarily, the number of frozen layers is selected based on how similar the new model is to the pre-trained model.

[0108] It should be noted that when using the training data set to perform the first stage evaluation and the second stage evaluation respectively, the accuracy, recall rate and F1 score (F1_score) can be used for evaluation, as shown in the following equations (8), (9) and (10):

[0109]

[0110] Among them, tp is a true positive example, fp is a false positive example, and fn is a false negative example.

[0111] For target detection, the average precision mAP is considered, as shown in the following formula (11):

[0112]

[0113] Among them, n is the number of classes, k is the corresponding class, and η is the nth threshold.

[0114] In the embodiment of the present application, the corresponding network layers in the candidate model are frozen based on different preset freezing layers, and finally the target freezing layers are determined, thereby improving the average precision mAP of the model, which helps to continuously improve the accuracy and efficiency of distribution network fault detection. This efficiency in identifying faults is very beneficial for practical applications that require frequent updates and retraining of models.

[0115] S108, detecting the image data to be detected according to the fault detection model, and generating a detection result.

[0116] Specifically, the fault detection model can first classify the faults of the training data set into categories including insulation components in good condition and insulation components that need maintenance (contaminated, close to strange objects, or damaged). The best result of each evaluation is marked in bold. When the fault detection model training reaches the early stopping criterion of the loss function, the fault detection model training is considered complete, and the image data to be detected is input into the fault detection model for detection to generate the detection results, such as Figure 7 As shown, the proposed method is to complete the training of the fault detection model. Figure 7 The differences between the proposed method and the Masked R-CNN model, YOLOv5(best), YOLOv7(std) and YOLOv7(x) models are also shown accordingly. In terms of mAP[0.5] (mean average precision at IoU=0.5) and mAP[0.5:0.95] (mean average precision at different IoUs (from 0.5 to 0.95, with a step size of 0.05) i.e., IoU of 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95), the best performing model is the YOLOv5l model, which does not have the best F1 score but has the highest accuracy in the comparison of this type of models, so it is considered more suitable in this evaluation. Then, the hyperparameters were hyper-tuned, and the optimized model was obtained considering that YOLOv5l achieved the best results in the first stage evaluation (mAP); during the training process, the number of frozen layers was optimized. The results showed that for the YOLOv5l model trained with 15 frozen layers, the best performance indicators were obtained on the training dataset. Finally, based on the above optimization results, the fault detection model was obtained, the target detection was performed, and the detection results were generated.

[0117] Exemplarily, a first-stage evaluation can be performed on each pre-trained model, and based on the results of the first-stage evaluation, the pre-trained model with the best performance is determined, and its hyperparameters are hyper-adjusted to obtain a candidate model; during the second-stage evaluation process, the number of frozen layers of the candidate model is optimized to ultimately obtain a fault detection model.

[0118] In the above distribution network fault detection method, a genetic algorithm is used to optimize the hyperparameters of each pre-trained model, and the first stage evaluation is performed using the training data set. Based on the results of the first stage evaluation, a candidate model that is more suitable for distribution network fault detection is determined, and the corresponding network layers in the candidate model are frozen based on different preset freezing layers. The second stage evaluation is performed based on the training data set, and the target freezing layers are determined based on the results of the second stage evaluation to obtain a fault detection model. The image data to be detected is detected according to the fault detection model to generate a detection result, thereby improving the accuracy and reliability of distribution network fault detection.

[0119] In one embodiment, the method further comprises:

[0120] For the image data to be detected, the weight calculation method of Eigen-Cam is used to generate a thermal map, and then the fault detection map is obtained based on the thermal map.

[0121] Specifically, the fault detection map can be an activation map, which can reveal the features of the input image that the network pays attention to, thereby understanding how the CNN makes predictions. For example, if the activation map shows high values ​​in a specific area of ​​the image, this indicates that the network is using the information in that area to make predictions. By analyzing the activation map, we can better understand how the network extracts features from the input image and uses these features to make predictions. In addition, the activation map also helps to identify areas in the image that the model does not pay attention to, thereby making a more interpretable explanation of the model's predictions. Here, Eigen-CAM, which is less affected by noise and more resistant to feature map changes, is used for various applications of distribution network fault detection. Its purpose is to show the parts of the image that are important for a certain type of prediction provided by CNN; the basic concept of Eigen-CAM is to use the eigenvectors of the feature map of the final convolutional layer to determine the weights required to construct the heat map. The eigenvectors are calculated using the covariance matrix of the feature map, which represents the relationship between different feature maps. The calculation formula of Eigen-CAM is shown in the following formula (12):

[0122]

[0123] Among them, Lc is the output class score, among which, the variable is the feature map of the final convolutional layer, and the variable is the feature vector through the feature map The weight is calculated by the dot product with the output class score Lc. The final heat map (fault detection map) is obtained by using the weight Variables for feature mapping Perform weighted sum to obtain the following Figure 8 shown.

[0124] In the embodiment of the present application, the eigenvector-based class activation mapping (Eigen-CAM) is applied to visualize the results, thereby realizing efficient real-time monitoring of the distribution network to prevent power accidents caused by insulator failures, ensure the stable and reliable operation of the power grid, and enhance the fault detection model's ability to visualize and interpret the detection results, which helps operators understand the reasons why the faults are identified and provides operators with feasible insights into maintenance and monitoring tasks.

[0125] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0126] Based on the same inventive concept, the embodiment of the present application also provides a distribution network fault detection device for implementing the distribution network fault detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more distribution network fault detection device embodiments provided below can refer to the limitations of the distribution network fault detection method above, and will not be repeated here.

[0127] In an exemplary embodiment, Fig. 9 As shown, a distribution network fault detection device 900 is provided, and the device includes:

[0128] An acquisition module 901 is used to acquire image data to be detected and a training data set, wherein the training data set includes image data of power devices in a distribution network in a normal state and image data of power devices in a fault state in the distribution network;

[0129] The first evaluation module 902 is used to optimize the hyperparameters of each pre-trained model using a genetic algorithm, and use the training data set to perform a first-stage evaluation, and determine the candidate model based on the result of the first-stage evaluation; the pre-trained model includes a YOLO model;

[0130] The second evaluation module 903 is used to freeze the corresponding network layers in the candidate model based on different preset freezing layers, and perform the second stage evaluation based on the training data set, determine the target freezing layers based on the results of the second stage evaluation, and use the candidate model corresponding to the target freezing layers as the fault detection model

[0131] The detection module 904 is used to detect the image data to be detected according to the fault detection model and generate a detection result.

[0132] In one embodiment, the first evaluation module 902 is further used to create an initial population for any pre-trained model, and each population individual in the initial population represents a hyperparameter combination;

[0133] Evaluate the individuals in the population based on the preset performance indicators and obtain the fitness values ​​corresponding to the individuals in each population;

[0134] A preset number of individuals of the population are selected as parent individuals according to the fitness value, a first value is randomly generated, a crossover operation is performed on the parent individuals according to the first value to generate a crossover offspring; a second value is randomly generated, a mutation operation is performed on the parent individuals according to the second value to generate a mutant offspring;

[0135] The parent individuals, crossover offspring and mutant offspring are combined into a new population, the number of iterations is increased by 1, and the performance indicators are re-evaluated until the stopping condition is reached;

[0136] When the stopping condition is met, the population individual corresponding to the highest fitness value in the new population is used as the target hyperparameter combination of any pre-trained model.

[0137] In one embodiment, the stopping condition includes the number of iterations reaching a preset number.

[0138] In one embodiment, the first evaluation module 902 is further used to input the training data set into any pre-trained model that completes hyperparameter optimization to obtain a prediction result;

[0139] A candidate model is determined based on each prediction result.

[0140] In one embodiment, the second evaluation module 903 is further used to freeze the corresponding network layers in the candidate model based on a preset number of frozen layers, and perform a second stage evaluation on the remaining layers in the candidate model using the training data set.

[0141] In one embodiment, the device 900 further includes an image module for generating a thermal map using the weight calculation method of Eigen-Cam for the image data to be detected, and obtaining a fault detection map based on the thermal map.

[0142] Each module in the above-mentioned distribution network fault detection device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0143] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, a distribution network fault detection method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0144] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0145] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned distribution network fault detection method when executing the computer program.

[0146] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned distribution network fault detection method is implemented.

[0147] In one embodiment, a computer program product is provided, comprising a computer program, which implements the above-mentioned distribution network fault detection method when executed by a processor.

[0148] It should be noted that the data involved in this application (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0149] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0150] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0151] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A distribution network fault detection method, characterized in that: The method comprises: Acquire image data to be detected and a training data set, wherein the training data set includes image data of power devices in a distribution network in a normal state and image data of power devices in a fault state in the distribution network; A genetic algorithm is used to optimize the hyperparameters of each pre-trained model, and the training data set is used to perform a first-stage evaluation, and a candidate model is determined based on the results of the first-stage evaluation; the pre-trained model includes a YOLO model; Freezing the corresponding network layers in the candidate models based on different preset numbers of frozen layers, and performing a second-stage evaluation based on the training data set, determining a target number of frozen layers based on the results of the second-stage evaluation, and using the candidate model corresponding to the target number of frozen layers as a fault detection model; The image data to be detected is detected according to the fault detection model to generate a detection result.

2. The method according to claim 1, characterized in that The genetic algorithm is used to optimize the hyper parameters of each pre-training model, including: Creating an initial population for any of the pre-trained models, wherein each population individual in the initial population represents a hyperparameter combination; Evaluate the individuals in the population based on preset performance indicators to obtain fitness values ​​corresponding to the individuals in the population; A preset number of individuals of the population are selected as parent individuals according to the fitness value, a first value is randomly generated, and a crossover operation is performed on the parent individuals according to the first value to generate a crossover offspring; a second value is randomly generated, and a mutation operation is performed on the parent individuals according to the second value to generate a mutant offspring; The parent individuals, the crossover offspring and the mutant offspring are combined into a new population, the number of iterations is increased by 1, and the performance is re-evaluated based on the preset performance indicator until a stopping condition is reached; When the stopping condition is met, the population individual corresponding to the highest fitness value in the new population is used as the target hyperparameter combination of any of the pre-training models.

3. The method according to claim 2, characterized in that The stopping condition includes that the number of iterations reaches a preset number.

4. The method according to claim 1, characterized in that The step of performing first-stage evaluations respectively using the training data sets and determining candidate models based on the results of the first-stage evaluations includes: Input the training data set into any pre-trained model that completes the hyperparameter optimization to obtain a prediction result; The candidate model is determined based on each of the prediction results.

5. The method according to claim 1, characterized in that The freezing of the corresponding network layers in the candidate models based on different preset freezing layer numbers and performing the second stage evaluation based on the training data set respectively include: Based on the preset number of frozen layers, the corresponding network layers in the candidate model are frozen, and the remaining layers in the candidate model are evaluated in the second stage using the training data set.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: For the image data to be detected, the weight calculation method of Eigen-Cam is adopted to generate a thermal map, and a fault detection map is obtained based on the thermal map.

7. A distribution network fault detection device, characterized in that: The device comprises: An acquisition module, used to acquire image data to be detected and a training data set, wherein the training data set includes image data of power devices in a distribution network in a normal state and image data of power devices in a fault state in the distribution network; A first evaluation module is used to optimize the hyperparameters of each pre-trained model using a genetic algorithm, and to perform a first-stage evaluation using the training data set, and to determine a candidate model based on the result of the first-stage evaluation; the pre-trained model includes a YOLO model; The second evaluation module is used to freeze the corresponding network layers in the candidate model based on different preset freezing layers, and perform the second stage evaluation based on the training data set, determine the target freezing layers based on the results of the second stage evaluation, and use the candidate model corresponding to the target freezing layers as the fault detection model The detection module is used to detect the image data to be detected according to the fault detection model and generate a detection result.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Fault arc detection model training method, fault arc detection method and device

    CN119250165A