An intelligent detection method for appearance defects of an electric energy meter based on deep learning

CN122597280APending Publication Date: 2026-08-18MARKETING SERVICE CENT OF STATE GRID LIAONING ELECTRIC POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610637976.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-11
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]传统电能表外观缺陷检测以人工目视检测为主,存在检测标准一致性差、易受检测人员主观状态与疲劳度影响、漏检误检率高、检测速度慢等缺陷,已无法适配规模化量产的全量检测需求

Benefits of technology

[0014] This invention extracts suspected defect areas from the appearance image data of target energy meters using a deep learning model, enabling rapid filtering of defect-free background areas and initial location of defect targets. This narrows the processing scope of subsequent feature analysis and improves the efficiency of the initial defect screening stage. It calculates the initial defect suspicion level by extracting local texture features and illumination interference features from suspected defect areas, and corrects the initial suspicion level based on the reflection impact level. This effectively eliminates illumination interference and quantifies the defect suspicion level, reducing the probability of false positives and false negatives, thus minimizing invalid re-inspection operations and improving the execution efficiency of the defect judgment stage. Furthermore, it automatically identifies the defect type of the actual defect area through a defect classification network, automatically calculates the overall health index of the energy meter based on the defect type and area proportion, and completes the interception and re-inspection judgment. Simultaneously, it analyzes the core causes of defects based on defect location distribution characteristics to generate production line adjustment strategies. This achieves full automation of the defect classification, quality grading, re-inspection judgment, and root cause optimization process, replacing manual operations and reducing defective product output from the source, improving the batch processing efficiency of the entire inspection process and the overall production line turnover efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597280A_ABST
    Figure CN122597280A_ABST
Patent Text Reader

Abstract

The application provides an electric energy meter appearance defect intelligent detection method based on deep learning. Applied to the field of machine vision and artificial intelligence defect detection technology, the method comprises the following steps: collecting an appearance image of a target electric energy meter, and extracting a plurality of suspected defect regions through a deep learning model; extracting local texture features and illumination interference features of each suspected defect region, and calculating an initial defect suspicion degree; evaluating an image reflection influence level based on the illumination interference features, correcting the initial defect suspicion degree to obtain a target defect suspicion degree, and screening out real defect regions exceeding a preset threshold; inputting the real defect regions into a defect classification network to determine a defect type, combining the defect type and an area proportion to calculate an overall health index of the electric energy meter, and comparing the threshold to determine whether to intercept for rechecking; when intercepting, judging a defect core cause based on defect position distribution features, and generating a production line adjustment strategy. In this way, the electric energy meter appearance defect detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision and artificial intelligence defect detection technology, and in particular to an intelligent detection method for appearance defects of electricity meters based on deep learning. Background Technology

[0002] As the core legal metering instrument for electricity trade settlement in the power system, the appearance quality of electricity meters directly affects the product's metering accuracy, operational reliability, and service life, making it a crucial aspect of quality control before shipment. With the comprehensive advancement of smart grid construction in my country, the market demand and production capacity of electricity meters continue to rise, placing stringent requirements on the accuracy, efficiency, and intelligence level of appearance defect detection.

[0003] Traditional methods for inspecting the appearance of electricity meters rely primarily on manual visual inspection. These methods suffer from poor consistency in inspection standards, susceptibility to the subjective state and fatigue of inspectors, high rates of missed and false detections, and slow inspection speeds, making them unsuitable for the full-scale inspection needs of mass production. Existing deep learning-based appearance inspection solutions mostly identify defects directly from the entire image, failing to adequately consider the light interference caused by the highly reflective nature of the electricity meter casing. This leads to the misidentification of reflective areas as defects. Furthermore, the lack of multi-dimensional feature verification and dynamic correction of suspected defect areas results in a persistently high false detection rate. This necessitates significant manpower for secondary verification and prevents the use of inspection results to optimize production line processes, ultimately leading to low efficiency in electricity meter appearance defect inspection. Summary of the Invention

[0004] To address the problems existing in the prior art, this invention provides a deep learning-based intelligent detection method for appearance defects in electricity meters. The method includes: The appearance image data of the target electricity meter is collected, and several suspected defect areas are extracted from the appearance image data based on a deep learning model; for each suspected defect area, local texture features and illumination interference features are extracted to calculate the initial defect suspicion of each suspected defect area. The reflection impact level in the appearance image data is evaluated based on the light interference characteristics, and the initial defect suspicion level is corrected according to the reflection impact level to obtain the target defect suspicion level. Determine whether the suspected defect level of each suspected defect region is greater than a preset defect confirmation threshold; if it is greater than the defect confirmation threshold, then determine that the corresponding suspected defect region is a real defect region; input each real defect region into a defect classification network to determine the corresponding defect type. The overall health index of the target energy meter is calculated based on the defect type and area ratio of each real defect area. The overall health index is compared with the health standard threshold to determine whether to intercept and re-inspect the target energy meter. When determining to intercept and re-inspect, the core cause of the defect is determined based on the positional distribution characteristics of the real defect area in the appearance image data to generate a production line adjustment strategy.

[0005] Further, the calculation of the initial defect suspicion level for each of the suspected defect regions includes: The maximum grayscale gradient of each of the suspected defect regions is determined as the texture abruptness of the local texture feature; Determine the pixel ratio of the number of overexposed pixels to the total number of pixels in each of the suspected defect areas, and determine the pixel ratio as the reflectance ratio of the illumination interference feature; The ratio of the texture abruptness to the preset abruptness benchmark value is used as the first suspected component; The ratio of the reflectivity to the preset reflectivity benchmark value is used as the second suspected component. The first suspected component and the second suspected component are assigned corresponding weights and then summed using a weighted summation method. The weighted summation result is determined as the initial defect suspicion level.

[0006] Furthermore, obtaining the suspected level of the target defect includes: When the reflectivity ratio is greater than or equal to a preset ratio threshold, the reflectivity impact level of the appearance image data is classified as a strong reflectivity level; the strong reflectivity penalty coefficient is retrieved, and the initial defect suspicion is reduced based on the strong reflectivity penalty coefficient to obtain the target defect suspicion, wherein the reduction in the initial defect suspicion is positively correlated with the reflectivity ratio; When the reflectivity ratio is less than the preset ratio threshold, the reflectivity level of the appearance image data is classified as a weak reflectivity level; the initial defect suspicion level is directly determined as the target defect suspicion level.

[0007] Furthermore, the method also includes: Within a preset time window, obtain the number of false alarms for the real defect area that was marked as a false alarm after re-inspection; The false detection rate is calculated based on the number of false alarms and the total number of actual defect areas. The false detection rate is compared with the preset tolerance false detection rate; if the false detection rate is greater than the preset tolerance false detection rate, the defect confirmation threshold is increased, and the increase in the defect confirmation threshold is directly proportional to the difference between the false detection rate and the preset tolerance false detection rate.

[0008] Furthermore, determining the corresponding defect type includes: Extract the geometric contour of the actual defect region; The morphological compactness is determined based on the aspect ratio and curvature of the geometric contour. If the shape compactness is less than a preset compactness threshold, and the length of the dominant extension direction of the geometric shape contour is greater than the length threshold, then the defect type is determined to be a scratch defect. If the morphological compactness is greater than or equal to the preset compactness threshold, the defect type is determined to be a stain defect based on the color distribution characteristics of the actual defect area.

[0009] Furthermore, the calculation of the overall health index of the target energy meter based on the defect type and area proportion of each actual defect area includes: Different initial risk factors are assigned to the scratch defects and stain defects; For each of the stated real defect areas, calculate the area ratio of its area to the total area of ​​the appearance image data; Multiply the initial risk coefficient corresponding to each real defect region by its corresponding area ratio to obtain the independent risk value of each real defect region; The total risk value is obtained by summing the independent risk values ​​of all real defect areas. The difference between the preset maximum health score and the total risk score is determined as the overall health index.

[0010] Further, based on the comparison results between the overall health index and the health standard threshold, it is determined whether to intercept and re-inspect the target electricity meter, including: If the overall health index is less than the health standard threshold, the target energy meter is determined to have an appearance problem, and the target energy meter is intercepted for re-inspection. The cumulative interception rate of the intercepted target energy meter in the same production batch is recorded. If the cumulative interception rate continuously exceeds the warning interception rate threshold, the production line is determined to be in an abnormal state and a line stop alarm is triggered. If the overall health index is greater than or equal to the health standard threshold, the target electricity meter is deemed to be qualified in appearance and is released.

[0011] Furthermore, the determination of the core cause of the defect based on the positional distribution characteristics of the actual defect area in the appearance image data includes: The appearance image data is divided into edge regions and center regions, and the center coordinates of each of the actual defect regions are determined. When the center coordinates of a predetermined number of the actual defect areas are concentrated in the edge area, and the defect type is mainly the scratch defect, then the core cause of the defect is determined to be mechanical friction during the assembly process of the electricity meter casing. When the center coordinates of a predetermined number of the actual defect areas are dispersed in the central area, and the defect type is mainly the stain defect, then the core cause of the defect is determined to be dust pollution in the production environment or spray liquid dripping.

[0012] Furthermore, a production line adjustment strategy is generated, including: If the core cause is mechanical friction, then a first production line adjustment strategy is generated, which includes increasing the assembly fixture clearance parameter and reducing the assembly actuator running speed. If the core cause is dust pollution or spray liquid dripping, a second production line adjustment strategy is generated, which includes improving the air purification level of the workshop and shortening the cleaning cycle of the spraying equipment. The first production line adjustment strategy or the second production line adjustment strategy is sent to the production line control center to correct the parameters of the automated equipment.

[0013] Furthermore, the method also includes: During the re-inspection process, the appearance image data that is determined to be falsely detected or missed is collected, and the corresponding local texture features and illumination interference features are extracted. The appearance image data that is determined to be falsely detected or missed is added as a difficult sample to the historical sample library to update the historical sample library; If the proportion of difficult samples is greater than the preset sample proportion threshold, then new local texture features are extracted from the difficult samples, and the weights corresponding to the first suspected component and the second suspected component are recalculated based on the new local texture features. The deep learning model with updated weights is then sent to the edge computing node to replace the old model.

[0014] This invention extracts suspected defect areas from the appearance image data of target energy meters using a deep learning model, enabling rapid filtering of defect-free background areas and initial location of defect targets. This narrows the processing scope of subsequent feature analysis and improves the efficiency of the initial defect screening stage. It calculates the initial defect suspicion level by extracting local texture features and illumination interference features from suspected defect areas, and corrects the initial suspicion level based on the reflection impact level. This effectively eliminates illumination interference and quantifies the defect suspicion level, reducing the probability of false positives and false negatives, thus minimizing invalid re-inspection operations and improving the execution efficiency of the defect judgment stage. Furthermore, it automatically identifies the defect type of the actual defect area through a defect classification network, automatically calculates the overall health index of the energy meter based on the defect type and area proportion, and completes the interception and re-inspection judgment. Simultaneously, it analyzes the core causes of defects based on defect location distribution characteristics to generate production line adjustment strategies. This achieves full automation of the defect classification, quality grading, re-inspection judgment, and root cause optimization process, replacing manual operations and reducing defective product output from the source, improving the batch processing efficiency of the entire inspection process and the overall production line turnover efficiency.

[0015] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0016] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. The drawings are provided for a better understanding of the invention and are not intended to limit the scope of the invention. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein: Figure 1 A flowchart illustrating a deep learning-based intelligent detection method for appearance defects in electricity meters, according to an embodiment of the present invention, is shown. Figure 2 A detailed flowchart illustrating the acquisition of the suspected defect level in a deep learning-based intelligent detection method for the appearance defects of electricity meters according to an embodiment of the present invention is shown. Figure 3 A detailed flowchart illustrating the determination of the corresponding defect type using a deep learning-based intelligent detection method for the appearance defects of electricity meters according to an embodiment of the present invention is shown. Figure 4 The diagram illustrates a detailed process of a deep learning-based intelligent detection method for appearance defects in electricity meters, according to an embodiment of the present invention, in determining whether to intercept and re-inspect the target electricity meter based on a comparison between the overall health index and a health standard threshold. Figure 5 The diagram illustrates a detailed process of a deep learning-based intelligent detection method for appearance defects in electricity meters, based on an embodiment of the present invention, to determine the core cause of the defect based on the positional distribution characteristics of the actual defect area in the appearance image data. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0019] Figure 1 A flowchart of a deep learning-based intelligent detection method for appearance defects in electricity meters according to an embodiment of the present invention is shown. The method includes: S101, Collect the appearance image data of the target electricity meter, and extract several suspected defect areas in the appearance image data based on a deep learning model; for each suspected defect area, extract local texture features and illumination interference features to calculate the initial defect suspicion degree of each suspected defect area. In some embodiments, the deep learning model is a pre-trained defect region candidate network, the appearance image data is a panoramic image of the multi-faceted appearance of the electricity meter after distortion correction and grayscale normalization preprocessing, and the suspected defect region is a region of interest output by the model that has feature differences from the defect-free standard electricity meter template.

[0020] In some embodiments, the local texture feature is a feature quantity that characterizes the texture difference between the suspected defect area and the surrounding normal area, and the illumination interference feature is a feature quantity that characterizes the influence of ambient light and the mirror reflection of the electricity meter casing on the suspected defect area.

[0021] S102, evaluate the reflection impact level in the appearance image data based on the light interference characteristics, and correct the initial defect suspicion level according to the reflection impact level to obtain the target defect suspicion level; In some embodiments, the reflection impact level is graded according to the degree of influence of light interference characteristics on the identification of defect features, and the correction process is to calibrate the initial defect suspicion level based on the correction coefficient matched with the reflection impact level, so as to eliminate the misjudgment of suspicion level caused by reflection.

[0022] S103, determine whether the target defect suspicion degree of each suspected defect region is greater than a preset defect confirmation threshold; if it is greater than the defect confirmation threshold, determine that the corresponding suspected defect region is a real defect region; input each real defect region into the defect classification network to determine the corresponding defect type. In some embodiments, the defect confirmation threshold is a pre-calibrated critical value based on the false detection rate constraint of defect-free energy meter samples, used to distinguish between real defects and false defects caused by normal textures and environmental interference.

[0023] In some embodiments, the defect classification network is a pre-trained multi-class convolutional neural network, whose training sample set covers labeled samples of all types of defects in the appearance of the electricity meter.

[0024] S104, calculate the overall health index of the target energy meter based on the defect type and area ratio of each real defect area, and determine whether to intercept and re-inspect the target energy meter based on the comparison result of the overall health index and the health standard threshold; when determining to intercept and re-inspect, determine the core cause of the defect based on the positional distribution characteristics of the real defect area in the appearance image data, so as to generate a production line adjustment strategy.

[0025] In some embodiments, the overall health index is a numerical value that quantifies the impact of appearance defects of the electricity meter on product quality, and the health standard threshold is the minimum health index critical value that meets the factory appearance quality standard of the electricity meter.

[0026] In some embodiments, the location distribution characteristics are the spatial clustering characteristics and regional distribution patterns of the actual defect area in the appearance image of the electricity meter, the core cause is an abnormal factor in the production process that is strongly related to the occurrence of defects, and the production line adjustment strategy is an executable adjustment plan that can be directly applied to the production line equipment or production environment in response to the abnormal factor.

[0027] In some embodiments, calculating the initial defect suspicion degree of each of the suspected defect regions includes: determining the maximum gray-level gradient of each of the suspected defect regions as the texture abruptness of the local texture feature; wherein the maximum gray-level gradient is the peak value of the spatial change rate of the gray-level values ​​of pixels within the suspected defect region, used to characterize the degree of texture abruptness within the region; determining the pixel ratio of the number of overexposed pixels to the total number of pixels within each of the suspected defect regions, and determining the pixel ratio as the reflectivity of the illumination interference feature; wherein the overexposed pixels are pixels whose gray-level values ​​exceed a preset overexposed threshold value, the preset overexposed threshold value being a threshold value calibrated based on the gray-level distribution characteristics of a defect-free standard image, distinguishing between normal bright pixels and overexposed reflective pixels; and comparing the texture abruptness with a preset abruptness benchmark value. The ratio is used as the first suspected component; wherein, the preset abrupt change benchmark value is the statistical mean of the texture abrupt change degree of the normal appearance area of ​​the defect-free energy meter, which is used as a reference benchmark for the degree of texture anomaly; the ratio of the reflectivity ratio to the preset reflectivity ratio benchmark value is used as the second suspected component; wherein, the preset reflectivity ratio benchmark value is the statistical mean of the reflectivity ratio of the normal appearance area of ​​the defect-free energy meter under standard lighting conditions, which is used as a reference benchmark for the degree of reflectivity interference; the first suspected component and the second suspected component are assigned corresponding weights and weighted summation is performed, and the weighted summation result is determined as the initial defect suspicion degree; wherein, the corresponding weights are weighting coefficients obtained by pre-training based on the feature discrimination of defect samples and interference samples, which are used to balance the contribution ratio of texture anomaly and reflectivity interference to the defect suspicion degree. According to embodiments of the present invention, by quantifying the texture abruptness and reflectivity characteristics, a multi-dimensional quantitative characterization of defect suspicion is achieved, thereby improving the accuracy of initial defect judgment; by splitting the two suspected components of texture and illumination, the decoupling analysis of defect features and interference features is achieved, thereby improving the discriminativeness of suspicion calculation; and by using a weighted summation of the two components, the standardized output of the initial defect suspicion is achieved, thereby improving the stability of initial defect screening.

[0028] For example, for a single suspected defective area with a size of 128×128 pixels and a total of 16384 pixels, the peak value of the spatial change rate of pixel grayscale values ​​in this area was calculated to be 48, which was determined as the texture abruptness of this area. Based on the grayscale distribution characteristics of the defect-free standard energy meter image, the preset overexposure threshold was set to grayscale 230. A total of 1474 overexposed pixels with grayscale values ​​exceeding 230 were found in this area, and the reflectivity was calculated to be 1474 / 16384≈9%. The texture abruptness of the normal appearance area of ​​the defect-free energy meter was then taken. The statistical mean of 12 was used as the preset threshold for abrupt change, and the first suspected component was calculated to be 48 / 12=4.0. The statistical mean of the reflectivity ratio of the normal appearance area of ​​a defect-free energy meter under standard lighting conditions was taken as 3% as the preset threshold for reflectivity ratio, and the second suspected component was calculated to be 9% / 3%=3.0. Based on the feature discrimination between defective samples and interference samples, the weights of the first suspected component and the second suspected component were pre-trained to be 0.6 and 0.4 respectively. The two suspected components were weighted and summed to obtain the initial defect suspicion degree as 4.0×0.6 + 3.0×0.4=3.6.

[0029] In some embodiments, Figure 2 This document illustrates a detailed flowchart of a deep learning-based intelligent detection method for appearance defects in electricity meters, according to an embodiment of the present invention, for obtaining the suspected level of a target defect. The method includes: classifying the reflection impact level of the appearance image data into a strong reflection level when the reflection ratio is greater than or equal to a preset ratio threshold; wherein the preset ratio threshold is a critical value used to define the boundary between strong and weak reflection, determined based on the statistical characteristics of the reflection ratio of falsely detected samples under strong reflection conditions; retrieving a strong reflection penalty coefficient, and reducing the initial defect suspected level based on the strong reflection penalty coefficient to obtain the suspected level of the target defect, wherein the initial defect... The reduction in the likelihood of defect is positively correlated with the reflectivity ratio. The strong reflectivity penalty coefficient is a correction coefficient less than 1, and its value decreases linearly with the increase of the reflectivity ratio, thus achieving a positive correlation between the reduction in the initial likelihood of defect and the reflectivity ratio. When the reflectivity ratio is less than a preset threshold, the reflectivity impact level of the appearance image data is classified as a weak reflectivity level. The initial likelihood of defect is directly determined as the target likelihood of defect. The weak reflectivity level is an illumination level where reflectivity interference has no significant impact on defect feature recognition, and no correction is needed for the initial likelihood of defect. According to this embodiment, by classifying reflectivity impact levels using a reflectivity ratio threshold, the intensity of illumination interference is graded, improving the efficiency of reflectivity interference identification. Dynamic correction of the penalty coefficient in strong reflectivity scenarios achieves quantitative cancellation of the impact of illumination interference on likelihood, reducing the probability of false detection caused by strong light. Direct value selection in weak reflectivity scenarios enables efficient output of likelihood in interference-free scenarios, improving the operational efficiency of the detection process.

[0030] For example, based on the statistical characteristics of the reflectivity of falsely detected samples under strong reflective conditions, a preset threshold of 8% is calibrated. The reflectivity of the aforementioned suspected defect area is 9%, satisfying that the reflectivity is greater than or equal to the preset threshold. Therefore, the reflectivity impact level of this appearance image data is classified as strong reflectivity. The linearly calibrated strong reflectivity penalty coefficient is retrieved. The calibration rule is that the penalty coefficient is 0.9 when the reflectivity is 8%, and the penalty coefficient decreases linearly by 0.05 for every 1 percentage point the reflectivity exceeds the threshold. The corresponding strong reflectivity penalty coefficient for 9% reflectivity is 0.85. Based on this penalty coefficient, the initial defect suspicion level of 3.6 is corrected to obtain the target defect suspicion level of 3.6 × 0.85 = 3.06. If the reflectivity of a suspected defect area is 7%, satisfying that the reflectivity is less than the preset threshold, the reflectivity impact level is classified as weak reflectivity, and its initial defect suspicion level of 3.6 is directly determined as the target defect suspicion level.

[0031] In some embodiments, the method further includes: within a preset time window, acquiring the number of false alarms of the real defect areas that have been marked as false alarms after re-inspection; wherein the preset time window is a fixed-duration statistical period for collecting false alarm data, and the false alarm is the detection result of misjudging a normal area without defects as a real defect area; calculating a false alarm rate based on the number of false alarms and the total number of real defect areas; wherein the false alarm rate is the ratio of the number of false alarms to the total number of real defect areas within the preset time window, used to quantify the degree of misjudgment by the detection model; comparing the false alarm rate with a preset tolerance false alarm rate; if the false alarm rate > the preset tolerance false alarm rate, increasing the defect confirmation threshold, and the increase in the defect confirmation threshold is directly proportional to the difference between the false alarm rate and the preset tolerance false alarm rate; wherein the preset tolerance false alarm rate is the maximum acceptable false alarm rate threshold that meets the production line detection efficiency requirements, and the direct proportionality is a linear relationship where the increment of the defect confirmation threshold and the difference between the false alarm rate and the tolerance threshold increase are in a fixed proportion, used to achieve adaptive closed-loop adjustment of the threshold. According to embodiments of the present invention, by statistically analyzing false detection data within a preset time window, periodic quantitative evaluation of detection effectiveness is achieved, thereby improving the timeliness of algorithm performance monitoring; by comparing the false detection rate with the tolerance threshold, closed-loop feedback control of detection accuracy is achieved, reducing the probability of batch false detections; and by adjusting the threshold proportionally to the difference, dynamic adaptation of defect judgment criteria is achieved, thereby improving the environmental robustness of the detection algorithm.

[0032] For example, a preset time window is set to 24 hours of continuous production line operation. Within this window, a total of 1200 actual defect areas are detected. After manual re-inspection, 42 false alarms are marked as false detections, resulting in a false detection rate of 42 / 1200 = 3.5%. A preset tolerance false detection rate of 2.0% is set to meet the production line's detection efficiency requirements. After comparison, the false detection rate is greater than the preset tolerance false detection rate. The calibrated positive proportional relationship is that for every 0.1 percentage point increase in the false detection rate beyond the tolerance threshold, the defect confirmation threshold increases by 0.02. The difference between the current false detection rate and the tolerance threshold is 1.5 percentage points, so the increment of the defect confirmation threshold is calculated to be (1.5 / 0.1) × 0.02 = 0.3. The original defect confirmation threshold was 2.5, and after adjustment, it is updated to 2.5 + 0.3 = 2.8.

[0033] In some embodiments, Figure 3 This document illustrates a detailed flowchart of a deep learning-based intelligent detection method for electrical meter appearance defects, illustrating the determination of the corresponding defect type. The method includes: extracting the geometric contour of the actual defect region; wherein the geometric contour is a closed outer boundary contour of the actual defect region extracted using an edge detection algorithm, used to characterize the geometric features of the defect; determining the shape compactness based on the aspect ratio and curvature of the geometric contour; wherein the shape compactness is a feature value quantifying the regularity and clustering of the defect contour, calculated comprehensively based on the dispersion of the aspect ratio of the bounding rectangle and the contour curvature; if the shape compactness < If a preset compactness threshold is set, and the length of the dominant extension direction of the geometric contour is greater than the length threshold, then the defect type is determined to be a scratch defect. The preset compactness threshold is a critical value distinguishing between linear and planar defects; the length threshold is a critical value calibrated based on the minimum effective length of scratch defects on the appearance of an energy meter; and the dominant extension direction is the direction of maximum variance obtained from principal component analysis of the contour. If the shape compactness is greater than or equal to the preset compactness threshold, the defect type is determined to be a stain defect based on the color distribution characteristics of the actual defect area. The color distribution characteristics are the differences in the mean and variance of the color between the actual defect area and the surrounding normal area. According to this embodiment of the invention, by extracting the geometric contour of the defect area, the morphological features of the defect are extracted, improving the feature support for defect classification. By calculating the shape compactness through contour parameters, the morphological quantification of scratch and stain defects is achieved, improving the efficiency of defect classification. By combining multi-dimensional thresholds, the classification of two core types of defects is achieved, improving the accuracy of defect type identification.

[0034] For example, for a real defect region with a target defect suspicion score of 3.06 that is greater than the defect confirmation threshold of 2.8, the closed outer boundary contour of this region is extracted using the Canny edge detection algorithm to obtain the geometric contour. The outer rectangle of this contour has dimensions of 240 pixels × 18 pixels, an aspect ratio of 13.33, and a coefficient of variation of the contour curvature of 0.12. The overall calculated shape compactness is 0.18. The preset compactness threshold is set to 0.3, and the length threshold is 50 pixels. Principal component analysis shows that the length of the dominant extension direction of this contour is 240 pixels. If the foot shape compactness is less than the preset compactness threshold and the length in the dominant extension direction is greater than the length threshold, the defect type is determined to be a scratch defect. For another real defect area, the extracted geometric shape contour outer rectangle size is 32 pixels × 28 pixels, the aspect ratio is 1.14, the contour curvature dispersion coefficient is 0.08, and the comprehensive calculation yields a shape compactness of 0.92, which satisfies the condition that shape compactness is greater than or equal to the preset compactness threshold. Furthermore, the difference in grayscale mean between this area and the surrounding normal area is 12, and the difference in grayscale variance is 8. Based on this color distribution characteristic, the defect type is determined to be a stain defect.

[0035] In some embodiments, calculating the overall health index of the target energy meter based on the defect type and area ratio of each real defect area includes: assigning different initial risk coefficients to the scratch defects and stain defects; wherein, the initial risk coefficient is a weighted coefficient pre-calibrated based on the degree of influence of different defect types on the appearance quality and performance of the energy meter; calculating the area ratio of each real defect area to the total area of ​​the appearance image data; wherein, the area is the pixel area of ​​the real defect area, and the total area of ​​the appearance image data is the total pixel area of ​​the effective detection area of ​​the energy meter appearance; and assigning each real defect area... The initial risk coefficient corresponding to a domain is multiplied by its corresponding area proportion to obtain the independent risk value of each actual defect area; wherein, the independent risk value is a quantitative value of the impact of a single defect on the overall health status of the electricity meter; the independent risk values ​​of all actual defect areas are summed to obtain the total risk value; wherein, the total risk value is a quantitative total value of the comprehensive impact of all appearance defects of the electricity meter; the difference between the preset full-score health value and the total risk value is determined as the overall health index; wherein, the preset full-score health value is the maximum health index value corresponding to an electricity meter without any appearance defects, which is used as a quantitative benchmark for the health level. According to the embodiments of the present invention, by assigning differentiated risk coefficients to different defect types, the graded quantification of the degree of defect hazard is realized, improving the rationality of health assessment; by calculating the independent risk value through the defect area proportion, the quantification of the hazard of a single defect is realized, improving the precision of health index calculation; by converting the difference in total risk values ​​into a health index, the standardized quantitative assessment of the appearance quality of the electricity meter is realized, improving the uniformity of qualification judgment.

[0036] For example, based on the degree of impact of defects on the appearance quality of the electricity meter, an initial risk factor of 1200 is pre-assigned to scratch defects and an initial risk factor of 800 is pre-assigned to stain defects; the image size of the effective detection area of ​​the target electricity meter appearance is 2048×1536 pixels, and the total area is 3,145,728 pixels; the electricity meter contains 2 scratch defects and 1 stain defect. The pixel area of ​​the first scratch defect is 4320, and the calculated area ratio is 4320 / 3145,728≈0.137%, corresponding to an independent risk value of 1200×0.137%≈1.644; The second scratch defect has a pixel area of ​​2700, with an area ratio of approximately 0.0858%, corresponding to an independent risk value of 1200 × 0.0858% ≈ 1.03; the stain defect has a pixel area of ​​896, with an area ratio of approximately 0.0285%, corresponding to an independent risk value of 800 × 0.0285% ≈ 0.228; summing all the independent risk values, the total risk value is 1.644 + 1.03 + 0.228 ≈ 2.902; setting the preset full health value to 100, the overall health index of the target energy meter is calculated to be 100 - 2.902 ≈ 97.1.

[0037] In some embodiments, Figure 4 This document illustrates a detailed flowchart of a deep learning-based intelligent detection method for appearance defects in electricity meters, based on an embodiment of the present invention. The method determines whether to intercept and re-inspect a target electricity meter based on a comparison between an overall health index and a health standard threshold. The process includes: if the overall health index is less than the health standard threshold, the target electricity meter is determined to have an appearance problem, and interception and re-inspection are determined. The cumulative interception rate of the intercepted target electricity meters in the same production batch is recorded. If the cumulative interception rate continuously exceeds a warning interception rate threshold, the production line is determined to be in an abnormal state, and a production line stop alarm is triggered. The cumulative interception rate is the ratio of the number of intercepted electricity meters to the total number of meters detected in the same production batch. The warning interception rate threshold is the maximum acceptable interception rate threshold that meets production yield requirements. "Continuously exceeding" refers to the situation where the interception rate of a consecutive preset number of detected samples exceeds the threshold. If the overall health index is greater than or equal to the health standard threshold, the target electricity meter is determined to be aesthetically qualified and released. "Release" means releasing the aesthetically qualified electricity meter to the next production stage without interception. According to embodiments of the present invention, by comparing the health index with the standard threshold, the qualification of a single energy meter can be quickly determined, thereby improving the efficiency of production line inspection; by statistically monitoring the cumulative batch interception rate, the quality status of the production line can be tracked in real time, thereby improving the early warning capability of batch quality problems; by triggering a stop alarm when the interception rate exceeds the threshold, the abnormality of the production line can be controlled in a timely manner, thereby reducing the probability of batch production of non-conforming products.

[0038] For example, the health standard threshold for meeting the factory appearance quality standard of electricity meters is 95.0; the overall health index of the aforementioned target electricity meter is 97.1, which meets the requirement that the overall health index is ≥ the health standard threshold, so the electricity meter is deemed to be qualified in appearance and is released to the next production stage; if the overall health index of a target electricity meter is 92.3, which meets the requirement that the overall health index is < the health standard threshold, it is determined that it has an appearance problem and is intercepted for re-inspection; for electricity meters in the same production batch, the warning interception rate threshold is set at 3.5%, and the preset number of samples that continuously exceed the threshold is 3 consecutive sub-batches (100 units per sub-batch). The cumulative interception rates of the 3 consecutive sub-batches of this batch are 4.2%, 4.5%, and 4.8%, respectively, all exceeding the warning interception rate threshold, so the production line is determined to be in an abnormal state and a shutdown alarm is triggered.

[0039] In some embodiments, Figure 5This document illustrates a detailed flowchart of a deep learning-based intelligent detection method for appearance defects in electricity meters, based on an embodiment of the present invention. The method determines the core cause of the defect based on the positional distribution characteristics of the actual defect areas in the appearance image data. The method includes: dividing the appearance image data into edge regions and a central region, and determining the center coordinates of each actual defect region; wherein the edge region is a ring-shaped region of a predetermined width near the assembly boundary of the outer casing in the electricity meter appearance image, the central region is the internal region enclosed by the edge regions, and the center coordinates are the geometric center pixel coordinates of the outline of the actual defect region; when a predetermined number of the center coordinates of the actual defect regions are concentrated in the edge region, and the defect type is mainly the scratch defect, the core cause of the defect is determined to be the assembly process of the electricity meter casing. Mechanical friction; wherein, the predetermined number is the minimum effective sample size determined based on the statistical characteristics of the number of defects in a single energy meter, the concentration in the edge area means that the proportion of the actual defect area where the center coordinate point falls into the edge area exceeds a preset proportion threshold, and the defect type is mainly scratch defects, meaning that the proportion of scratch defects in the total number of defects exceeds a preset proportion threshold; when the center coordinate points of the predetermined number of actual defect areas are dispersed in the central area, and the defect type is mainly stain defects, then it is determined that the core cause of the defect is dust pollution or spray liquid dripping in the production environment; wherein, the dispersion in the central area means that the actual defect areas where the center coordinate point falls into the central area do not have significant spatial aggregation characteristics, and the defect type is mainly stain defects, meaning that the proportion of stain defects in the total number of defects exceeds a preset proportion threshold. According to embodiments of the present invention, by dividing the image edge and center regions, a zonal quantitative analysis of defect location distribution is achieved, thereby improving the accuracy of defect cause localization; by feature matching of edge-concentrated scratch defects, the cause of assembly mechanical friction is determined, thereby improving the efficiency of production line problem tracing; and by feature matching of center-dispersed stain defects, the cause of production environment pollution is quickly identified, thereby improving the accuracy of defect root cause analysis.

[0040] For example, for an image of an electricity meter's appearance, a ring-shaped region 100 pixels wide from the image boundary is defined as the edge region, and the area enclosed by the edge region is defined as the center region. The geometric center pixel coordinates of the contours of each real defect region are calculated. A predetermined number of defects are calibrated, with a preset percentage threshold of 70% and a preset proportion threshold of 60%. In a batch of 12 intercepted electricity meters, 36 real defects were detected. Among them, the center coordinates of 29 defects fell into the edge region, accounting for 80.5%, exceeding the preset percentage threshold. Furthermore, 25 of these defects were scratch defects, accounting for 69.4% of the total number of defects, exceeding the preset proportion threshold. The first batch of 15 intercepted electricity meters had 42 real defects detected. Among them, the center coordinates of 33 defects fell into the central area and there was no significant spatial aggregation. Among them, 28 were stain defects, accounting for 66.7% of the total number of defects, which exceeded the preset proportion threshold. The second batch of 15 intercepted electricity meters had 42 real defects detected. Among them, the center coordinates of 33 defects fell into the central area and there was no significant spatial aggregation. Among them, 28 were stain defects. The number of stain defects accounted for 66.7% of the total number of defects, which exceeded the preset proportion threshold. The third batch of 15 intercepted electricity meters had 42 real defects detected. Among them, the center coordinates of 33 defects fell into the central area and there was no significant spatial aggregation. Among them, 28 were stain defects. The number of stain defects accounted for 66.7% of the total number of defects, which exceeded the preset proportion threshold. Among them, the number of stain defects fell into the central area and there was no preset proportion threshold. The core cause of the defects was dust pollution in the production environment or spray liquid dripping.

[0041] In some embodiments, generating a production line adjustment strategy includes: if the core cause is mechanical friction, generating a first production line adjustment strategy that includes increasing the assembly fixture clearance parameter and reducing the assembly actuator operating speed; wherein, the first production line adjustment strategy is a parameter adjustment scheme formulated for mechanical friction defects in the assembly process, the increasing the assembly fixture clearance parameter means increasing the fit clearance between the fixture and the energy meter housing within the allowable range of assembly tolerances, and the reducing the assembly actuator operating speed means reducing the relative movement speed between the fixture and the housing during the assembly process; if the core cause is dust pollution or spray liquid dripping, generating a strategy that includes improving the workshop air purification level and shortening the cleaning time of the spraying equipment. The second production line adjustment strategy for the cleaning cycle; wherein, the second production line adjustment strategy is a control and adjustment plan formulated for pollution defects in the production environment and spraying process, wherein improving the air purification level of the workshop means increasing the air filtration efficiency and air exchange frequency of the cleanroom where the production line is located, and shortening the cleaning cycle of the spraying equipment means reducing the time interval between two adjacent cleaning and maintenance within the equipment maintenance specifications; the first production line adjustment strategy or the second production line adjustment strategy is sent to the production line control center for automatic equipment parameter correction; wherein, the production line control center is a centralized control system for automated production line equipment, which can receive adjustment strategies and automatically complete the parameter configuration update of the corresponding equipment. According to the embodiments of the present invention, by matching different defect root causes to generate differentiated adjustment strategies, targeted optimization of production line problems is achieved, improving the efficiency of defect rectification; by locating the adjustment dimensions of equipment and environment, targeted correction of production line parameters is achieved, reducing the recurrence probability of similar defects; by sending the strategy to the production line control center, the automated execution of adjustment actions is achieved, improving the response speed of production line optimization.

[0042] For example, when the core cause of the defect is determined to be mechanical friction, a first production line adjustment strategy is generated: the allowable range of assembly tolerance for the electricity meter casing is 0.3mm-0.8mm, the original assembly fixture clearance parameter is increased from 0.4mm to 0.6mm, and the original assembly actuator running speed is reduced from 120mm / s to 80mm / s; when the core cause of the defect is determined to be dust contamination or spray liquid dripping, a second production line adjustment strategy is generated: the air purification level of the cleanroom where the production line is located is upgraded from Class 10,000 to Class 1,000, the air exchange frequency is increased from 15 times / hour to 25 times / hour, and the cleaning cycle of the original spraying equipment is shortened from 72 hours to 48 hours; the generated first or second production line adjustment strategy is sent to the production line PLC centralized control center, and the control center automatically completes the parameter configuration update of the corresponding assembly equipment, air purification equipment or spraying equipment.

[0043] In some embodiments, the method further includes: during the re-inspection process, collecting the appearance image data that is determined to be falsely detected or missed, and extracting the corresponding local texture features and illumination interference features; wherein, the missed detection is a detection result that misclassifies an area with a real defect as a defect-free normal area, and the extracted features are features of the same dimension and the same calculation rule as the features used in the detection process; adding the appearance image data determined to be falsely detected or missed as difficult samples to the historical sample library to update the historical sample library; wherein, the difficult samples are samples whose model detection results are inconsistent with the manual re-inspection annotation results and are prone to misjudgment, and the historical sample library is used for... The system uses a set of labeled samples for model training and parameter optimization. If the proportion of difficult samples is greater than a preset sample proportion threshold, new local texture features are extracted from the difficult samples. Based on the new local texture features, the weights corresponding to the first suspected component and the second suspected component are recalculated. The deep learning model with updated weights is then distributed to edge computing nodes to replace the old model. The proportion of difficult samples is the ratio of the number of difficult samples to the total number of samples in the updated historical sample library. The preset sample proportion threshold is the minimum difficult sample proportion threshold that triggers model weight optimization. The edge computing node is a computing device deployed on the production line to perform real-time detection tasks. According to this embodiment, by collecting image data of false positives and false negatives and extracting corresponding features, the system collects algorithm defect samples, improving the targeting of model iteration. By updating the sample library with difficult samples, the system continuously optimizes the model training dataset, improving the scene coverage of the sample library. By triggering weight recalculation and model updates with difficult samples, the system achieves self-iterative optimization of the detection algorithm, improving the long-term detection accuracy and robustness of the model.

[0044] For example, during a 30-day manual re-inspection cycle, a total of 186 falsely detected appearance image samples and 74 falsely detected appearance image samples were collected. These samples were processed using the same dimension and calculation rules as the real-time detection process to extract corresponding local texture features and illumination interference features. The 260 falsely detected and falsely detected samples were designated as difficult samples and added to the existing historical sample library of 3200 labeled samples, resulting in a total of 3460 samples in the updated historical sample library. The proportion of difficult samples in the updated sample library was calculated to be approximately 7.51% (260 / 3460), and the preset sample proportion threshold was set to 5%, satisfying the condition that the proportion of difficult samples > the preset sample proportion threshold. Local texture features of the difficult samples were extracted, and the model was retrained and optimized to update the weights of the first suspected component to 0.65 and the second suspected component to 0.35. The updated deep learning model was then deployed to four edge computing industrial control computers on the production line to perform real-time detection tasks, completing the replacement and update of the old model.

[0045] It should be understood that the various forms of the process described above can be used to rearrange, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0046] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A deep learning-based intelligent detection method for appearance defects of an electric energy meter, characterized in that, include: Collect the appearance image data of the target electricity meter, and extract several suspected defect areas from the appearance image data based on a deep learning model; For each of the suspected defect regions, local texture features and illumination interference features are extracted to calculate the initial defect suspicion level of each of the suspected defect regions; The reflection impact level in the appearance image data is evaluated based on the light interference characteristics, and the initial defect suspicion level is corrected according to the reflection impact level to obtain the target defect suspicion level. Determine whether the suspected defect level of each of the suspected defect areas is greater than a preset defect confirmation threshold; If the value is greater than the defect confirmation threshold, the corresponding suspected defect area is determined to be a real defect area. Each real defect region is input into the defect classification network to determine the corresponding defect type; The overall health index of the target energy meter is calculated based on the defect type and area ratio of each real defect area, and the interception and re-inspection of the target energy meter is determined based on the comparison result between the overall health index and the health standard threshold. When determining the interception and re-inspection, the core cause of the defect is determined based on the positional distribution characteristics of the actual defect area in the appearance image data, so as to generate a production line adjustment strategy.

2. The deep learning-based electric energy meter appearance defect intelligent detection method according to claim 1, characterized in that, The calculation of the initial defect suspicion level for each of the suspected defect regions includes: The maximum grayscale gradient of each of the suspected defect regions is determined as the texture abruptness of the local texture feature; Determine the pixel ratio of the number of overexposed pixels to the total number of pixels in each of the suspected defect areas, and determine the pixel ratio as the reflectance ratio of the illumination interference feature; The ratio of the texture abruptness to the preset abruptness benchmark value is used as the first suspected component; The ratio of the reflectivity to the preset reflectivity benchmark value is used as the second suspected component. The first suspected component and the second suspected component are assigned corresponding weights and then summed using a weighted summation method. The weighted summation result is determined as the initial defect suspicion level.

3. The intelligent detection method for appearance defects of electricity meters based on deep learning according to claim 2, characterized in that, The acquisition of the target defect suspicion level includes: When the reflectivity ratio is greater than or equal to a preset ratio threshold, the reflectivity impact level of the appearance image data is classified as a strong reflectivity level; the strong reflectivity penalty coefficient is retrieved, and the initial defect suspicion is reduced based on the strong reflectivity penalty coefficient to obtain the target defect suspicion, wherein the reduction in the initial defect suspicion is positively correlated with the reflectivity ratio; When the reflectivity ratio is less than the preset ratio threshold, the reflectivity level of the appearance image data is classified as a weak reflectivity level; the initial defect suspicion level is directly determined as the target defect suspicion level.

4. The intelligent detection method for appearance defects of electricity meters based on deep learning according to claim 3, characterized in that, The method further includes: Within a preset time window, obtain the number of false alarms for the real defect area that was marked as a false alarm after re-inspection; The false detection rate is calculated based on the number of false alarms and the total number of actual defect areas. The false detection rate is compared with the preset tolerance false detection rate; if the false detection rate is greater than the preset tolerance false detection rate, the defect confirmation threshold is increased, and the increase in the defect confirmation threshold is directly proportional to the difference between the false detection rate and the preset tolerance false detection rate.

5. The intelligent detection method for appearance defects of electricity meters based on deep learning according to claim 4, characterized in that, Determining the corresponding defect type includes: Extract the geometric contour of the actual defect region; The morphological compactness is determined based on the aspect ratio and curvature of the geometric contour. If the shape compactness is less than a preset compactness threshold, and the length of the dominant extension direction of the geometric shape contour is greater than the length threshold, then the defect type is determined to be a scratch defect. If the morphological compactness is greater than or equal to the preset compactness threshold, the defect type is determined to be a stain defect based on the color distribution characteristics of the actual defect area.

6. The intelligent detection method for appearance defects of electricity meters based on deep learning according to claim 5, characterized in that, The calculation of the overall health index of the target energy meter based on the defect type and area proportion of each real defect area includes: Different initial risk factors are assigned to the scratch defects and stain defects; For each of the stated real defect areas, calculate the area ratio of its area to the total area of ​​the appearance image data; Multiply the initial risk coefficient corresponding to each real defect region by its corresponding area ratio to obtain the independent risk value of each real defect region; The total risk value is obtained by summing the independent risk values ​​of all real defect areas. The difference between the preset maximum health score and the total risk score is determined as the overall health index.

7. The intelligent detection method for appearance defects of electricity meters based on deep learning according to claim 6, characterized in that, Determining whether to intercept and re-inspect the target electricity meter based on the comparison results between the overall health index and the health standard threshold includes: If the overall health index is less than the health standard threshold, the target energy meter is determined to have an appearance problem, and the target energy meter is intercepted for re-inspection. The cumulative interception rate of the intercepted target energy meter in the same production batch is recorded. If the cumulative interception rate continuously exceeds the warning interception rate threshold, the production line is determined to be in an abnormal state and a line stop alarm is triggered. If the overall health index is greater than or equal to the health standard threshold, the target electricity meter is deemed to be qualified in appearance and is released.

8. The intelligent detection method for appearance defects of electricity meters based on deep learning according to claim 7, characterized in that, The determination of the core cause of the defect based on the positional distribution characteristics of the actual defect area in the appearance image data includes: The appearance image data is divided into edge regions and center regions, and the center coordinates of each of the actual defect regions are determined. When the center coordinates of a predetermined number of the actual defect areas are concentrated in the edge area, and the defect type is mainly the scratch defect, then the core cause of the defect is determined to be mechanical friction during the assembly process of the electricity meter casing. When the center coordinates of a predetermined number of the actual defect areas are dispersed in the central area, and the defect type is mainly the stain defect, then the core cause of the defect is determined to be dust pollution in the production environment or spray liquid dripping.

9. The intelligent detection method for appearance defects of electricity meters based on deep learning according to claim 8, characterized in that, Production line adjustment strategies include: If the core cause is mechanical friction, then a first production line adjustment strategy is generated, which includes increasing the assembly fixture clearance parameter and reducing the assembly actuator running speed. If the core cause is dust pollution or spray liquid dripping, a second production line adjustment strategy is generated, which includes improving the air purification level of the workshop and shortening the cleaning cycle of the spraying equipment. The first production line adjustment strategy or the second production line adjustment strategy is sent to the production line control center to correct the parameters of the automated equipment.

10. The intelligent detection method for appearance defects of electricity meters based on deep learning according to claim 9, characterized in that, The method further includes: During the re-inspection process, the appearance image data that was determined to be falsely detected or missed was collected, and the corresponding local texture features and illumination interference features were extracted. The appearance image data that is determined to be falsely detected or missed is added as a difficult sample to the historical sample library to update the historical sample library; If the proportion of difficult samples is greater than the preset sample proportion threshold, then new local texture features are extracted from the difficult samples, and the weights corresponding to the first suspected component and the second suspected component are recalculated based on the new local texture features. The deep learning model with updated weights is then sent to the edge computing node to replace the old model.