Method and system for detecting abnormity of electric energy metering device

By constructing abnormal image data sets and automatic data augmentation technology, combined with the improved YOLOv5l model, the problem of low efficiency and relying on manual experience in power metering device detection is solved, the detection accuracy and robustness are improved, and the missed detection rate is reduced , ensuring the safety and reliability of metrology work.

CN119148040APending Publication Date: 2024-12-17CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +2
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411270879.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The prior art has problems such as low efficiency, high manual experience, and difficulty in meeting complex image features and environmental differences in the daily maintenance and abnormal detection of user-side power metering devices. Especially when testing under live conditions, there are safety hazards and economics. Risk of loss.

Method used

By constructing anomaly image data set based on power grid patrol data, performing automatic data augmentation, using the improved YOLOv5l model for training, combining a soft non-maximum suppression module and NWD loss function, the anomaly detection model is optimized to improve detection accuracy and robustness.

Benefits of technology

Improve the accuracy and robustness of abnormal detection of the electrical energy metering device, reduce the leakage detection rate of the dense areas of the detection target, adapt to different light and angle changes, enhance the detection ability of small targets, and ensure the safety and reliability of the metering work. sex.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119148040A_ABST
    Figure CN119148040A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for anomaly detection of an electric energy metering device, and belongs to the technical field of intelligent measurement. The method comprises the following steps: constructing an abnormal image data set of the electric energy metering device based on power grid inspection data; performing automatic data augmentation on the abnormal image data set, and constructing an abnormal image augmentation data set of the electric energy metering device; training a training model by using the abnormal image augmented data set, and selecting the training model with the optimal weight as an anomaly detection model; and on the basis of the anomaly detection model, according to a to-be-detected image of a to-be-detected electric energy metering device, anomaly of the to-be-detected electric energy metering device is detected. According to the application of the method, the accuracy and robustness of detection are improved, and the omission ratio of the detection target dense area is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent measurement technology, and more specifically, to a method and system for abnormality detection of an electric energy metering device. Background Art

[0002] Electric energy metering device refers to the general term for a series of electric energy hardware equipment including electric energy meters, voltage sensors, current sensors and their secondary circuits. It is the main basis for the economic relationship between electricity supply and demand parties. Periodic on-site inspection of electric energy metering devices is an important part of the operation and maintenance of such equipment. It is of great significance to protect users' electricity safety and ensure the safe, stable and reliable operation of the power system.

[0003] At present, the daily maintenance and abnormality detection of power metering devices on the user side mainly rely on professional personnel to visit, which has problems such as low on-site inspection efficiency, heavy periodic verification tasks, and heavy reliance on manual experience. At the same time, on-site work on electric energy metering needs to ensure the normal power consumption of users as much as possible, and is often carried out under energized conditions. It has high requirements on the skill level of personnel and detection and inspection equipment. If the failure of the electric energy metering device or theft of electricity cannot be discovered in time, it may cause safety hazards and economic losses. Traditional metering device abnormality detection is mainly based on data analysis, and does not fully utilize the image information obtained during on-site operation and maintenance or image archiving.

[0004] Abnormal images of electric energy metering devices contain multiple devices of different shapes and sizes, with complex feature information, different shooting environments, and non-uniform image resolutions, resulting in large differences within the dataset. In addition, there are problems such as overlapping and occlusion of wires in densely wired areas and relatively small detection targets in the images, which makes it difficult for existing models and detection technologies to meet the detection needs of electric energy metering devices. Summary of the invention

[0005] In view of the above problems, the present invention proposes a method for detecting abnormality of an electric energy metering device, comprising:

[0006] Based on the power grid inspection data, an abnormal image dataset of the electric energy metering device is constructed;

[0007] Performing automatic data augmentation on the abnormal image data set to construct an augmented abnormal image data set of the electric energy metering device;

[0008] Using the abnormal image augmented data set, training the training model, and selecting the training model with the optimal weight as the abnormality detection model;

[0009] Based on the abnormality detection model, the abnormality of the electric energy metering device to be detected is detected according to the image to be detected of the electric energy metering device to be detected.

[0010] Optionally, based on the power grid inspection data, an abnormal image dataset of the electric energy metering device is constructed, including:

[0011] Screening out image data containing abnormalities in the electric energy metering device from the power grid inspection data, screening and cleaning the image data in sequence to remove low-quality data from the image data, and obtaining abnormal image data;

[0012] Classify and mark the abnormal image data, define the abnormal type of the abnormal image data, and establish a YOLO format data set;

[0013] The YOLO format dataset is randomly divided into a training set, a validation set and a test set in a ratio of 8:1:1. Based on the training set, the validation set and the test set, an abnormal image dataset of an electric energy metering device is constructed.

[0014] Optionally, a differentiable automatic data augmentation algorithm DADA is used to perform automatic data augmentation on the abnormal image dataset.

[0015] Optionally, performing automatic data augmentation on the abnormal image dataset includes:

[0016] According to the probability and amplitude of the optimal data augmentation strategy, the sub-strategies in the optimal data augmentation strategy are sampled, and based on the sampled sub-strategies, each abnormal image data in the abnormal image data set is automatically augmented multiple times.

[0017] Optional, training models, including: improved YOLOv5l model;

[0018] Among them, the non-maximum suppression module of the original YOLOv5l model is replaced with a soft non-maximum suppression module, and the loss function of the original YOLOv5l model is replaced with the NWD loss function to obtain an improved YOLOv5l model.

[0019] Optionally, the method further includes:

[0020] Determine a performance evaluation index value of the anomaly detection model, determine the performance of the anomaly detection model based on the performance evaluation index value, and adjust the model parameters of the anomaly detection model based on the determined performance result to optimize the performance of the anomaly detection model;

[0021] The performance evaluation index values ​​include:

[0022] Mean average precision, accuracy, recall and F1 values.

[0023] Optionally, the abnormality detection result of the electric energy metering device to be detected includes: abnormality category, detection frame and confidence level.

[0024] In another aspect, the present invention further provides a system for detecting abnormality of an electric energy metering device, comprising:

[0025] A data acquisition unit, used to construct an abnormal image data set of an electric energy metering device based on power grid inspection data;

[0026] A data processing unit, used for automatically augmenting the abnormal image data set to construct an augmented abnormal image data set of the electric energy metering device;

[0027] A model training unit, used to train a training model using the abnormal image augmented data set, and select a training model with an optimal weight as an abnormality detection model;

[0028] The detection unit is used to detect the abnormality of the electric energy metering device to be detected based on the abnormality detection model and according to the image to be detected of the electric energy metering device to be detected.

[0029] Optionally, the data acquisition unit constructs an abnormal image data set of the electric energy metering device based on the power grid inspection data, including:

[0030] Screening out image data containing abnormalities in the electric energy metering device from the power grid inspection data, screening and cleaning the image data in sequence to remove low-quality data from the image data, and obtaining abnormal image data;

[0031] Classify and mark the abnormal image data, define the abnormal type of the abnormal image data, and establish a YOLO format data set;

[0032] The YOLO format dataset is randomly divided into a training set, a validation set and a test set in a ratio of 8:1:1. Based on the training set, the validation set and the test set, an abnormal image dataset of an electric energy metering device is constructed.

[0033] Optionally, the data processing unit uses a differentiable automatic data augmentation algorithm DADA to perform automatic data augmentation on the abnormal image data set.

[0034] Optionally, performing automatic data augmentation on the abnormal image dataset includes:

[0035] According to the probability and amplitude of the optimal data augmentation strategy, the sub-strategies in the optimal data augmentation strategy are sampled, and based on the sampled sub-strategies, each abnormal image data in the abnormal image data set is automatically augmented multiple times.

[0036] Optional, training models, including: improved YOLOv5l model;

[0037] Among them, the non-maximum suppression module of the original YOLOv5l model is replaced with a soft non-maximum suppression module, and the loss function of the original YOLOv5l model is replaced with the NWD loss function to obtain an improved YOLOv5l model.

[0038] Optionally, the model training unit is also used to:

[0039] Determine a performance evaluation index value of the anomaly detection model, determine the performance of the anomaly detection model based on the performance evaluation index value, and adjust the model parameters of the anomaly detection model based on the determined performance result to optimize the performance of the anomaly detection model;

[0040] The performance evaluation index values ​​include:

[0041] Mean average precision, accuracy, recall and F1 values.

[0042] Optionally, the abnormality detection result of the electric energy metering device to be detected includes: abnormality category, detection frame and confidence level.

[0043] In yet another aspect, the present invention further provides a computing device, comprising: one or more processors;

[0044] a processor for executing one or more programs;

[0045] When the one or more programs are executed by the one or more processors, the above-described method is implemented.

[0046] In yet another aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the method described above is implemented.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] The present invention provides a method for detecting abnormalities of electric energy metering devices, comprising: constructing an abnormal image data set of electric energy metering devices based on power grid inspection data; performing automatic data augmentation on the abnormal image data set to construct an abnormal image augmented data set of the electric energy metering devices; using the abnormal image augmented data set to train a training model, and selecting a training model with an optimal weight as an abnormality detection model; based on the abnormality detection model, detecting abnormalities of the electric energy metering devices to be detected according to the images to be detected of the electric energy metering devices to be detected. The application of the present invention improves the accuracy and robustness of detection, and reduces the missed detection rate of detection target dense areas. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a flow chart of the method of the present invention;

[0050] Figure 2 A flowchart of an embodiment of the method of the present invention;

[0051] Figure 3 It is a flow chart of the automatic data augmentation algorithm of the method of the present invention;

[0052] Figure 4 This is a YOLOv51 model framework diagram improved by the method of the present invention;

[0053] Figure 5 It is a structural diagram of the system of the present invention. DETAILED DESCRIPTION

[0054] Now, exemplary embodiments of the present invention are described with reference to the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present invention in detail and completely and to fully convey the scope of the present invention to those skilled in the art. The terms used in the exemplary embodiments shown in the accompanying drawings are not intended to limit the present invention. In the accompanying drawings, the same units / elements are marked with the same reference numerals.

[0055] Unless otherwise specified, the terms (including technical terms) used herein have the commonly understood meanings to those skilled in the art. In addition, it is understood that the terms defined in commonly used dictionaries should be understood to have the same meanings as those in the context of the relevant fields, and should not be understood as idealized or overly formal meanings.

[0056] Embodiment 1:

[0057] The present invention proposes a method for detecting abnormality of an electric energy metering device, such as Figure 1 As shown, including:

[0058] Step 1: Based on the power grid inspection data, construct an abnormal image dataset of the electric energy metering device;

[0059] Step 2: Automatically augment the abnormal image data set to construct an augmented abnormal image data set of the electric energy metering device;

[0060] Step 3: Use the abnormal image augmented data set to train the training model, and select the training model with the optimal weight as the abnormality detection model;

[0061] Step 4: Based on the abnormality detection model and according to the image of the electric energy metering device to be detected, detect the abnormality of the electric energy metering device to be detected.

[0062] Among them, based on the power grid inspection data, an abnormal image dataset of the electric energy metering device is constructed, including:

[0063] Screening out image data containing abnormalities in the electric energy metering device from the power grid inspection data, screening and cleaning the image data in sequence to remove low-quality data from the image data, and obtaining abnormal image data;

[0064] Classify and mark the abnormal image data, define the abnormal type of the abnormal image data, and establish a YOLO format data set;

[0065] The YOLO format dataset is randomly divided into a training set, a validation set and a test set in a ratio of 8:1:1. Based on the training set, the validation set and the test set, an abnormal image dataset of an electric energy metering device is constructed.

[0066] Wherein, a differentiable automatic data augmentation algorithm DADA is used to perform automatic data augmentation on the abnormal image dataset.

[0067] The abnormal image dataset is automatically augmented, including:

[0068] According to the probability and amplitude of the optimal data augmentation strategy, the sub-strategies in the optimal data augmentation strategy are sampled, and based on the sampled sub-strategies, each abnormal image data in the abnormal image data set is automatically augmented multiple times.

[0069] Among them, the training model includes: improved YOLOv5l model;

[0070] Among them, the non-maximum suppression module of the original YOLOv5l model is replaced with a soft non-maximum suppression module, and the loss function of the original YOLOv5l model is replaced with the NWD loss function to obtain an improved YOLOv5l model.

[0071] The method further includes:

[0072] Determine a performance evaluation index value of the anomaly detection model, determine the performance of the anomaly detection model based on the performance evaluation index value, and adjust the model parameters of the anomaly detection model based on the determined performance result to optimize the performance of the anomaly detection model;

[0073] The performance evaluation index values ​​include:

[0074] Mean average precision, accuracy, recall and F1 values.

[0075] The abnormality detection result of the electric energy metering device to be detected includes: abnormality category, detection frame and confidence level.

[0076] The present invention is further described below with reference to specific cases:

[0077] Example steps: Figure 2 As shown, including:

[0078] Step 1: Select images containing abnormalities of electric energy metering devices from the inspection data of the power grid company and construct an abnormal image dataset of electric energy metering devices.

[0079] Step 1.1: Select images containing abnormalities in electric energy metering devices from the inspection data of Sichuan Power Grid Company, screen and clean the samples, and remove low-quality images.

[0080] In this example, the images come from the inspection data of the power grid company, totaling 1502 images, which are the metering anomalies (including faults and electricity theft) of each electricity user collected by the power grid inspection personnel using non-standard equipment. For these data, after cleaning the data set (removing poor quality, blurry, and similar images), a total of 1003 images were collected.

[0081] Step 1.2: Use LabelImg software to classify and label the images in the dataset, define the abnormal types, and form a YOLO format dataset.

[0082] In this example, according to the requirements of power grid inspection and common abnormalities of electric energy metering devices, 8 abnormal types are defined: missing seal of electric energy meter, broken seal of electric energy meter, broken shell of electric energy meter, short-circuited U-shaped ring at the end of electric energy meter, wrong wiring of electric energy meter, missing external switch, multiple wiring of external switch, and no wiring of external switch. Use labelImg annotation tool to annotate the targets in the sample and generate .txt format annotation files to form a yolo format dataset.

[0083] Step 1.3: Randomly divide the dataset into training set, validation set and test set in a ratio of 8:1:1 for model training and improvement.

[0084] Step 2: Use the differentiable automatic data augmentation algorithm DADA to optimize the strategy augmentation parameters, automatically augment the training set, and construct an augmented dataset of abnormal images of electric energy metering devices.

[0085] In this example, due to the large differences in on-site lighting, climate, visibility, and environmental complexity of different electricity users during image acquisition, and the use of non-standard equipment (such as mobile phones) to shoot images, resulting in blurred image resolution and visual effects, there are large differences within the image class. According to the needs, a differentiable automatic data augmentation algorithm DADA is provided to augment the training set, such as Figure 3 shown.

[0086] Step 2.1: Construct the search space and define the strategy augmentation parameters.

[0087] In this example, according to the characteristics of the data set and the task, 26 augmentation operations such as translation, scaling, cropping, equalization, and affine transformation are selected, and they are combined into 325 sub-strategies in pairs, from which 210 sub-strategies are randomly selected to form the search space. k Define the corresponding weight y k , the application probability p of the sub-strategy can be calculated according to the weight k Each sub-strategy s k Both contain two augmentation operations O k1 and O k2 , each augmentation operation defines a weight Z k With amplitude m k The weight y of the sub-strategy, the weight z of the augmentation operation within the sub-strategy, and the amplitude m constitute the strategy augmentation parameter θ = {y, z, m}. For each image x, there may be 4 kinds of transformations after the sub-strategy, and the transformation formula is expressed as follows:

[0088] S k =d k1 d k2 O k1 (x; m k1 )(x;m k2 )

[0089] +d k1 (1-d k1 ) k1 (x; m k1 )

[0090] +(1-d k1 )d k2 O k2 (x; m k1 )

[0091] +(1-d k1 )(1-d k2 )x

[0092] Where: d k1 and d k3 Obeying Bernoulli distribution, they represent k In each sub-strategy, the application probability of the first augmentation operation and the second augmentation operation is determined by the augmentation operation weight Z k Calculated, m k1 and m k2 Respectively represent the amplitude values ​​to which the two operations are applicable.

[0093] Step 2.2: Make the policy parameters differentiable.

[0094] In this example, the policy augmentation parameter θ = {y, z, m}. The weight y of the sub-policy is calculated using Gumbel-Softmax, and the calculation formula is as follows:

[0095]

[0096] Where: g = -log(-log(u)), u = Uniform(0,1). τ is the temperature coefficient. i Represents the weight of the ith sub-strategy. After Gumbel-Softmax calculation, c is a near-discrete differentiable one-hot vector that obeys a relaxed category distribution. The current sub-strategy can be selected by multiplying all sub-strategies with vector c:

[0097]

[0098] Where: s i represents the i-th sub-strategy.

[0099] For the weight z of the augmentation operation within the sub-strategy, Gumbel-Sigmoid is used to make the objective function differentiable with respect to the weight z. The specific formula is as follows:

[0100]

[0101] Where: g1-g2==log(-log(ε1))+log(-log(ε2)), {ε1,ε2}~Uniform(0,1), γ is the temperature coefficient. When RelaxBernoulli(z,γ) is greater than 0.5, this operation is selected.

[0102] For the amplitude m, the direct gradient estimation algorithm is used for gradient estimation, and the formula is as follows:

[0103]

[0104] Where: L is the objective function, Represents the original image x after sub-strategy S i , the image with amplitude m is augmented, for Pixels.

[0105] Step 2.3: The two-layer optimization algorithm searches and optimizes the strategy augmentation parameters.

[0106] In this example, the original training data is randomly divided into search strategy training set ψ according to a 1:1 ratio. τr and the search strategy validation set ψ val , which are used to train the detection network and verify the sampling sub-strategy respectively. The optimization process formula of the strategy augmentation parameter is as follows:

[0107] lm val (w * (θ),ψpal )

[0108] swt * (θ) = argmin w L train (w,θ,ψ τr )

[0109] Where: L train and L val Represents the detection network in the search strategy training set ψ τr and validation set ψ val The loss value on the training set is θ, θ represents the policy augmentation parameter, and w represents the detection model parameter. By calculating the training set loss L train The detection model is optimized by taking the gradient of the detection model parameter w to obtain the optimized detection model parameter w * Then calculate the validation set loss L val , by minimizing L val To optimize the policy augmentation parameter θ, update the augmentation policy. Through continuous iteration of this process, the optimal data augmentation policy is finally found, which increases data diversity while expanding the existing data set to the scale required for deep learning algorithm training.

[0110] In addition, in order to prevent the application probability of sub-strategies from being too concentrated around 0.5, this example uses a fairness loss function to constrain the application probability of sub-strategies, expand the probability difference between each sub-strategy, and thus better distinguish each sub-strategy. The formula of the fairness loss function is as follows:

[0111]

[0112] Where: α(·) represents the Gumbel-Softmax function, and M represents the number of images in a training batch.

[0113] In this example, after adding fairness loss, the optimization process formula of the strategy augmentation parameter is as follows:

[0114] lm val (w * (θ),ψ val )+ηL ipt

[0115] swt * (θ) = argmin w L train (w,θ,ψ τr )

[0116] Where: η is a constant used to balance the original validation set loss and fairness loss.

[0117] The entire optimization process uses a two-layer optimization framework to jointly optimize the strategy augmentation parameters and network parameters. The verification loss and fairness loss are combined as the objective function, and the finite difference approximation method is used to estimate the gradient of the objective function to the strategy augmentation parameters. Finally, after continuous iterations, an optimal data augmentation strategy is found, which contains the 25 most probable sub-strategies and their probabilities and amplitudes.

[0118] Step 2.4: Sample 25 sub-strategies according to the probability and amplitude of the optimal data augmentation strategy, and perform automatic augmentation 5 times on each image in the training set to form an augmented data set.

[0119] Step 3: Establish an anomaly detection model for electric energy metering devices based on the improved YOLOv5l. The structure is as follows Figure 4 As shown, the non-maximum suppression module of the YOLOv5l model is improved to soft non-maximum suppression, and the loss function uses NWD loss.

[0120] In this example, the YOLOv5l model will generate dozens or even hundreds of prediction boxes for each image. These large numbers of repeated prediction boxes need to be screened to become the final detection results. Non-maximum suppression is the method used by the YOLOv5 model to process repeated detection boxes. It continuously performs IoU (intersection over union) operations with other boxes with high confidence levels to filter out boxes with IoU greater than the threshold. Soft non-maximum suppression removes the fixed threshold. After selecting the detection box with high confidence, it uses the attenuation function to reduce the confidence of the detection box with high overlap with it, thereby indirectly removing redundant detection boxes. The formula is as follows:

[0121]

[0122] For a high-confidence detection box M, if the adjacent detection box overlaps with M for a large part, its confidence will become very low; if the adjacent detection box overlaps with M for only a small part, its original confidence will not change much.

[0123] In this example, a normalized Gaussian Wasserstein distance (NWD) is introduced to measure the similarity of the detection boxes, thereby reducing the sensitivity of IOU to small target position deviations.

[0124] NWD models the detection box as a two-dimensional Gaussian distribution and uses the Wasserstein distance to measure the similarity between the two distributions. In this way, even if the two detection boxes do not overlap or overlap very little, the similarity of the distributions can be accurately measured. The formula is as follows:

[0125]

[0126] Where: They are the center coordinates and width and height of the two detection boxes respectively.

[0127] Wasserstein distance cannot be used directly for similarity measurement. It is normalized using its exponential form to obtain NWD (N a ,N b ) can be used to calculate the loss function, the formula is as follows:

[0128]

[0129] L NWD =1-NNWD(N a , N b )

[0130] Where: C is a constant. NWD is insensitive to objects of different scales and is more stable for detecting small targets. Therefore, the introduction of NWD can effectively reduce the sensitivity of IoU to the position deviation of small targets, improve the accuracy and stability of small target detection, and enable the model to pay more attention to targets of various sizes in the image.

[0131] Step 4: Use the abnormal image augmented dataset of the electric energy metering device obtained in step 2 to train the improved YOLOv5l model, and select the optimal YOLOv5l model weight.

[0132] In this example, the configuration of the experimental software and hardware platform is shown in Table 1. The augmented dataset of abnormal images of the electric energy metering device obtained in step 2 is input into the improved YOLOv5l model for training. After each training round, the NWD loss function value of the training set is calculated. The YOLOv5l model parameters are optimized according to the NWD loss function value of the training set until the maximum number of training rounds is reached, and the YOLOv5l model weights with the best training effect are saved.

[0133] Table 1

[0134]

[0135]

[0136] In this example, yolov5l.pt pre-trained on the coco dataset is used as the model pre-training weight during model training. The initial learning rate is set to 0.01, and the model is trained using warm-up in the first three iterations of training. After that, the learning rate is dynamically reduced to 0.001 using the cosine function. The initial image size of the network in training and testing is 640×640, and the number of training rounds is 100. After the augmentation strategy is obtained using automatic data augmentation, each image in the training set is augmented 5 times based on the strategy, and the model is trained with the augmented data set. The original validation set and test set remain unchanged, and the number of training rounds is set to 20.

[0137] Step 5: Input the image to be detected and load the optimal YOLOv5l model weights to obtain the category, detection box and confidence of the abnormality of the electric energy metering device in the image to be detected.

[0138] Furthermore, in step 5, the image file to be detected is input, and the optimized electric energy metering device anomaly detection model is used for analysis, and the mean average precision mAP (mean Average Precision), precision P (Precision), recall rate R (Recall), F1 value, etc. are used as model performance evaluation criteria. The calculation formulas for each indicator are as follows:

[0139]

[0140] Where: TP represents the number of abnormalities of the energy metering device that are correctly detected, FP represents the number of abnormalities that are falsely detected, and FN represents the number of non-abnormalities that are falsely detected. i It represents the precision of the i-th category, and n is the number of detected categories.

[0141] In this example, the ablation experiment results are shown in Table 2.

[0142] Table 2

[0143]

[0144] Among them, A, B, and C represent automatic data augmentation, soft non-maximum suppression module, and NWD loss function, respectively. The ablation experiment results show that the improved YOLOv5l algorithm has a mAP of 78.8%, which is 7.1% higher than the original model. The precision and recall rates also increased by 5.4% and 0.3% respectively, and the F1 value also improved. This shows that the introduction of automatic data augmentation module, Soft-NMS module, NWD loss module, etc. have a positive impact on improving the detection accuracy of the network. By making the above improvements to the model, the model can improve the detection effect of abnormalities in electric energy metering devices.

[0145] In this example, the comparative experimental results of different detection models are shown in Table 3.

[0146] Table 3

[0147]

[0148] In the comparative experiment, the same data set partitioning strategy, the same hardware and software equipment conditions and the same training parameters were used to train and test the above detection model. The experimental results show that compared with models such as YOLOv3, YOLOv5, YOLOv7-tiny, and YOLOv7, the method of the present invention has better detection performance on this data set and is more suitable for the task of abnormal detection of electric energy metering devices.

[0149] Based on the YOLOv5l model, the present invention combines automatic data augmentation strategy, Soft-NMS, NWD loss function and other modules to propose an abnormality detection model for electric energy metering devices in complex environments and at multiple scales. A differentiable automatic data augmentation algorithm is used to search for targeted augmentation strategies through iterative training to perform diversity augmentation on the data set, simulating differences in different lighting conditions, angle changes and image quality, so that the model can better adapt to various practical scenarios during the training process and improve detection accuracy and robustness; by using a soft non-maximum suppression function, the model can reduce the missed detection rate of densely detected target areas; for small detection targets in the data, NWD loss is used to reduce the sensitivity to tiny target position deviations, so that the model can pay more attention to detection targets of different sizes in the image. It provides reliable data and technical support for metering staff to investigate safety hazards and handle abnormal metering failures in a targeted manner.

[0150] The present invention significantly improves the image adaptability to different lighting conditions, angle changes and image quality, improves detection accuracy and robustness, reduces the missed detection rate in areas with dense detection targets, and can pay more comprehensive attention to detection targets of different sizes in the image, thereby achieving accurate identification and classification of fault defects, and supporting metrology personnel to target safety hazards and handle abnormal measurement failures.

[0151] Embodiment 2:

[0152] The present invention also proposes a system 200 for detecting abnormality of an electric energy metering device, such as Figure 5 As shown, including:

[0153] The data acquisition unit 201 is used to construct an abnormal image data set of the electric energy metering device based on the power grid inspection data;

[0154] A data processing unit 202 is used to automatically augment the abnormal image data set to construct an augmented abnormal image data set of the electric energy metering device;

[0155] A model training unit 203 is used to train a training model using the abnormal image augmented data set, and select a training model with an optimal weight as an abnormality detection model;

[0156] The detection unit 204 is configured to detect an abnormality of the electric energy metering device to be detected based on the abnormality detection model and according to the image to be detected of the electric energy metering device to be detected.

[0157] The data acquisition unit 201 constructs an abnormal image data set of the electric energy metering device based on the power grid inspection data, including:

[0158] Screening out image data containing abnormalities in the electric energy metering device from the power grid inspection data, screening and cleaning the image data in sequence to remove low-quality data from the image data, and obtaining abnormal image data;

[0159] Classify and mark the abnormal image data, define the abnormal type of the abnormal image data, and establish a YOLO format data set;

[0160] The YOLO format dataset is randomly divided into a training set, a validation set and a test set in a ratio of 8:1:1. Based on the training set, the validation set and the test set, an abnormal image dataset of an electric energy metering device is constructed.

[0161] The data processing unit 202 uses a differentiable automatic data augmentation algorithm DADA to perform automatic data augmentation on the abnormal image data set.

[0162] The abnormal image dataset is automatically augmented, including:

[0163] According to the probability and amplitude of the optimal data augmentation strategy, the sub-strategies in the optimal data augmentation strategy are sampled, and based on the sampled sub-strategies, each abnormal image data in the abnormal image data set is automatically augmented multiple times.

[0164] Among them, the training model includes: improved YOLOv5l model;

[0165] Among them, the non-maximum suppression module of the original YOLOv5l model is replaced with a soft non-maximum suppression module, and the loss function of the original YOLOv5l model is replaced with the NWD loss function to obtain an improved YOLOv5l model.

[0166] The model training unit 203 is also used for:

[0167] Determine a performance evaluation index value of the anomaly detection model, determine the performance of the anomaly detection model based on the performance evaluation index value, and adjust the model parameters of the anomaly detection model based on the determined performance result to optimize the performance of the anomaly detection model;

[0168] The performance evaluation index values ​​include:

[0169] Mean average precision, accuracy, recall and F1 values.

[0170] The abnormality detection result of the electric energy metering device to be detected includes: abnormality category, detection frame and confidence level.

[0171] The application of the present invention improves the accuracy and robustness of detection and reduces the missed detection rate in areas with densely populated detection targets.

[0172] Embodiment 3:

[0173] Based on the same inventive concept, the present invention also provides a computer device, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding functions, so as to implement the steps of the method in the above embodiment.

[0174] Embodiment 4:

[0175] Based on the same inventive concept, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both a built-in storage medium in a computer device and an extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of the method in the above embodiment.

[0176] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0177] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0178] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0179] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0180] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0181] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for detecting abnormality of an electric energy metering device, characterized in that: include: Based on the power grid inspection data, an abnormal image dataset of the electric energy metering device is constructed; Performing automatic data augmentation on the abnormal image data set to construct an augmented abnormal image data set of the electric energy metering device; Using the abnormal image augmented data set, training the training model, and selecting the training model with the optimal weight as the abnormality detection model; Based on the abnormality detection model, the abnormality of the electric energy metering device to be detected is detected according to the image to be detected of the electric energy metering device to be detected.

2. The method according to claim 1, characterized in that The method of constructing an abnormal image data set of an electric energy metering device based on power grid inspection data includes: Screening out image data containing abnormalities in the electric energy metering device from the power grid inspection data, screening and cleaning the image data in sequence to remove low-quality data from the image data, and obtaining abnormal image data; Classify and mark the abnormal image data, define the abnormal type of the abnormal image data, and establish a YOLO format data set; The YOLO format dataset is randomly divided into a training set, a validation set and a test set in a ratio of 8:1:

1. Based on the training set, the validation set and the test set, an abnormal image dataset of an electric energy metering device is constructed.

3. The method according to claim 1, characterized in that The abnormal image dataset is automatically augmented using a differentiable automatic data augmentation algorithm DADA.

4. The method according to claim 1, characterized in that The step of automatically augmenting the abnormal image data set includes: According to the probability and amplitude of the optimal data augmentation strategy, the sub-strategies in the optimal data augmentation strategy are sampled, and based on the sampled sub-strategies, each abnormal image data in the abnormal image data set is automatically augmented multiple times.

5. The method according to claim 1, characterized in that The training model includes: an improved YOLOv5l model; Among them, the non-maximum suppression module of the original YOLOv5l model is replaced with a soft non-maximum suppression module, and the loss function of the original YOLOv5l model is replaced with the NWD loss function to obtain an improved YOLOv5l model.

6. The method according to claim 1, characterized in that The method further comprises: Determine a performance evaluation index value of the anomaly detection model, determine the performance of the anomaly detection model based on the performance evaluation index value, and adjust the model parameters of the anomaly detection model based on the determined performance result to optimize the performance of the anomaly detection model; The performance evaluation index values ​​include: Mean average precision, accuracy, recall and F1 values.

7. The method according to claim 1, characterized in that The abnormality detection result of the electric energy metering device to be detected includes: abnormality category, detection frame and confidence level.

8. A system for detecting abnormality of an electric energy metering device, characterized in that: include: A data acquisition unit, used to construct an abnormal image data set of an electric energy metering device based on power grid inspection data; A data processing unit, used for automatically augmenting the abnormal image data set to construct an augmented abnormal image data set of the electric energy metering device; A model training unit, used to train a training model using the abnormal image augmented data set, and select a training model with an optimal weight as an abnormality detection model; The detection unit is used to detect the abnormality of the electric energy metering device to be detected based on the abnormality detection model and according to the image to be detected of the electric energy metering device to be detected.

9. The system according to claim 8, characterized in that The data acquisition unit constructs an abnormal image data set of the electric energy metering device based on the power grid inspection data, including: Screening out image data containing abnormalities in the electric energy metering device from the power grid inspection data, screening and cleaning the image data in sequence to remove low-quality data from the image data, and obtaining abnormal image data; Classify and mark the abnormal image data, define the abnormal type of the abnormal image data, and establish a YOLO format data set; The YOLO format dataset is randomly divided into a training set, a validation set and a test set in a ratio of 8:1:

1. Based on the training set, the validation set and the test set, an abnormal image dataset of an electric energy metering device is constructed.

10. The system according to claim 8, characterized in that The data processing unit uses a differentiable automatic data augmentation algorithm DADA to perform automatic data augmentation on the abnormal image data set.

11. The method according to claim 8, characterized in that The step of automatically augmenting the abnormal image data set includes: According to the probability and amplitude of the optimal data augmentation strategy, the sub-strategies in the optimal data augmentation strategy are sampled, and based on the sampled sub-strategies, each abnormal image data in the abnormal image data set is automatically augmented multiple times.

12. The system according to claim 8, characterized in that The training model includes: an improved YOLOv5l model; Among them, the non-maximum suppression module of the original YOLOv5l model is replaced with a soft non-maximum suppression module, and the loss function of the original YOLOv5l model is replaced with the NWD loss function to obtain an improved YOLOv5l model.

13. The system according to claim 8, characterized in that The model training unit is also used for: Determine a performance evaluation index value of the anomaly detection model, determine the performance of the anomaly detection model based on the performance evaluation index value, and adjust the model parameters of the anomaly detection model based on the determined performance result to optimize the performance of the anomaly detection model; The performance evaluation index values ​​include: Mean average precision, accuracy, recall and F1 values.

14. The system according to claim 8, characterized in that The abnormality detection result of the electric energy metering device to be detected includes: abnormality category, detection frame and confidence level.

15. A computer device, characterized in that: include: one or more processors; a processor for executing one or more programs; When the one or more programs are executed by the one or more processors, the method according to any one of claims 1 to 7 is implemented.

16. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Target detection method based on self-learning data

    CN112686282A

  • Power transmission line target detection and identification method based on feature fusion

    CN114445706A

  • Model training method, target detection method and related equipment

    CN114926701A

  • Short-wave frequency hopping signal sorting method based on improved YOLOv5

    CN116318249A

  • Road pedestrian and vehicle detection method based on improved YOLOv7

    CN117877000A