Image recognition-based metering box remote inspection defect identification method
Patent Information
- Application Number
- CN202611130305.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]但在户外运行场景中,计量箱还存在一类现有图像识别方式难以应对的隐性缺陷
[0039]Compared with existing technologies, the beneficial effects of this invention are as follows: By constructing a multi-window clarity time sequence, combined with the determination of abnormal clarity degradation, verification of multi-window time sequence synchronization, and analysis of rate mutation characteristics, this invention solves the problems of existing image recognition technologies being unable to identify uniform water mist condensation in windows and difficult to distinguish between sealing failure and latent defects caused by material aging. This invention requires no additional sensor hardware and can complete defect reasoning based on existing inspection image data, reducing equipment modification costs and maintenance investment. Through spatial consistency verification with dual constraints of direction and amplitude, it avoids the misjudgment defects of single-direction judgment and accurately distinguishes between local anomalies and overall synchronous degradation. Combined with comparative analysis of short-term mutation rates and long-term steady-state degradation rates, it can effectively identify sudden sealing failures and gradual material aging, achieving refined classification and identification of latent defects in metering boxes, and improving the accuracy and practicality of remote intelligent inspection.
Smart Images

Figure CN122928808A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of defect identification technology, specifically to a method for remote inspection defect identification of metering boxes based on image recognition. Background Technology
[0002] As a key terminal device in the power metering system, the metering box mainly consists of a box body, a door, a transparent window, a lock, an anti-counterfeiting seal, and an internal energy meter. The anti-counterfeiting seal is a one-time anti-theft lock accessory, installed at the door lock position; once removed, it cannot be restored, preventing unauthorized opening of the box door and tampering with the metering device. The window is usually made of transparent materials such as acrylic glass and is installed on the door or the front of the box body, allowing maintenance personnel to directly observe the meter's operating status and readings without opening the door.
[0003] In recent years, image intelligent recognition technology has been gradually applied to remote inspection of metering boxes, enabling automatic identification of equipment defects based on on-site captured images. Existing detection methods only identify visible defects such as box damage, corrosion, unclosed doors, damaged locks, or missing anti-counterfeiting seals. These abnormal features are readily apparent and can be directly determined through image feature matching.
[0004] However, in outdoor operating scenarios, metering boxes suffer from a hidden defect that existing image recognition methods struggle to address. When the box's sealing rings age or the sealing structure fails, humid external air enters the box's internal cavity, causing condensation on the inside of the viewing window and a decline in the insulation performance of electrical components. Current technologies typically rely on specialized hardware such as airtightness or humidity sensors for sealing detection, requiring additional equipment investment and failing to leverage existing inspection data for inference. Existing solutions also detect condensation by recognizing water droplet outlines in images; however, when condensation adheres to the inner surface of the viewing window as a uniform mist, the image lacks segmentable water droplet outlines or significant texture features, making such direct recognition methods ineffective. Since the sealing structure itself is invisible, and uniform water mist has no visible features, existing image recognition methods cannot directly detect the sealing status, nor can they infer whether the seal has failed from image features. Summary of the Invention
[0005] The purpose of this invention is to provide a method for identifying defects in remote inspection of metering boxes based on image recognition, so as to solve the problems mentioned in the background art.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] A method for identifying defects in remote inspection of metering boxes based on image recognition includes the following steps:
[0008] S1. Obtain the inspection images of the metering box from each inspection, locate all window areas in each inspection image, and calculate the clarity score of each window; arrange them in the order of inspection time to construct a time series of the clarity of each window.
[0009] S2. Based on the time series of the sharpness of each window, calculate the historical degradation rate baseline value of each window; determine whether the sharpness of each window is abnormally reduced according to the time series. If no abnormal decrease in sharpness is observed in any window, the metering box is determined to be in normal condition and the process is terminated; if the sharpness of any window is abnormally reduced, proceed to S3.
[0010] S3. Calculate the spatial consistency coefficient between the clarity scores of each window at the current inspection time. If the spatial consistency coefficient is greater than or equal to the preset consistency threshold, it is determined that the degradation trend of each window is synchronized as a whole, and proceed to S4; otherwise, it is determined to be a local anomaly, and a local window anomaly signal is output to the operation and maintenance terminal and the process is terminated.
[0011] S4. For each window, combine the clarity score at the previous inspection time with the historical degradation rate benchmark value to calculate the current rate of change and the mutation characteristic index; if the window clarity decreases and the mutation characteristic index is greater than or equal to the preset mutation threshold, it is judged as a sudden decrease; if the window clarity decreases and the mutation characteristic index is less than the preset mutation threshold, it is judged as a gradual decrease; otherwise, it is recorded as normal fluctuation.
[0012] S5. Under the premise that the degradation trend of each window is synchronized, summarize the degradation mode judgment results of each window; if all windows are judged to be sudden degradation, output a sealing failure signal; if all windows are judged to be gradual degradation, output a material aging signal; otherwise, output a signal that manual review is required.
[0013] Furthermore, S1 includes the following:
[0014] The image acquisition device installed outside the metering box acquires inspection images at each inspection time. Each inspection corresponds to one inspection image. The inspection images are numbered in chronological order of acquisition time as the 1st, 2nd, ..., tth inspection image, where t is a positive integer greater than or equal to 2.
[0015] Locate all window regions in each inspection image. The same metering box contains N windows, where N is a positive integer greater than or equal to 2. For the j-th inspection image, all the located window regions are denoted as C1j, C2j, ..., CNj, where 1 to N represent the window numbers and j represents the inspection order.
[0016] Each window region in each inspection image is converted to grayscale, and grayscale normalization and local brightness equalization are performed on the grayscale image to reduce the interference of environmental factors such as uneven lighting, backlighting, and shadows on the sharpness calculation, so as to obtain the grayscale value of each pixel in the window region. The grayscale normalization and local brightness equalization are only used to reduce lighting interference and do not affect the relative comparability of the sharpness scores of the window region.
[0017] Let f(x,y) be the grayscale value of the pixel at coordinates (x,y) in the viewport region. Calculate the grayscale change of pixel (x,y) in the horizontal and vertical directions, where the grayscale change in the horizontal direction is Δf. x (x,y)=|f(x+1,y)-f(x-1,y)|, where the vertical grayscale change is Δf. y (x,y)=|f(x,y+1)-f(x,y-1)|; calculate the gradient magnitude G(x,y) based on the grayscale changes of pixel (x,y) in the horizontal and vertical directions, and G(x,y)=Δf x (x,y)+Δf y (x,y); The average gradient magnitude of all pixels within the viewport area is used as the sharpness score Q for the viewport area, and Q=1 / (W×H)∑ x∈[1,W] ∑ y∈[1,H] G(x,y), where W is the width of the viewport image and H is the height of the viewport image;
[0018] For each window region in each inspection image, the sharpness score of the i-th window in the j-th inspection is denoted as Qij, where i=1,2,...,N,j=1,2,...,t; for the i-th window, the sharpness scores calculated in each inspection are arranged in chronological order of inspection time to construct the time series of the sharpness of the i-th window Ti=[Qi1,Qi2,...,Qit].
[0019] Furthermore, S2 includes the following:
[0020] Based on the time series Ti of the sharpness of the i-th window, and using the inspection sequence number as the independent variable, the trend of the sharpness score changing with the collection inspection sequence is fitted to obtain the degradation trend slope Ki of the sharpness score of the i-th window, and: Ki=[t·∑ j∈[1,t] (j·Qij)-∑ j∈[1,t] j·∑ j∈[1,t] Qij] / [t·∑ j∈[1,t] j 2 -(∑ j∈[1,t] j) 2], where j is the inspection sequence number; the degradation trend slope Ki is used as the historical degradation rate benchmark value of the i-th window. When Ki is negative, it indicates that the sharpness decreases with the inspection sequence. The larger the absolute value of Ki, the faster the degradation rate. The degradation trend slope Ki is an approximate value of the linear trend of the sharpness change with the inspection sequence, which is used to characterize the long-term overall degradation direction and average rate of the window's sharpness.
[0021] Iterate through all windows and perform an abnormal decline judgment on each window one by one. For the i-th window, calculate the standard deviation σi of the historical sharpness scores based on the sharpness scores of previous inspections. Compare the sharpness score Qit at the current inspection time with the sharpness score Qi(t-1) at the previous inspection time. If Qit ≥ Qi(t-1) - α × σi, it is determined that the sharpness of the i-th window region has not experienced an abnormal decline; if Qit < Qi(t-1) - α × σi, it is determined that the sharpness of the i-th window region has experienced an abnormal decline. Here, α is a preset coefficient, and α ≥ 1. α × σi constitutes the fluctuation tolerance threshold, which is used to characterize the upper limit of the normal fluctuation range of sharpness caused by non-defect factors. The larger the value of σi, the wider the range of historical sharpness fluctuations, and the more relaxed the abnormal judgment conditions are. The smaller the value of σi, the stricter the judgment conditions are.
[0022] After all window determinations are completed, branch processing is performed; if the clarity of all window areas does not show any abnormal decrease, the metering box is determined to be in normal condition and the process is terminated; if the clarity of at least one window area shows an abnormal decrease, proceed to S3.
[0023] Furthermore, S3 includes the following:
[0024] Based on the sharpness time series Ti of the i-th window, calculate the change in sharpness score between two adjacent inspections, ΔQij = Qi(j+1) - Qij; obtain the sharpness change direction value Sij based on the sharpness score change, and Sij = sgn(ΔQij), where sgn is a sign function. When ΔQij > 0, Sij = 1, indicating an increase in sharpness; when ΔQij < 0, Sij = -1, indicating a decrease in sharpness; when ΔQij = 0, Sij = 0, indicating no change in sharpness; construct the temporal change direction sequence Di corresponding to each window based on the change direction values of all adjacent times of each window, and Di = [Si1, Si2, ..., Si(t-1)].
[0025] For any two windows p and q, within the same inspection interval j, the deviation of the change range Apqj is calculated based on the change in sharpness score ΔQpj and ΔQqj, and Apqj = ||ΔQpj| - |ΔQqj|| / (|ΔQpj| + |ΔQqj| + β1), where β1 is a preset minimum positive number used to avoid the denominator being 0. Its value is much smaller than the magnitude of the sharpness score and has no substantial impact on the calculation result.
[0026] Based on the direction sequence of each window, calculate the consistency coefficient Rpq of the change direction between any two windows p and q, and Rpq = ∑ j∈[1,t-1] [(Spj=Sqj)∩(Apqj≤A0)] / (t-1), where [(Spj=Sqj)∩(Apqj≤A0)] is a joint indicator function. When Spj and Sqj are equal and Apqj is less than or equal to the preset amplitude deviation threshold A0, the value is 1; otherwise, the value is 0. The preset amplitude deviation threshold A0 is adaptively calibrated based on historical inspection samples from the field.
[0027] Calculate the average directional consistency coefficient among all viewports as the spatial consistency coefficient Z, and Z = [2 / N(N-1)] × (∑ p∈[1,N-1] ∑ q∈[p+1,N] Rpq); where the spatial consistency coefficient does not characterize the degree of similarity in the sharpness values of a single frame image, but rather the overall synchronization degree of the long-term temporal degradation trend of multiple windows; the closer Z is to 1, the more synchronized the sharpness decay behavior of all windows in the box is; the lower Z is, the more independent abnormal fluctuations there are in local windows.
[0028] The spatial consistency coefficient Z is compared with the preset consistency threshold Z0. If Z≥Z0, it is determined that the degradation trajectory of each window area is synchronized and proceeds to S4; if Z<Z0, it is determined that there is a deviation in the degradation trajectory of the window, and a signal of local window abnormality in the metering box is output to the operation and maintenance terminal, and the process is terminated.
[0029] Furthermore, S4 includes the following:
[0030] Get the sharpness score Qit of the i-th window at the current inspection time and the sharpness score Qi(t-1) at the previous inspection time; calculate the current rate of change of sharpness Vi based on the difference between the sharpness scores at the current inspection time and the previous inspection time, and Vi=Qi(t-1)-Qit.
[0031] Based on the current rate of change Vi of the sharpness score and the corresponding historical degradation rate benchmark Ki, the abrupt change characteristic index Mi is calculated, and Mi = Vi / (|Ki|+β2), where β2 is a preset minimum positive number to prevent the denominator from being too small when |Ki| approaches 0, causing calculation abnormalities; when |Ki| is much larger than β2, the influence of β2 on the calculation result can be ignored; Mi represents the multiple of the current short-term rate of change relative to the long-term steady-state degradation rate; the larger Mi is, the more significantly the current sharpness decay deviates from the long-term normal degradation trend;
[0032] The mutation characteristic index Mi is compared with the preset mutation threshold M0. If Vi > 0 and Mi ≥ M0, the i-th window is determined to be a sudden decline; if Vi > 0 and Mi < M0, the i-th window is determined to be a gradual decline; if Vi ≤ 0, the i-th window is determined to be a normal fluctuation. M0 is the preset mutation threshold, and the value of M0 is greater than 1. It is used to distinguish whether the current decline rate deviates significantly from the historical normal degradation level.
[0033] Furthermore, S5 includes the following:
[0034] Based on the overall synchronization of the degradation trajectory of each window in S3, the descent mode determination results of all windows in S4 are obtained, and the determination category of each window is sudden descent, gradual descent or normal fluctuation.
[0035] If all windows indicate a sudden drop, it is determined that the metering box has a sealing failure defect, and a sealing failure signal is output to the operation and maintenance terminal.
[0036] If all windows are determined to be progressively degraded, then the window material is determined to be aged overall, and a material aging signal is output to the operation and maintenance terminal.
[0037] If some windows are judged to be sudden drops, some windows are judged to be gradual drops, or at least one window is judged to be normal fluctuations while other windows are judged to be sudden drops or gradual drops, then it is judged to be an abnormal mode, and a signal requiring manual review is output to the operation and maintenance terminal.
[0038] If all windows indicate normal fluctuations, the metering box is considered to be in a normal state, and the process is terminated.
[0039] Compared with existing technologies, the beneficial effects of this invention are as follows: By constructing a multi-window clarity time sequence, combined with the determination of abnormal clarity degradation, verification of multi-window time sequence synchronization, and analysis of rate mutation characteristics, this invention solves the problems of existing image recognition technologies being unable to identify uniform water mist condensation in windows and difficult to distinguish between sealing failure and latent defects caused by material aging. This invention requires no additional sensor hardware and can complete defect reasoning based on existing inspection image data, reducing equipment modification costs and maintenance investment. Through spatial consistency verification with dual constraints of direction and amplitude, it avoids the misjudgment defects of single-direction judgment and accurately distinguishes between local anomalies and overall synchronous degradation. Combined with comparative analysis of short-term mutation rates and long-term steady-state degradation rates, it can effectively identify sudden sealing failures and gradual material aging, achieving refined classification and identification of latent defects in metering boxes, and improving the accuracy and practicality of remote intelligent inspection. Attached Figure Description
[0040] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0041] Figure 1 This is a flowchart of the remote inspection defect identification method for metering boxes based on image recognition according to the present invention. Detailed Implementation
[0042] 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.
[0043] Please see Figure 1 The present invention provides the following technical solution:
[0044] A method for identifying defects in remote inspection of metering boxes based on image recognition includes the following steps:
[0045] S1. Obtain the inspection images of the metering box from each inspection, locate all window areas in each inspection image, and calculate the clarity score of each window; arrange them in the order of inspection time to construct a time series of the clarity of each window.
[0046] S2. Based on the time series of the sharpness of each window, calculate the historical degradation rate baseline value of each window; determine whether the sharpness of each window is abnormally reduced according to the time series. If no abnormal decrease in sharpness is observed in any window, the metering box is determined to be in normal condition and the process is terminated; if the sharpness of any window is abnormally reduced, proceed to S3.
[0047] S3. Calculate the spatial consistency coefficient between the clarity scores of each window at the current inspection time. If the spatial consistency coefficient is greater than or equal to the preset consistency threshold, it is determined that the degradation trend of each window is synchronized as a whole, and proceed to S4; otherwise, it is determined to be a local anomaly, and a local window anomaly signal is output to the operation and maintenance terminal and the process is terminated.
[0048] S4. For each window, combine the clarity score at the previous inspection time with the historical degradation rate benchmark value to calculate the current rate of change and the mutation characteristic index; if the window clarity decreases and the mutation characteristic index is greater than or equal to the preset mutation threshold, it is judged as a sudden decrease; if the window clarity decreases and the mutation characteristic index is less than the preset mutation threshold, it is judged as a gradual decrease; otherwise, it is recorded as normal fluctuation.
[0049] S5. Under the premise that the degradation trend of each window is synchronized, summarize the degradation mode judgment results of each window; if all windows are judged to be sudden degradation, output a sealing failure signal; if all windows are judged to be gradual degradation, output a material aging signal; otherwise, output a signal that manual review is required.
[0050] S1 includes the following:
[0051] The image acquisition device installed outside the metering box acquires inspection images at each inspection time. Each inspection corresponds to one inspection image. The inspection images are numbered in chronological order of acquisition time as the 1st, 2nd, ..., tth inspection image, where t is a positive integer greater than or equal to 2.
[0052] Locate all window regions in each inspection image. The same metering box contains N windows, where N is a positive integer greater than or equal to 2. For the j-th inspection image, all the located window regions are denoted as C1j, C2j, ..., CNj, where 1 to N represent the window numbers and j represents the inspection order.
[0053] Each window region in each inspection image is converted to grayscale, and grayscale normalization and local brightness equalization are performed on the grayscale image to reduce the interference of environmental factors such as uneven lighting, backlighting, and shadows on the sharpness calculation, so as to obtain the grayscale value of each pixel in the window region. The grayscale normalization and local brightness equalization are only used to reduce lighting interference and do not affect the relative comparability of the sharpness scores of the window region.
[0054] Let f(x,y) be the grayscale value of the pixel at coordinates (x,y) in the viewport region. Calculate the grayscale change of pixel (x,y) in the horizontal and vertical directions, where the grayscale change in the horizontal direction is Δf. x (x,y)=|f(x+1,y)-f(x-1,y)|, where the vertical grayscale change is Δf.y (x,y)=|f(x,y+1)-f(x,y-1)|; calculate the gradient magnitude G(x,y) based on the grayscale changes of pixel (x,y) in the horizontal and vertical directions, and G(x,y)=Δf x (x,y)+Δf y (x,y); The average gradient magnitude of all pixels within the viewport area is used as the sharpness score Q for the viewport area, and Q=1 / (W×H)∑ x∈[1,W] ∑ y∈[1,H] G(x,y), where W is the width of the viewport image and H is the height of the viewport image;
[0055] For each window region in each inspection image, the sharpness score of the i-th window in the j-th inspection is denoted as Qij, where i=1,2,...,N,j=1,2,...,t; for the i-th window, the sharpness scores calculated in each inspection are arranged in chronological order of inspection time to construct the time series of the sharpness of the i-th window Ti=[Qi1,Qi2,...,Qit].
[0056] In this embodiment, locating the entire viewport region in each inspection image can be achieved using a method based on image edge detection and morphological analysis, specifically:
[0057] The inspection images are converted to grayscale, and then grayscale normalization and local brightness equalization are performed to reduce the interference of environmental factors such as uneven lighting, backlighting, and shadows on the sharpness calculation. The grayscale normalization and local brightness equalization are only used to reduce lighting interference and do not affect the relative comparability of the sharpness scores of the window area. The relative relationship between the sharpness scores of each window of the same box at the same inspection time remains unchanged after the same preprocessing. Inspection images that still cannot meet the quality requirements after preprocessing due to excessively strong or weak lighting are marked as invalid frames and are not included in the time series construction.
[0058] Edge information is extracted by utilizing the difference in grayscale gradient between the viewport area and the surrounding area. Closed edge contours are obtained through edge connection and contour extraction. Based on the geometric and size characteristics of the metering box window, contours belonging to the window are selected from all closed edge contours to determine the position of each window area in the image. Since the windows of different metering box models have fixed structural characteristics in terms of number, size, and arrangement, a pre-stored metering box model template can be used for auxiliary verification during positioning to improve positioning accuracy.
[0059] S2 includes the following:
[0060] Based on the time series Ti of the sharpness of the i-th window, and using the inspection sequence number as the independent variable, the trend of the sharpness score changing with the inspection sequence number is fitted to obtain the degradation trend slope Ki of the sharpness score of the i-th window, and: Ki=[t·∑ j∈[1,t] (j·Qij)-∑ j∈[1,t] j·∑ j∈[1,t] Qij] / [t·∑ j∈[1,t] j 2 -(∑ j∈[1,t] j) 2 ], where j is the inspection sequence number; the degradation trend slope Ki is used as the historical degradation rate benchmark value of the i-th window. When Ki is negative, it indicates that the sharpness decreases with the inspection sequence. The larger the absolute value of Ki, the faster the degradation rate. The degradation trend slope Ki is an approximate value of the linear trend of the sharpness change with the inspection sequence, which is used to characterize the long-term overall degradation direction and average rate of the window's sharpness.
[0061] Iterate through all windows and perform an abnormal decline judgment on each window one by one. For the i-th window, calculate the standard deviation σi of the historical sharpness scores based on the sharpness scores of previous inspections. Compare the sharpness score Qit at the current inspection time with the sharpness score Qi(t-1) at the previous inspection time. If Qit ≥ Qi(t-1) - α × σi, it is determined that the sharpness of the i-th window region has not experienced an abnormal decline; if Qit < Qi(t-1) - α × σi, it is determined that the sharpness of the i-th window region has experienced an abnormal decline. Here, α is a preset coefficient, and α ≥ 1. α × σi constitutes the fluctuation tolerance threshold, which is used to characterize the upper limit of the normal fluctuation range of sharpness caused by non-defect factors. The larger the value of σi, the wider the range of historical sharpness fluctuations, and the more relaxed the abnormal judgment conditions are. The smaller the value of σi, the stricter the judgment conditions are.
[0062] After all window determinations are completed, branch processing is performed; if the clarity of all window areas does not show any abnormal decrease, the metering box is determined to be in normal condition and the process is terminated; if the clarity of at least one window area shows an abnormal decrease, proceed to S3.
[0063] In this embodiment, the value of α should be determined based on the actual operating environment. For scenarios with drastic light fluctuations, a larger α can be selected, only classifying significant drops exceeding the normal fluctuation range as abnormal. For scenarios with stable light, a smaller α can be used to retain the sensitivity for defect identification. During implementation, α=2 can be selected as the default configuration. Under the assumption of a normal distribution, approximately 95% of normal sampling fluctuations fall within the range of the mean ± 2 standard deviations, balancing the risks of misjudgment and missed detection. The final value of α can be adjusted based on historical on-site inspection data.
[0064] For the first inspection, since there is a lack of data from the previous inspection, no abnormal decline judgment is made. Only the initial sharpness score of each window is recorded. σi is calculated after data is continuously collected. When the number of inspection samples is small, the statistical reliability of σi is insufficient. A preset empirical standard deviation can be used to temporarily participate in the calculation, or the abnormal decline judgment can be postponed until sufficient inspection data is collected.
[0065] S3 includes the following:
[0066] Based on the sharpness time series Ti of the i-th window, calculate the change in sharpness score between two adjacent inspections, ΔQij = Qi(j+1) - Qij; obtain the sharpness change direction value Sij based on the sharpness score change, and Sij = sgn(ΔQij), where sgn is a sign function. When ΔQij > 0, Sij = 1, indicating an increase in sharpness; when ΔQij < 0, Sij = -1, indicating a decrease in sharpness; when ΔQij = 0, Sij = 0, indicating no change in sharpness; construct the temporal change direction sequence Di corresponding to each window based on the change direction values of all adjacent times of each window, and Di = [Si1, Si2, ..., Si(t-1)].
[0067] For any two windows p and q, within the same inspection interval j, the deviation of the change range Apqj is calculated based on the change in sharpness score ΔQpj and ΔQqj, and Apqj = ||ΔQpj| - |ΔQqj|| / (|ΔQpj| + |ΔQqj| + β1), where β1 is a preset minimum positive number used to avoid the denominator being 0. Its value is much smaller than the magnitude of the sharpness score and has no substantial impact on the calculation result.
[0068] Based on the direction sequence of each window, calculate the consistency coefficient Rpq of the change direction between any two windows p and q, and Rpq = ∑ j∈[1,t-1] [(Spj=Sqj)∩(Apqj≤A0)] / (t-1), where [(Spj=Sqj)∩(Apqj≤A0)] is a joint indicator function. When Spj and Sqj are equal and Apqj is less than or equal to the preset amplitude deviation threshold A0, the value is 1; otherwise, the value is 0. The preset amplitude deviation threshold A0 is adaptively calibrated based on historical inspection samples from the field.
[0069] Calculate the average directional consistency coefficient among all viewports as the spatial consistency coefficient Z, and Z = [2 / N(N-1)] × (∑ p∈[1,N-1] ∑ q∈[p+1,N] Rpq); where the spatial consistency coefficient does not characterize the degree of similarity in the sharpness values of a single frame image, but rather the overall synchronization degree of the long-term temporal degradation trend of multiple windows; the closer Z is to 1, the more synchronized the sharpness decay behavior of all windows in the box is; the lower Z is, the more independent abnormal fluctuations there are in local windows.
[0070] The spatial consistency coefficient Z is compared with the preset consistency threshold Z0. If Z≥Z0, it is determined that the degradation trajectory of each window area is synchronized and proceeds to S4; if Z<Z0, it is determined that there is a deviation in the degradation trajectory of the window, and a signal of local window abnormality in the metering box is output to the operation and maintenance terminal, and the process is terminated.
[0071] In this embodiment, the preset consistency threshold Z0 is determined as follows:
[0072] For metering boxes of the same model and batch, under normal operating conditions, the direction of change in the clarity of each window should be basically consistent, and the spatial consistency coefficient Z should be close to 1. Select multiple metering boxes under normal operating conditions, obtain the spatial consistency coefficient Z for each metering box under normal operating conditions, and statistically analyze its distribution characteristics. When Z is lower than the lower limit of the spatial consistency coefficient distribution under normal operating conditions, it is judged as abnormal. Using the mean μZ and standard deviation σZ of the spatial consistency coefficient under normal operating conditions as a benchmark, Z0 = μZ - 3 × σZ is taken as the threshold. For newly commissioned metering boxes lacking historical statistical data, an empirical initial value Z0 = 0.7 can be used, meaning that a spatial consistency coefficient lower than 0.7 is judged as abnormal. 0.7 indicates that in each inspection, the proportion of windows with consistent change directions is not less than 70%. After accumulating sufficient historical data, switch to statistical calibration mode.
[0073] In addition, this method is applicable to scenarios where significant failure of the sealing structure leads to an increase in overall humidity inside the enclosure and simultaneous condensation on all windows. For single windows that experience preferential condensation due to local cold spots or minor leaks inside the enclosure, S3 determines them as local independent anomalies and outputs a local window anomaly signal, without entering the sealing failure determination process.
[0074] S4 includes the following:
[0075] Get the sharpness score Qit of the i-th window at the current inspection time, and the sharpness score Qi(t-1) at the previous inspection time; calculate the current rate of change of the sharpness score Vi based on the difference between the sharpness scores at the current inspection time and the previous inspection time, and Vi=Qi(t-1)-Qit.
[0076] Based on the current rate of change Vi of the sharpness score and the corresponding historical degradation rate benchmark Ki, the abrupt change characteristic index Mi is calculated, and Mi = Vi / (|Ki|+β2), where β2 is a preset minimum positive number to prevent the denominator from being too small when |Ki| approaches 0, causing calculation abnormalities; when |Ki| is much larger than β2, the influence of β2 on the calculation result can be ignored; Mi represents the multiple of the current short-term rate of change relative to the long-term steady-state degradation rate; the larger Mi is, the more significantly the current sharpness decay deviates from the long-term normal degradation trend;
[0077] The mutation characteristic index Mi is compared with the preset mutation threshold M0. If Vi > 0 and Mi ≥ M0, the i-th window is determined to be a sudden decline; if Vi > 0 and Mi < M0, the i-th window is determined to be a gradual decline; if Vi ≤ 0, the i-th window is determined to be a normal fluctuation. M0 is the preset mutation threshold, and the value of M0 is greater than 1. It is used to distinguish whether the current decline rate deviates significantly from the historical normal degradation level.
[0078] In this embodiment, the preset mutation threshold M0 is determined as follows:
[0079] Multiple metering boxes of the same model, without defects, and operating stably for a long time were selected, and the distribution data of the abrupt change characteristic index Mi corresponding to the normal aging stage of each window were collected. Under normal aging conditions, the Mi value is mostly close to 1, indicating that the short-term decline rate is basically equal to the long-term steady-state degradation rate. Based on this, M0 is set as the upper boundary of the normal operating condition Mi distribution to reduce misjudgment caused by rate fluctuations due to gradual material aging. When there are not enough historical samples for newly commissioned metering boxes, the empirical default value M0=3 is adopted, that is, when the current short-term decline rate reaches 3 times or more of the long-term normal degradation rate, it is judged as a sudden decline, thus distinguishing between slow material aging and rapid condensation ambiguity caused by sealing failure. After a sufficient number of inspection samples are accumulated on site, M0 can be recalibrated based on the sample distribution to adapt to the degradation characteristics of metering boxes under different operating environments.
[0080] S5 includes the following:
[0081] Based on the overall synchronization of the degradation trajectory of each window in S3, the descent mode determination results of all windows in S4 are obtained, and the determination category of each window is sudden descent, gradual descent or normal fluctuation.
[0082] If all windows indicate a sudden drop, it is determined that the metering box has a sealing failure defect, and a sealing failure signal is output to the operation and maintenance terminal.
[0083] If all windows are determined to be progressively degraded, then the window material is determined to be aged overall, and a material aging signal is output to the operation and maintenance terminal.
[0084] If some windows are judged to be sudden drops, some windows are judged to be gradual drops, or at least one window is judged to be normal fluctuations while other windows are judged to be sudden drops or gradual drops, then it is judged to be an abnormal mode, and a signal requiring manual review is output to the operation and maintenance terminal.
[0085] If all windows indicate normal fluctuations, the metering box is considered to be in a normal state, and the process is terminated.
[0086] In this embodiment, S3 has determined that the degradation trajectories of each window are synchronized as a whole, and S5 further makes a comprehensive judgment based on the descent mode of each window.
[0087] When the clarity of all viewing windows suddenly decreases within the same inspection interval, it indicates that all windows are simultaneously affected by the same abnormal factor. Since all viewing windows in the same metering box share the internal space, when the sealing structure fails, humid external air enters the entire internal space, causing condensation to occur simultaneously on all windows, resulting in a synchronous and sudden decrease in clarity. Therefore, when all viewing windows are determined to show a sudden decrease, it is considered a seal failure.
[0088] When the clarity of all windows gradually decreases, it indicates that the light transmittance of each window slowly deteriorates over time, which is a normal process of natural aging of the window material in an outdoor environment. Therefore, it is determined to be overall material aging.
[0089] When some windows exhibit a sudden drop while others show a gradual drop, it indicates a discrepancy in the descent behavior of each window. Since all windows within the same enclosure should be subject to the same environmental influences, inconsistent descent patterns cannot be attributed to sealing failure or overall material aging. They may be caused by localized contamination, partial obstruction, or data anomalies, requiring manual verification.
[0090] If all windows indicate normal fluctuations, the metering box is determined to be in a normal state. A normal signal is output to the maintenance terminal, and it is indicated that S2 triggered an abnormal drop judgment at the current inspection time, but S4 confirmed that no actual drop occurred, so that maintenance personnel can evaluate the rationality of the judgment threshold.
[0091] The sealing failure signal and material aging signal output by this method are inference results based on image features. They are early warning signals to assist operation and maintenance decision-making. Ultimately, they need to be confirmed on-site by operation and maintenance personnel before appropriate actions are taken.
[0092] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0093] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for remote inspection and defect identification of metering boxes based on image recognition, characterized in that: The method includes the following steps: S1. Obtain the inspection images of the metering box from each inspection, locate all window areas in each inspection image, and calculate the clarity score of each window; arrange them in the order of inspection time to construct a time series of the clarity of each window. S2. Based on the time series of the sharpness of each window, calculate the historical degradation rate baseline value of each window; determine whether the sharpness of each window is abnormally reduced according to the time series. If no abnormal decrease in sharpness is observed in any window, the metering box is determined to be in normal condition and the process is terminated; if the sharpness of any window is abnormally reduced, proceed to S3. S3. Calculate the spatial consistency coefficient between the clarity scores of each window at the current inspection time. If the spatial consistency coefficient is greater than or equal to the preset consistency threshold, it is determined that the degradation trend of each window is synchronized as a whole, and proceed to S4; otherwise, it is determined to be a local anomaly, and a local window anomaly signal is output to the operation and maintenance terminal and the process is terminated. S4. For each window, combine the clarity score at the previous inspection time with the historical degradation rate benchmark value to calculate the current rate of change and the mutation characteristic index; if the window clarity decreases and the mutation characteristic index is greater than or equal to the preset mutation threshold, it is judged as a sudden decrease; if the window clarity decreases and the mutation characteristic index is less than the preset mutation threshold, it is judged as a gradual decrease; otherwise, it is recorded as normal fluctuation. S5. Under the premise that the degradation trend of each window is synchronized, summarize the degradation mode judgment results of each window; if all windows are judged to be sudden degradation, output a sealing failure signal; if all windows are judged to be gradual degradation, output a material aging signal; otherwise, output a signal that manual review is required.
2. The method for remote inspection and defect identification of metering boxes based on image recognition according to claim 1, characterized in that: S1 includes the following: The image acquisition device installed outside the metering box acquires inspection images at each inspection time. Each inspection corresponds to one inspection image. The inspection images are numbered in chronological order of acquisition time as the 1st, 2nd, ..., tth inspection image, where t is a positive integer greater than or equal to 2. Locate all window regions in each inspection image. The same metering box contains N windows, where N is a positive integer greater than or equal to 2. For the j-th inspection image, all the located window regions are denoted as C1j, C2j, ..., CNj, where 1 to N represent the window numbers and j represents the inspection order. Each window region in each inspection image is converted to grayscale, and grayscale normalization and local brightness equalization are performed on the grayscale image to obtain the grayscale value of each pixel in the window region; the grayscale normalization and local brightness equalization are only used to reduce illumination interference and do not affect the relative comparability of the clarity scores of the window region. Let f(x,y) be the grayscale value of the pixel at coordinates (x,y) in the viewport region. Calculate the grayscale change of pixel (x,y) in the horizontal and vertical directions, where the grayscale change in the horizontal direction is Δf. x (x,y)=|f(x+1,y)-f(x-1,y)|, where the vertical grayscale change is Δf. y (x,y)=|f(x,y+1)-f(x,y-1)|; calculate the gradient magnitude G(x,y) based on the grayscale changes of pixel (x,y) in the horizontal and vertical directions, and G(x,y)=Δf x (x,y)+Δf y (x,y); The average gradient magnitude of all pixels within the viewport area is used as the sharpness score Q for the viewport area, and Q=1 / (W×H)∑ x∈[1,W] ∑ y∈[1,H] G(x,y), where W is the width of the viewport image and H is the height of the viewport image; For each window region in each inspection image, the sharpness score of the i-th window in the j-th inspection is denoted as Qij, where i=1,2,...,N,j=1,2,...,t; for the i-th window, the sharpness scores calculated in each inspection are arranged in chronological order of inspection time to construct the time series of the sharpness of the i-th window Ti=[Qi1,Qi2,...,Qit].
3. The method for remote inspection and defect identification of metering boxes based on image recognition according to claim 2, characterized in that: The calculation of the historical degradation rate baseline value for each window in S2 specifically includes: Based on the time series Ti of the sharpness of the i-th window, and using the inspection sequence number as the independent variable, the trend of the sharpness score changing with the acquisition inspection sequence is fitted to obtain the degradation trend slope Ki of the sharpness score of the i-th window, and: Ki=[t·∑ j∈[1,t] (j·Qij)-∑ j∈[1,t] j·∑ j∈[1,t] Qij] / [t·∑ j∈[1,t] j 2 -(∑ j∈[1,t] j) 2 ], where j is the inspection sequence number; the degradation trend slope Ki is used as the historical degradation rate benchmark value of the i-th window.
4. The method for remote inspection and defect identification of metering boxes based on image recognition according to claim 3, characterized in that: The determination of whether the clarity of each current window has abnormally decreased in S2 specifically includes: For the i-th window, based on the clarity scores of previous inspections, the standard deviation σi of the historical clarity scores is calculated. The clarity score Qit at the current inspection time is compared with the clarity score Qi(t-1) at the previous inspection time. If Qit ≥ Qi(t-1) - α × σi, it is determined that the clarity of the i-th window region has not decreased abnormally; if Qit < Qi(t-1) - α × σi, it is determined that the clarity of the i-th window region has decreased abnormally. Here, α is a preset coefficient, and α ≥ 1. α × σi constitutes the fluctuation tolerance threshold.
5. The method for remote inspection and defect identification of metering boxes based on image recognition according to claim 4, characterized in that: S3 includes the following: Based on the sharpness time series Ti of the i-th window, calculate the change in sharpness score between two adjacent inspections, ΔQij = Qi(j+1) - Qij; obtain the sharpness change direction value Sij based on the sharpness score change, and Sij = sgn(ΔQij), where sgn is a sign function. When ΔQij > 0, Sij = 1, indicating an increase in sharpness; when ΔQij < 0, Sij = -1, indicating a decrease in sharpness; when ΔQij = 0, Sij = 0, indicating no change in sharpness; construct the temporal change direction sequence Di corresponding to each window based on the change direction values of all adjacent times of each window, and Di = [Si1, Si2, ..., Si(t-1)]. For any two windows p and q, within the same inspection interval, calculate the deviation of the change range Apqj based on the change in sharpness score ΔQpj and ΔQqj, and Apqj=||ΔQpj|-|ΔQqj|| / (|ΔQpj|+|ΔQqj|+β1), where β1 is a preset minimum positive number; Based on the direction sequence of each window, calculate the consistency coefficient Rpq of the change direction between any two windows p and q, and Rpq = ∑ j∈[1,t-1] [(Spj=Sqj)∩(Apqj≤A0)] / (t-1), where [(Spj=Sqj)∩(Apqj≤A0)] is a joint indicator function. When Spj and Sqj are equal and Apqj is less than or equal to the preset amplitude deviation threshold A0, the value is 1; otherwise, the value is 0. The preset amplitude deviation threshold A0 is adaptively calibrated based on historical inspection samples from the field. Calculate the average directional consistency coefficient among all viewports as the spatial consistency coefficient Z, and Z = [2 / N(N-1)] × (∑ p∈[1,N-1] ∑ q∈[p+1,N] Rpq); The spatial consistency coefficient Z is compared with the preset consistency threshold Z0. If Z≥Z0, it is determined that the degradation trajectory of each window area is synchronized and proceeds to S4; if Z<Z0, it is determined that there is a deviation in the degradation trajectory of the window, and a signal of local window abnormality in the metering box is output to the operation and maintenance terminal, and the process is terminated.
6. The method for remote inspection and defect identification of metering boxes based on image recognition according to claim 5, characterized in that: The calculation of the current rate of change and mutation characteristic index in S4 specifically includes: Get the sharpness score Qit of the i-th window at the current inspection time, and the sharpness score Qi(t-1) at the previous inspection time; calculate the current rate of change of the sharpness score Vi based on the difference between the sharpness scores at the current inspection time and the previous inspection time, and Vi=Qi(t-1)-Qit. Based on the current rate of change Vi of the sharpness score and the corresponding historical degradation rate benchmark value Ki, the mutation feature index Mi is calculated, and Mi = Vi / (|Ki|+β2), where β2 is a preset minimum positive number.
7. The method for remote inspection and defect identification of metering boxes based on image recognition according to claim 6, characterized in that: The determination in S4 of sudden decline, gradual decline, or normal fluctuation includes: The mutation characteristic index Mi is compared with the preset mutation threshold M0. If Vi > 0 and Mi ≥ M0, the i-th window is determined to be a sudden decrease; if Vi > 0 and Mi < M0, the i-th window is determined to be a gradual decrease; if Vi ≤ 0, the i-th window is determined to be a normal fluctuation. M0 is the preset mutation threshold, and the value of M0 is greater than 1.
8. The method for remote inspection and defect identification of metering boxes based on image recognition according to claim 7, characterized in that: The S5 step summarizes the descent mode determination results for each window, specifically including: Based on the overall synchronization of the degradation trajectory of each window in S3, the descent mode determination results of all windows in S4 are obtained, and the determination category of each window is sudden descent, gradual descent or normal fluctuation. If all windows indicate a sudden drop, it is determined that the metering box has a sealing failure defect, and a sealing failure signal is output to the operation and maintenance terminal. If all windows are determined to be progressively degraded, then the window material is determined to be aged overall, and a material aging signal is output to the operation and maintenance terminal. If some windows are judged to be sudden drops, some windows are judged to be gradual drops, or at least one window is judged to be normal fluctuations while other windows are judged to be sudden drops or gradual drops, then it is judged to be an abnormal mode, and a signal requiring manual review is output to the operation and maintenance terminal. If all windows indicate normal fluctuations, the metering box is considered to be in a normal state, and the process is terminated.