A method for detecting small components of electric energy meter

By using the object detection neural network and K-means clustering algorithm in the power meter detection, combined with the deviation optimization mechanism, the detection of the power meter widgets is optimized, and the problem of poor small object detection performance is solved, and efficient and accurate detection of the power meter widgets is achieved.

CN116385764BActive Publication Date: 2025-08-12ZHEJIANG HUAYUN INFORMATION TECH CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310162648.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-16
Publication Date
2025-08-12
Estimated Expiration
2043-02-16

AI Technical Summary

Technical Problem

In the detection of small energy meter widgets, there are problems such as poor detection performance, long detection time and limited accuracy improvement in the prior art, especially detection failure caused by loss of target information, large noise impact and anchor frame disturbance.

Method used

The object detection neural network is used to extract the entire table picture of the power meter, calculate the length and width ratio, set the standard energy meter model, use K-means clustering to determine the component coordinates, form the standard meter model, and update the model by simplifying the neural network to detect widgets, combine the deviation optimization mechanism.

Benefits of technology

It improves the accuracy and speed of detection of power meter widgets, reduces the training data requirements, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116385764B_ABST
    Figure CN116385764B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for detecting small components of an electric energy meter, which relates to the field of visual detection. At present, small target detection has little effect on the detection of standard electric energy meter small components, the detection takes a long time, and the improvement of detection accuracy is limited; the present technical solution uses a target detection neural network to extract a partial image of the electric energy meter from the original image to form a picture containing only the entire meter; calculates the aspect ratio of the electric energy meter picture, and sets the length and width of the standard electric energy meter; determines the number and type of electric energy meter components, and the coordinates of the upper left corner and lower right corner of each component; sets the initial value of the coordinates, clusters multiple electric energy meter pictures using the K-means clustering method, determines the coordinate center value of each component, and forms a standard electric energy meter model; when detecting a new electric energy meter picture, the electric energy meter picture is divided into small component pictures according to the standard electric energy meter model, and the component content is detected using a simplified neural network, and the deviation optimization mechanism is called to update the standard electric energy meter model. The present invention optimizes the detection of small components in the electric energy meter, and the detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual inspection, and in particular to a method for inspecting small components of an electric energy meter. Background Art

[0002] Electricity metering devices are essential for daily life and industrial production. Understanding their safety status is crucial, impacting the safe use of electricity in every household. Smart grids incorporate computer technology, enabling mobile devices to take photos and automatically detect and assess meter status. This improves the safety management of electricity metering devices and saves significant manpower and resources. Components on electricity metering devices, such as seals and locks, occupy a very small area on the housing or meter body, making the detection of these small components challenging using computer vision methods.

[0003] Object detection is a technology that has been developed for many years and is now very mature. Several object detection methods have emerged that can be used in the industry, such as Faster R-CNN, RetinaNet, and YOLO. However, the problem of poor performance in small object detection has not yet been completely solved.

[0004] The main reasons for the problems of small target detection are as follows:

[0005] 1) Target information is easily lost. During target detection, feature extractors typically use subsampling to filter noise and reduce the spatial resolution of feature maps, inevitably losing target information. This information loss is not noticeable for large targets, but for small targets, which have very little feature information, the information loss caused by subsampling has a significant impact.

[0006] 2) Noise has a significant impact on small targets. Since small targets have few pixels, low resolution, and poor image quality, both environmental and system noise can easily distort their appearance, contaminating their image structure and features, affecting their detection.

[0007] 3) Anchor frame perturbations can easily cause small target detection failures. Since small targets have fewer pixels and smaller coverage areas, even slight perturbations of the anchor frame can cause incomplete coverage of small targets, leading to small target detection failures.

[0008] Traditional small target detection solutions include resampling or automatic enhancement based on data augmentation, scale expansion and GAN super-resolution based on super-resolution, and bottom-up information interaction based on feature fusion. However, these solutions are not very effective for detecting small components in standard electric meter models. Detection takes a long time, and the improvement in detection accuracy is limited. Summary of the Invention

[0009] The technical problem to be solved and the technical task proposed by the present invention are to improve and perfect the existing technical solutions and provide a method for detecting small components of an electric energy meter to achieve the purpose of improving the detection accuracy. To this end, the present invention adopts the following technical solutions.

[0010] A method for detecting small components of an electric energy meter comprises the following steps:

[0011] 1) Use an object detection neural network to detect and extract the electricity meter portion of an image, forming an image containing only the entire meter, and calculate the pixel ratio of the length and width of the entire meter image;

[0012] 2) Repeat step 1) to adjust the aspect ratio of the multiple electricity meter images, calculate the average aspect ratio, select an appropriate magnification, scale according to the average aspect ratio, determine the length and width of the standard meter model, and determine the types of the various components of the electricity meter;

[0013] 3) Use the rectangular marking tool to mark the position of each component and determine the coordinate values of the upper left corner and lower right corner of each component;

[0014] 4) Repeat step 3) to mark each full-table image, organizing the coordinates of the upper left corner of each component into the first coordinate set, and the coordinates of the lower right corner of each component into the second coordinate set;

[0015] 5) Based on the component type, the coordinates in the first coordinate set are classified according to the component, the average value of the upper left corner coordinate of each component is calculated, and the average value is set as the initial value of the upper left corner coordinate of the component;

[0016] 6) Using the K-means method, with the first coordinate set as the original data and the initial value of the upper left corner coordinate in step 5) as the iterative original value, cluster the coordinates of the upper left corner of each component, and obtain the cluster center value of the coordinates of the upper left corner of each component; similarly, with the second coordinate set as the original data and the initial value of the lower right corner coordinate in step 5) as the iterative original value, cluster the coordinates of the upper right corner of each component, and obtain the cluster center value of the coordinates of the lower right corner of each component;

[0017] 7) Based on the cluster center values of the upper left corner and the lower right corner of each component, a rectangular anchor frame of each component is obtained to form a standard electric meter model;

[0018] 8) When a new meter image needs to be detected, the meter image is input into the standard meter model, and the approximate position of the widget is determined using the anchor frames of each component. The components are then segmented to obtain the widget image. The widget image is then sent to a simplified target detection neural network for detailed detection to determine the widget type. The deviation optimization mechanism is then called to provide timely feedback to the standard meter model to update the standard meter model.

[0019] This technical solution uses two coordinate sets because: the rectangular frame of each component requires two coordinates to determine, namely the coordinates of the upper left corner and the lower right corner. The coordinates of the upper left corners of all components constitute the first coordinate set, and the lower right corners constitute the second coordinate set. In addition, these two coordinate sets need to be clustered twice using a clustering algorithm. Otherwise, the coordinates of the upper left corner and the lower right corner will be mixed, and the classification error of the coordinates of each component will be too large.

[0020] The simplified object detection neural network refers to the image after it has been cut through the meter model, which is then fed into a subsequent neural network for detection. This process significantly reduces the detection range, but does not guarantee the immediate detection of small components. It must be fed into a subsequent neural network (such as YOLO or other object detection neural networks) for detection and verification. The simplified object detection neural network described here is merely an overview; the specific neural network should be selected based on actual production needs and is not a fixed network. For example, the YOLO neural network may be used when speed is a priority, while RCNN may be used when accuracy is a priority.

[0021] The electricity meters of the State Grid are divided into single-phase meters and three-phase meters. Regardless of the type of meter, they are all standardized. Although there are many small components, the position distribution of each component remains basically unchanged, which is conducive to the regional division and detection of the standard meter image. This technical solution uses a target detection neural network to extract a partial image of the electricity meter from the original image to form a picture containing only the entire meter; calculate the aspect ratio of the electricity meter image, and set the length and width of the standard electricity meter; determine the number and type of electricity meter components, and the coordinates of the upper left corner and lower right corner of each component; set the initial value of the coordinates, and use the K-means clustering method to cluster multiple electricity meter images, determine the coordinate center value of each component, and form a standard meter model; when detecting a new electricity meter image, the electricity meter image is divided into small component images according to the standard meter model, and the simplified neural network is used to detect the component content, and the deviation optimization mechanism is called to update the standard meter model. The present invention optimizes the detection of small components in the electricity meter, thereby improving its detection accuracy.

[0022] As a preferred technical means: in step 6), the steps include:

[0023] 601) Select K points from the sample as initial cluster center values;

[0024] 602) Calculate the Euclidean distance from each sample to each cluster center value, and divide the sample into the cluster corresponding to the cluster center value closest to it.

[0025] 603) Calculate the mean of all samples in each cluster and use the mean to update the cluster center point of the cluster;

[0026] 604) Repeat steps 602) to 603) until the change in the cluster center point is less than a threshold or the maximum number of iterations is reached.

[0027] As a preferred technical means: the deviation optimization mechanism used in step 8) is: record the new coordinates of the upper left corner and the lower right corner of the widget, update the first coordinate set and the second coordinate set in step 4), and repeat steps 5) to 6) to perform clustering with the new coordinate set to calculate a more accurate cluster center point, thereby updating the standard meter model.

[0028] As a preferred technical means: in step 8), the deviation optimization mechanism includes the following steps:

[0029] 801) Record widget coordinates

[0030] When the deviation optimization mechanism is activated, the widget image is detected by the simplified object detection neural network model, and a corresponding new anchor box and coordinates are generated. The anchor box coordinates are recorded and mapped to the standard full meter image of the electricity meter to which the widget image belongs, obtaining more accurate coordinates of the upper left and lower right corners of the widget in the standard full meter image.

[0031] 802) Update the component coordinate set

[0032] Add the obtained precise coordinates of the widget to the first coordinate set and the second coordinate set of the corresponding widget to form a new cluster set;

[0033] 803) Clustering and re-anchoring the standard meter model

[0034] Use the K-means method to re-cluster and obtain new upper left corner cluster center values and lower right corner cluster center values, update the coordinates of all component anchor boxes, and thus update the standard electricity meter model.

[0035] Beneficial effects:

[0036] 1) Since electricity meters are assembled in a standardized manner, the size of the meter and the positions of its components remain relatively unchanged. Using a standard electricity meter model for segmentation can largely ensure the accuracy of small components or determine the position of small components within a certain small range, which facilitates subsequent simplified neural network detection.

[0037] 2) Since the position distribution of widgets remains basically unchanged, the coordinates of the points within each cluster are relatively concentrated during the K-means clustering process. The data used for training is much less than that of neural networks, and the training time is greatly reduced, which facilitates the rapid detection and deployment of widgets.

[0038] 3) Due to the existence of the deviation detection mechanism, the standard meter model can be constantly updated and the detection accuracy is guaranteed.

[0039] 4) Unlike approaches that increase the number of training samples to improve detection accuracy, using clustering algorithms to optimize small object detection can also perform well in environments with a low number of samples. Furthermore, compared to other methods that use clustering algorithms to anchor prior bounding boxes, directly predicting the diagonal points of a rectangle using clustering algorithms can directly obtain a more accurate detection range, making the optimization solution faster. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0041] Figure 2 This is the deviation optimization mechanism process of the present invention. DETAILED DESCRIPTION

[0042] The technical solution of the present invention is further described in detail below with reference to the accompanying drawings.

[0043] The State Grid's electricity meters are divided into single-phase meters and three-phase meters. Regardless of the type of meter, they are all standardized. Although there are many small components, the position distribution of each component remains basically unchanged, which is conducive to the regional division and detection of the standard meter image. The present invention includes the following steps: using a target detection neural network to extract a partial image of the electricity meter from the original image to form an image containing only the entire meter; calculating the aspect ratio of the electricity meter image and setting the length and width of the standard electricity meter; determining the number and type of electricity meter components, and the coordinates of the upper left corner and lower right corner of each component; setting the initial value of the coordinates, clustering multiple electricity meter images using the K-means clustering method, determining the coordinate center value of each component, and forming a standard meter model; when detecting a new electricity meter image, dividing the electricity meter image into individual small component images according to the standard meter model, using a simplified neural network to detect its component content, and calling a deviation optimization mechanism to update the standard meter model. The present invention optimizes the detection of small components in the electricity meter, thereby improving its detection accuracy.

[0044] Specifically, such as Figure 1 As shown, the present invention includes the following steps:

[0045] S1: Get the entire table image

[0046] Original images of the complete meter in the meter box are captured using a camera. All images must be taken from the front, without reflections, and the number of sample images collected ranges from 400 to 800. These images are then fed into an object detection neural network for detection. The meter area is delineated and the entire meter area is sliced to create an original image containing only the meter. The pixel ratio k of the entire meter image is also calculated.

[0047] In this example, 500 image samples were collected, each containing only a single complete meter within the meter box. Because meters are large and simple in shape, the YOLOv5 object detection neural network was used to detect the entire meter. 500 original images of the entire meter were obtained after the YOLOv5 model was used to detect the original images.

[0048] S2: Create a standard table image collection

[0049] Take the average of the length and width ratios of all images and set it as the standard length and width ratio K; select an appropriate magnification, scale according to the ratio K, and determine the length L and width H of the standard whole meter model; determine the types of each component of the electric energy meter, where the number of types is represented by M and the number of each component is represented by m i Finally, all original full-table images are scaled according to the standard length L and standard width H to obtain a set of standard full-table images.

[0050] S3: Mark the position of each component

[0051] Use the rectangular annotation tool to mark the position of each component and determine the coordinate values of the upper left corner and lower right corner of each component. The coordinates of the upper left corner are expressed as (XLmi, YLmi) and the coordinates of the lower right corner are expressed as (XRmi, YRmi).

[0052] S4: Get component coordinate set

[0053] Repeat step S3 to organize the coordinates of the upper left corners of all components in all standard full-table images into a set ML, and organize the coordinates of the lower right corners of all components into a set MR.

[0054] S5: Calculate the initial value of the coordinate set

[0055] Classify the coordinates in ML according to components, calculate the average value of the coordinates of the upper left corner of each component, and set the average value as the initial value of the coordinates of the upper left corner of the component; similarly, classify the coordinates in MR according to components, calculate the average value of the coordinates of the lower right corner of each component, and set the average value as the initial value of the coordinates of the lower right corner of the component.

[0056] S6: K-means clustering

[0057] Using the K-means method, with the ML coordinate set as the original data and the initial value of the upper left corner coordinate obtained in step S5 as the iterative original value, clustering is performed into M categories, and the cluster center value of the upper left corner coordinate of each component is obtained; similarly, using the K-means method, with the MR coordinate set as the original data and the initial value of the middle lower right corner coordinate obtained in step S5 as the iterative original value, clustering is performed into M categories, and the cluster center value of the lower right corner coordinate of each component is obtained.

[0058] The K-means method is specifically as follows:

[0059] S61: First, select K points from the sample as the initial cluster center values;

[0060] S62: Calculate the Euclidean distance between each sample and each cluster center value, and divide the sample into the cluster corresponding to the cluster center value closest to it. The calculation formula of the Euclidean distance is as follows:

[0061] S62: The K-means method calculates the mean of all samples in each cluster and uses the mean to update the cluster center point;

[0062] S63: Repeat steps S62 and S63 until the change in the cluster center point is less than a threshold or the maximum number of iterations is reached;

[0063] S7: Determine the standard meter model

[0064] The upper left corner cluster center value and the lower right corner cluster center value of each component obtained in step S6 are used to determine the position of the rectangular anchor frame of each component to obtain a standard electric meter model.

[0065] S8: Detecting the Electricity Meter Widget in the Image

[0066] When detecting a new image, the new image is first fed into the target detection neural network to obtain the entire meter image, then the new image is scaled according to the standard length and width in S2, and finally input into the standard meter model obtained in S7 to match the approximate positions of each component.

[0067] Obtaining widget images and feeding them into the subsequent detection neural network: After matching the positions of each component, the standard electric meter model can obtain the approximate location distribution of each component through clustering the anchor boxes of each component, and cut each component using the anchor box coordinates to form an image containing only the widgets; then, each widget image is fed one by one into the subsequent, simplified target detection network for detection.

[0068] Determine the type of widget and update the model: The subsequent simplified neural network will receive each widget image for detection. If the widget is not detected, the result is that the widget is missing; if the corresponding widget is detected, the result is the number of the corresponding widget, and the deviation optimization mechanism is enabled to update the model at the same time. The deviation optimization mechanism is as follows: Figure 2 As shown, the steps are:

[0069] S81: Record widget coordinates: When the deviation optimization mechanism is started, the widget image is detected by the simplified target detection neural network model, and there will be a corresponding new anchor box and coordinates. The anchor box coordinates are recorded and mapped to the standard full meter image of the electricity meter to which the widget image belongs, so as to obtain more accurate coordinates of the upper left corner and lower right corner of the widget in the standard full meter image.

[0070] S82: Update the component coordinate set: add the precise coordinates of the small component obtained in S81 to the component cluster coordinate set (ML and MR) in S4 to form a new cluster set.

[0071] S83: Clustering and re-anchoring the standard electricity meter model: Repeat steps S5 to S6, use the K-means method to re-cluster, obtain new upper left corner cluster center values and lower right corner cluster center values, update the coordinates of all component anchor boxes, and thus update the standard electricity meter model.

[0072] The above-mentioned method for detecting a small component of an electric energy meter is a specific embodiment of the present invention, which has reflected the substantial characteristics and progress of the present invention. According to actual use needs and under the guidance of the present invention, equivalent modifications in shape, structure, etc. can be made to it, which are all within the scope of protection of this scheme.

Claims

1. A method for detecting small components of an electric energy meter, characterized in that The following steps are involved: 1) Use an object detection neural network to detect and extract the electricity meter portion of an image, forming an image containing only the entire meter, and calculate the pixel ratio of the length and width of the entire meter image; 2) Repeat step 1) to adjust the aspect ratio of the multiple electricity meter images, calculate the average aspect ratio, select an appropriate magnification, scale according to the average aspect ratio, determine the length and width of the standard meter model, and determine the types of the various components of the electricity meter; 3) Use the rectangular marking tool to mark the position of each component and determine the coordinate values of the upper left corner and lower right corner of each component; 4) Repeat step 3) to mark each full-table image, organizing the coordinates of the upper left corner of each component into the first coordinate set, and the coordinates of the lower right corner of each component into the second coordinate set; 5) Based on the component type, the coordinates in the first coordinate set are classified by component, the average value of the coordinates of the upper left corner of each component is calculated, and the average value is set as the initial value of the coordinates of the upper left corner of the component; similarly, the coordinates in the second coordinate set are classified by component, the average value of the coordinates of the lower right corner of each component is calculated, and the average value is set as the initial value of the coordinates of the lower right corner of the component; 6) Using the K-means method, with the first coordinate set as the original data and the initial value of the upper left corner coordinate in step 5) as the iterative original value, cluster the coordinates of the upper left corner of each component, and obtain the cluster center value of the coordinates of the upper left corner of each component; similarly, with the second coordinate set as the original data and the initial value of the lower right corner coordinate in step 5) as the iterative original value, cluster the coordinates of the lower right corner of each component, and obtain the cluster center value of the coordinates of the lower right corner of each component; 7) Based on the cluster center values of the upper left corner and the lower right corner of each component, a rectangular anchor frame of each component is obtained to form a standard electric meter model; 8) When a new meter image needs to be detected, the meter image is input into the standard meter model, and the approximate position of the widget is determined using the anchor frames of each component. The components are then segmented to obtain the widget image. The widget image is then sent to a simplified target detection neural network for detailed detection to determine the widget type. The deviation optimization mechanism is then called to provide timely feedback to the standard meter model to update the standard meter model.

2. The method for detecting small components of an electric energy meter according to claim 1, wherein: In step 6), the steps include: 601) Select K points from the sample as initial cluster center values; 602) Calculating the Euclidean distance between each sample and each cluster center value, and dividing the sample into the cluster corresponding to the cluster center value closest to the sample; 603) Calculate the mean of all samples in each cluster and use the mean to update the cluster center point of the cluster; 604) Repeat steps 602) to 603) until the change in the cluster center point is less than a threshold or the maximum number of iterations is reached.

3. The method for detecting small components of an electric energy meter according to claim 2, wherein: The deviation optimization mechanism used in step 8) is as follows: record the new coordinates of the upper left corner and lower right corner of the widget, update the first coordinate set and the second coordinate set in step 4), and repeat steps 5) to 6) to perform clustering using the new coordinate set to calculate a more accurate cluster center point, thereby updating the standard meter model.

4. The method for detecting small components of an electric energy meter according to claim 3, wherein: In step 8), the deviation optimization mechanism includes the following steps: 801) Record widget coordinates When the deviation optimization mechanism is activated, the widget image is detected by the simplified object detection neural network model, and a corresponding new anchor box and coordinates are generated. The anchor box coordinates are recorded and mapped to the standard full meter image of the electricity meter to which the widget image belongs, obtaining more accurate coordinates of the upper left and lower right corners of the widget in the standard full meter image. 802) Update the component coordinate set Add the obtained precise coordinates of the widget to the first coordinate set and the second coordinate set of the corresponding widget to form a new cluster set; 803) Clustering and re-anchoring the standard meter model Use the K-means method to re-cluster and obtain new upper left corner cluster center values and lower right corner cluster center values, update the coordinates of all component anchor boxes, and thus update the standard electricity meter model.