Substation Meter Low-Level Defect Identification Method, System, Device and Storage Medium
Through the improved Yolov9-m meter recognition model, the substation meter is image-processed and corrected, and the scale and indication area are calculated, which solves the problem that the existing technology cannot identify the low-level defect state of the meter, and achieves fast and accurate identification and alarm.
Patent Information
- Application Number
- CN202510414396.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-04-03
AI Technical Summary
The prior art cannot identify whether the scale of the substation meter is in a low-defect state without clear pointers.
The improved Yolov9-m meter identification model is used to detect the dial area and divide the scale area from the indicator area on the substation meter image. The total area of the scale area and the indicator area are calculated through the correction process to determine whether the meter is in a low-defect state.
It realizes the rapid identification of the low-level defect status of the substation meter, and promptly eliminates safety hazards, which are suitable for different types of dials.
Smart Images

Figure CN119919922B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and particularly to a method, system, device and storage medium for identifying low-level defects of substation meters. Background Art
[0002] Meters such as oil level gauges, pressure gauges, and arrester detectors are important instrument devices in substations, providing a powerful monitoring means to ensure the normal operation of power grid equipment. When the reading of the oil level gauge is low, it will lead to a reduction in the insulation performance of transformers or other oil-immersed equipment, a decrease in cooling efficiency, and an acceleration of equipment aging; when the reading of the pressure gauge is low, it will lead to a decline in the insulation performance of gas-insulated equipment, a decrease in operating efficiency, and an increase in equipment risks; when the reading of the arrester detector is low, it will lead to a reduction in the lightning protection performance of the arrester, a decline in power stability, and an increase in potential safety hazards. Existing substation meter identification methods usually can only obtain the pointer readings of the meters and then manually judge whether the meters are in a low-level defect state. When the scale of the meter cannot be recognized or for meters without pointers such as oil level gauges, the existing technology often cannot judge whether the meters are in a low-level defect state. Summary of the Invention
[0003] To solve the problem that the existing technology cannot identify whether meters with unclear scales or without pointers are in a low-level defect state, this application provides a method, system, device and storage medium for identifying low-level defects of substation meters.
[0004] In a first aspect, this application provides a method for identifying low-level defects of substation meters, including:
[0005] Obtain a substation meter image of the substation meter to be identified, input the substation meter image into an improved Yolov9-m meter identification model, and perform dial area detection processing, scale area and indication area instance segmentation on the substation meter image through the improved Yolov9-m meter identification model to obtain the dial area type, dial area detection frame, scale area mask and indication area mask in the substation meter image; the dial area type is any one of a rectangular dial, a circular dial and a square dial;
[0006] Crop the substation meter image according to the dial area detection frame to obtain a dial area image, obtain a dial area correction template of the dial area image from multiple standard dial area templates, and perform correction processing on the dial area image, the scale area mask and the indication area mask according to the dial area correction template to obtain a corrected dial area image, a corrected scale area mask and a corrected indication area mask;
[0007] For different types of dial regions, calculate the total area of the scale region based on the corrected scale region mask, calculate the area of the indication region based on the corrected indication region mask, and determine whether the substation meter to be recognized is in a low-level defect state according to the total area of the scale region and the area of the indication region. If so, alarm the substation meter to be recognized for being in a low-level defect state.
[0008] In an alternative embodiment, the improved Yolov9-m meter recognition model includes a backbone network, an improved feature pyramid network, and a head network. The improved feature pyramid network includes a spatial attention mechanism module and a fusion module. The head network includes a classification and regression processing module, a region of interest alignment module, and an instance segmentation module.
[0009] The dial region detection processing, scale region and indication region instance segmentation of the substation meter image by the improved Yolov9-m meter recognition model include:
[0010] Extract features from the substation meter image through the backbone network to obtain multiple initial feature maps.
[0011] Input the multiple initial feature maps into the improved feature pyramid network. Process the multiple initial feature maps through the spatial attention mechanism module to obtain multiple spatial attention feature maps, and fuse the multiple spatial attention feature maps through the fusion module to obtain a fused feature map.
[0012] Perform classification and regression processing on the fused feature map through the classification and regression processing module to obtain the type of the dial region and the dial region detection box in the substation meter image.
[0013] Obtain a region of interest feature map with a preset size according to the image region corresponding to the dial region detection box through the region of interest alignment module.
[0014] Perform classification, regression, and instance segmentation processing on the region of interest feature map through the instance segmentation module to obtain the scale region mask and the indication region mask respectively.
[0015] In an alternative embodiment, the initial feature maps include low-level high-resolution feature maps and high-level low-resolution feature maps. The processing of each initial feature map by the spatial attention mechanism module includes:
[0016] Perform channel maximum pooling on the low-level high-resolution feature map to obtain a single-channel maximum value feature map, and perform channel average pooling on the low-level high-resolution feature map to obtain a single-channel mean value feature map.
[0017] Concatenate the single-channel maximum feature map and the single-channel mean feature map along the channel dimension to obtain a two-channel feature map, and perform a 1x1 convolution operation on the two-channel feature map to obtain a single-channel feature map;
[0018] Process the single-channel feature map through an activation function to obtain a spatially weighted feature map;
[0019] Perform 1x1 convolution and upsampling on the high-level low-resolution feature map to generate an upsampled feature map with the same resolution as the low-level high-resolution feature map;
[0020] Perform a multiplication operation on the upsampled feature map and the spatially weighted feature map to obtain the spatial attention feature map.
[0021] In an alternative embodiment, for different dial region types, calculate the total area of the scale region based on the corrected scale region mask, and calculate the area of the indicator region based on the corrected indicator region mask, including:
[0022] If the dial region type is the rectangular dial, extract 4 scale region edge points according to the corrected scale region mask; calculate the total area of the scale region corresponding to the rectangular dial according to the 4 scale region edge points;
[0023] Extract 4 indicator region edge points according to the corrected indicator region mask, and calculate the area of the indicator region according to the 4 indicator region edge points.
[0024] In an alternative embodiment, for different dial region types, calculate the total area of the scale region based on the corrected scale region mask, and calculate the area of the indicator region based on the corrected indicator region mask, including:
[0025] If the dial region type is the circular dial or the square dial, extract multiple scale region edge points according to the corrected scale region mask, and determine the two points with the largest gradient change among the multiple scale region edge points as the scale start point and the scale end point;
[0026] Select a target point from the remaining scale region edge points, and calculate the center and radius of the circle where the corrected scale region mask is located according to the target point, the scale start point, and the scale end point, where the remaining scale region edge points are the coordinates of the multiple scale region edge points except the scale start point and the scale end point;
[0027] Calculate the total area of the scale region according to the target point, the scale start point, the scale end point, the center, and the radius;
[0028] Extract a plurality of edge points of the indication area according to the correction indication area mask, and calculate the distance between each edge point of the indication area and each edge point of the scale area;
[0029] Determine the shortest distance among the plurality of distances, use the edge point of the scale area corresponding to the shortest distance as the pointer indication position, and calculate the area of the indication area according to the pointer indication position.
[0030] In an alternative embodiment, calculating the total area of the scale area according to the target point, the scale start point, the scale end point, the center of the circle, and the radius includes:
[0031] If the dial area type is the circular dial, calculate the total area of the scale area of the circular dial according to the following formula 1;
[0032] Formula 1: ;
[0033] If the dial area type is the square dial, calculate the total area of the scale area of the square dial according to the following formula 2;
[0034] Formula 2: ;
[0035] Wherein,
[0036]
[0037] wherein, the scale start point is and the scale end point is the target point is the center of the circle is the radius is r, the total area of the scale area is the area of the circle where the scale area mask of the circular dial is located cut by the line connecting the scale start point and the scale end point is the area of the circle where the scale area mask of the square dial is located cut by the line connecting the scale start point and the scale end point is ;
[0038] The calculating the area of the indication area according to the pointer indication position includes:
[0039] Calculate the area of the indication area according to the following formula 3 and formula 4;
[0040] Formula 3:
[0041] Formula 4:
[0042] Among them, the position indicated by the pointer is , and the area of the indicated area is .
[0043] In an optional embodiment, the dial area correction template for obtaining the dial area image from multiple standard templates of the dial area includes:
[0044] Obtain the standard templates of the dial area corresponding to different types of dial areas;
[0045] Use a matching algorithm to determine, from multiple standard templates of the dial area, the standard template of the dial area with the highest similarity to the dial area image as the dial area correction template;
[0046] The correction processing of the dial area image, the scale area mask, and the indication area mask according to the dial area correction template includes:
[0047] Calculate the homography matrix between the dial area image and the dial area correction template;
[0048] Correct the dial area image, the scale area mask, and the indication area mask respectively through the homography matrix;
[0049] The determination of whether the substation meter to be recognized is in a low-level defect state according to the total area of the scale area and the area of the indication area includes:
[0050] Calculate the area ratio between the area of the indication area and the total area of the scale area;
[0051] If the area ratio is greater than or equal to a preset area ratio threshold, it is determined that the substation meter to be recognized is in a normal state;
[0052] If the area ratio is less than the preset area ratio threshold, it is determined that the substation meter to be recognized is in a low-level defect state.
[0053] In a second aspect, the present application provides a substation meter low-level defect recognition system, including:
[0054] A detection and segmentation module, configured to obtain a substation meter image of the substation meter to be recognized, input the substation meter image into an improved Yolov9-m meter recognition model, and perform dial area detection processing, scale area and indication area instance segmentation on the substation meter image through the improved Yolov9-m meter recognition model, so as to obtain the dial area type, dial area detection frame, scale area mask, and indication area mask in the substation meter image; the dial area type is any one of a rectangular dial, a circular dial, and a square dial;
[0055] A matching and correction module, configured to crop the substation meter image according to the dial area detection frame to obtain a dial area image, obtain a dial area correction template of the dial area image from multiple standard templates of the dial area, and perform correction processing on the dial area image, the scale area mask, and the indication area mask according to the dial area correction template to obtain a corrected dial area image, a corrected scale area mask, and a corrected indication area mask;
[0056] A low-position defect recognition module, configured to, for different dial area types, calculate the total area of the scale area based on the corrected scale area mask, calculate the area of the indication area based on the corrected indication area mask, and determine whether the substation meter to be recognized is in a low-position defect state according to the total area of the scale area and the area of the indication area. If so, an alarm is given for the substation meter to be recognized being in a low-position defect state.
[0057] In a third aspect, the present application provides a computer device, which includes a processor and a memory. The memory stores a computer program, and the processor is configured to execute the computer program to implement the substation meter low-position defect recognition method described in the first aspect.
[0058] In a fourth aspect, the present application provides a computer storage medium, which stores a computer program. When the computer program is executed on a processor, the substation meter low-position defect recognition method described in the first aspect is implemented.
[0059] The embodiments of the present application have the following beneficial effects:
[0060] The substation meter low-position defect recognition method provided by the present application uses an improved Yolov9-m meter recognition model to detect and perform instance segmentation on the substation meter image to be recognized, obtaining the dial area type, the dial area detection frame, the scale area mask, and the indication area mask. Then, the substation meter image is cropped to obtain a dial area image, and the dial area image, the scale area mask, and the indication area mask are matched and corrected through a matching algorithm and a correction algorithm to obtain a corrected dial area image, a corrected scale area mask, and a corrected indication area mask. Then, the total area of the scale area and the area of the indication area are calculated, and it is determined whether the substation meter is in a low-position defect state according to the total area of the scale area and the area of the indication area, and an alarm is given for the substation meter to be recognized being in a low-position defect state. The present application can quickly recognize the low-position defect state of the substation meter and eliminate potential safety hazards in a timely manner. Description of the Drawings
[0061] To more clearly illustrate the technical solutions of this application, the following will briefly introduce the accompanying drawings required in the embodiments. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as limiting the protection scope of this application. For those of ordinary skill in the art, without creative efforts, other relevant drawings can also be obtained based on these drawings.
[0062] Figure 1 It shows a schematic flow chart of a method for identifying low - level defects of substation meters provided in this embodiment;
[0063] Figure 2 It shows a schematic structural diagram of an improved Yolov9 - m recognition model provided in this embodiment;
[0064] Figure 3 It shows a schematic structural diagram of a spatial attention mechanism module provided in this embodiment;
[0065] Figure 4 It shows a schematic structural diagram of a rectangular dial provided in this embodiment;
[0066] Figure 5 It shows a schematic structural diagram of a circular dial provided in this embodiment;
[0067] Figure 6 It shows a schematic structural diagram of a square dial provided in this embodiment;
[0068] Figure 7 It shows a schematic framework diagram of a system for identifying low - level defects of substation meters provided in this embodiment. Detailed implementation manners
[0069] The following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only some embodiments of this application, rather than all embodiments.
[0070] Generally, the components of the embodiments of this application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of this application required to be protected, but only represents the selected embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of this application.
[0071] As used hereinafter, the terms "including", "having" and their cognates that may be used in various embodiments of the present application are only intended to denote a specific feature, number, step, operation, element, component, or a combination of the foregoing items, and should not be construed as precluding the existence of one or more other features, numbers, steps, operations, elements, components, or a combination of the foregoing items, or as precluding the possibility of adding one or more features, numbers, steps, operations, elements, components, or a combination of the foregoing items.
[0072] In addition, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0073] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art to which various embodiments of the present application pertain. The terms (such as those defined in a general-use dictionary) will be interpreted as having the same meaning as their contextual meaning in the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning, unless clearly defined in various embodiments of the present application.
[0074] The following will describe in detail some embodiments of the present application with reference to the accompanying drawings. Without conflict, the following embodiments and the features in the embodiments may be combined with each other.
[0075] Refer to Figure 1 , Figure 1 which is a schematic flowchart of a method for identifying low-position defects of substation meters provided for this embodiment. This method can quickly identify meters and determine the current state of the meters. The method includes:
[0076] S101. Obtain a substation meter image of the substation meter to be identified, input the substation meter image into an improved Yolov9-m meter recognition model, and perform dial area detection processing, scale area and indication area instance segmentation on the substation meter image through the improved Yolov9-m meter recognition model to obtain the dial area type, dial area detection frame, scale area mask, and indication area mask in the substation meter image; the dial area type is any one of a rectangular dial, a circular dial, and a square dial.
[0077] In scenarios such as substations, oil level gauges, pressure gauges, and lightning arrester detectors are usually installed at relatively high positions, making it often impossible to inspect them through normal observation means. Therefore, the method of using drone aerial photography is usually adopted to obtain images of various meters in the substation. After obtaining the images of each meter in the prior art, if the captured images are not clear enough, the images need to be processed. After the processing is completed, manual judgment is then required to determine whether the reading of the meter is normal or in a low-level defect state, and the whole process is very cumbersome. Moreover, some meters, such as rectangular oil level gauges, usually do not have pointers and only display the oil level. The existing pointer recognition methods often cannot recognize this type of meter. For meters with pointers, if the scale is blurred, it is also very difficult for the existing technology to recognize the accurate reading of the meter and determine whether the meter is in a low-level defect state.
[0078] To improve the recognition efficiency of meters, this embodiment provides a method for identifying low-level defects of substation meters. After obtaining the images of each meter, a series of processes for meter image processing and low-level defect recognition of meters are completed through a meter recognition model.
[0079] The meter recognition model can select an improved Yolov9-m recognition model. To make the model more suitable for meter recognition, a target detection module and an instance segmentation module can be embedded in the model to perform dual-type tasks of target detection and instance segmentation simultaneously.
[0080] For example, the obtained image of the substation meter to be recognized usually includes other irrelevant factors, such as external environmental factors and images of equipment such as oil tanks and lightning arresters. These factors can interfere with the recognition of the meter. Therefore, the type of the dial area can be determined first through the target detection module. The type of the dial area usually includes circular dials, square dials, and rectangular dials, as well as the corresponding dial area detection frames for the dial area type. The dial area detection frame is used to crop the meter image in the substation meter to be recognized to obtain the dial area image.
[0081] Then, the dial area image can be input into the instance segmentation module. Through the instance segmentation module, other dial area features can be obtained, such as the type of the scale area and the scale area mask. The type of the scale area generally includes arc and rectangular shapes, as well as the type of the indication area and the indication area mask. The type of the indication area generally includes pointers and oil bodies.
[0082] S102. Crop the substation meter image according to the dial area detection frame to obtain a dial area image. Obtain the dial area correction template of the dial area image from multiple standard templates of the dial area. Perform correction processing on the dial area image, the scale area mask, and the indication area mask according to the dial area correction template to obtain a corrected dial area image, a corrected scale area mask, and a corrected indication area mask.
[0083] The dial area image is cropped from the substation meter image through the dial area detection frame. Since errors may be caused to the image during the aerial photography process, after obtaining the dial area image, it is also necessary to correct the dial image. Usually, multiple standard templates can be formulated for each type of dial, and then a similarity algorithm is used to select one from the standard templates as the dial area correction template to correct the dial area image.
[0084] After selecting the dial area correction template, the dial area image, the scale area mask, and the indication area mask are corrected respectively through the corresponding correction algorithms to obtain a corrected dial area image, a corrected scale area mask, and a corrected indication area mask, so as to reduce the error of meter recognition.
[0085] S103. For different dial area types, calculate the total area of the scale area based on the corrected scale area mask, calculate the area of the indication area based on the corrected indication area mask, and judge whether the substation meter to be recognized is in a low-level defect state according to the total area of the scale area and the area of the indication area. If so, alarm for the substation meter to be recognized being in a low-level defect state.
[0086] Since there are multiple types of dial areas, different calculation methods need to be selected according to different dial area types to calculate the total area of the scale area and the area of the indication area, and then judge whether the substation meter to be recognized is in a low-level defect state according to the total area of the scale area and the area of the indication area, and alarm for the substation meter to be recognized being in a low-level defect state.
[0087] In this embodiment, the improved Yolov9-m meter recognition model is used to detect and instance segment the substation meter image to be recognized, obtaining the dial area type, the dial area detection frame, the scale area mask, and the indication area mask. Then, the substation meter image is cropped to obtain the dial area image, and the dial area image, the scale area mask, and the indication area mask are matched and corrected through a matching algorithm and a correction algorithm to obtain a corrected dial area image, a corrected scale area mask, and a corrected indication area mask. Then, the total area of the scale area and the area of the indication area are calculated, and it is judged whether the substation meter is in a low-level defect state according to the total area of the scale area and the area of the indication area, and an alarm is given for the substation meter to be recognized being in a low-level defect state. This application can quickly identify the low-level defect state of the substation meter and eliminate potential safety hazards in a timely manner.
[0088] In one embodiment, the improved Yolov9-m meter recognition model includes a backbone network, an improved feature pyramid network, and a head network. The improved feature pyramid network includes a spatial attention mechanism module and a fusion module. The head network includes a classification and regression processing module, a region of interest alignment module, and an instance segmentation module;
[0089] The process of performing dial area detection, scale area and indicator area instance segmentation on the substation meter image by the improved Yolov9-m meter recognition model includes:
[0090] Feature extraction is performed on the substation meter image through the backbone network to obtain multiple initial feature maps;
[0091] Multiple initial feature maps are input into the improved feature pyramid network. The spatial attention mechanism module processes the multiple initial feature maps to obtain multiple spatial attention feature maps. The fusion module fuses the multiple spatial attention feature maps to obtain a fused feature map;
[0092] The classification and regression processing module performs classification and regression processing on the fused feature map to obtain the dial area type and the dial area detection box in the substation meter image;
[0093] The region of interest alignment module obtains a region of interest feature map with a preset size according to the image region corresponding to the dial area detection box;
[0094] The instance segmentation module performs classification, regression, and instance segmentation processing on the region of interest feature map to obtain the scale area mask and the indicator area mask respectively.
[0095] Refer to Figure 2 , Figure 2 which is a schematic structural diagram of an improved Yolov9-m recognition model provided in this embodiment.
[0096] Generally speaking, for substation meter recognition, usually the dial area is recognized first, the dial area is cropped, and then based on the dial area image, the scale area and the pointer area are further recognized.
[0097] In this embodiment, in order to quickly obtain the dial area, the meter scale area and the pointer area, strategies such as dial area recognition and scale area and pointer area recognition are embedded in the Yolov9-m algorithm network structure, and a spatial attention mechanism module (SAM) is introduced, which can accurately and quickly extract the dial area type and rectangle box, the scale area type and the scale area mask, and the indicator area type and the scale area mask.
[0098] First, the substation meter image passes through the backbone network constructed by the RepNSCPELAN4 module. The backbone network includes 3 backbone network layers (Conv3 to Conv5), obtaining 3 layers of initial feature maps (F3 to F5), and is input into the improved Feature Pyramid Network PA-SAM-FPN. Then, the initial feature map F5 and the initial feature map F4 generate a spatial attention feature map SAF4 through the spatial attention mechanism module (SAM). The spatial attention feature map SAF4 is cascaded with the initial feature map F4 to generate an initial fusion feature map ~P4; the initial fusion feature map ~P4 and the initial feature map F3 generate a spatial attention feature map SAF3 through the spatial attention mechanism module, and the spatial attention feature map SAF3 is cascaded with the initial feature map F3 to generate a fusion feature map P3. The fusion feature map P3 passes through a convolutional layer to generate a convolutional feature map PAF4 with the same resolution as the fusion feature map P4; the convolutional feature map PAF4 is cascaded with the initial fusion feature map ~P4 to generate a fusion feature map P4; the fusion feature map P4 passes through a convolutional layer to generate a convolutional feature map PAF5 with the same resolution as F5; the convolutional feature map PAF5 is cascaded with F5 to generate a fusion feature map P5, thus obtaining a feature map fusion process from top to bottom and bottom to top (P3 to P5). Finally, the fusion feature maps P3 to P5 pass through the decoupled head and are respectively classified and regressed to obtain the detection results of the region of interest (the detection results of the region of interest include the dial type and the detection box of the dial area, and the detection box of the dial area can be a rectangular box); the feature map of the region of interest is obtained by using the rectangular box of the region of interest, and a feature map of the region of interest with a preset size is obtained through the region of interest alignment module according to the image region corresponding to the detection box of the dial area. The region of interest alignment module can be the ROI Align operator, generating a unified-sized ROI Align feature map through the ROIAlign operator; the ROI Align feature map passes through the decoupled head and is respectively classified, regressed, and segmented to complete the instance segmentation of the scale area and the indication area, thereby obtaining the scale area type and the scale area mask, and the indication area type and the scale area mask.
[0099] Based on the object detection in the dial area, this embodiment generates a unified-sized feature map of the region of interest through the region of interest alignment module, and then quickly completes the instance segmentation of the scale area and the indication area.
[0100] Refer to Figure 3 , Figure 3 which is a schematic structural diagram of a spatial attention mechanism module provided in this embodiment.
[0101] The initial feature map includes a low-level high-resolution feature map and a high-level low-resolution feature map. First, the low-level high-resolution feature map undergoes channel maximum pooling and channel average pooling respectively to obtain a single-channel maximum value feature map and a single-channel mean value feature map. Then, the single-channel maximum value feature map and the single-channel mean value feature map are concatenated along the channel dimension to obtain a two-channel feature map. After a 1x1 convolution operation, a single-channel feature map is obtained, and through an activation function, a spatially weighted feature map is obtained. Next, the high-level low-resolution feature map is convolved with a 1x1 kernel and upsampled to generate an upsampled feature map with the same resolution as the low-level high-resolution feature map. Finally, the upsampled feature map and the spatially weighted feature map are multiplied to obtain a spatial attention feature map.
[0102] In this embodiment, the Yolov9-m algorithm network is improved, and the spatial attention mechanism module is used to help the model focus on the key regions in the image, endowing the high-level feature map with the attention to the details of the low-level feature map, and also integrating the detailed information of the low-level feature map, thereby improving the overall feature representation ability, and further effectively improving the accuracy of substation meter object detection and instance segmentation.
[0103] In one implementation, when performing dial area detection, scale area and indication area instance segmentation through the improved Yolov9-m meter recognition model, if no dial area target is detected, the recognition of the next image is performed, and the meter result storage module is called to record that there is no dial area in this image. If there is a dial area target, no scale area mask, and no indication area mask, the recognition of the next image is performed, and the meter result storage module is called to record the dial type and rectangular box coordinates of this image.
[0104] If there is a dial area target, there is a scale area mask, and no indication area mask, the recognition of the next image is performed, and the meter result storage module is called to record the dial type and rectangular box coordinates, scale area type and scale area mask image of this image. If there is a dial area target, no scale area mask, and there is an indication area mask, the recognition of the next image is performed, and the meter result storage module is called to record the dial type and rectangular box coordinates, indication area type and mask image of this image.
[0105] If there is a dial area target, there is a scale area mask, and there is an indication area mask, it enters the dial area matching link, and the meter result storage module is called to record the dial type and rectangular box coordinates, scale area type and scale area mask, indication area type and indication area mask of this image.
[0106] In this embodiment, when the improved Yolov9-m meter recognition model is used to detect the dial area, and segment the scale area and the indication area of the meter image to be recognized, when one of the meter images to be recognized does not contain all the features to be recognized at the same time, the detection and segmentation results of multiple images can be combined to obtain accurate results, improving the accuracy of meter recognition.
[0107] In one implementation manner, the obtaining of the dial area correction template for the dial area image from multiple dial area standard templates includes:
[0108] Obtaining dial area standard templates corresponding to different dial area types;
[0109] Using a matching algorithm to determine, from multiple dial area standard templates, the dial area standard template with the highest similarity to the dial area image as the dial area correction template;
[0110] The performing of correction processing on the dial area image, the scale area mask, and the indication area mask according to the dial area correction template includes:
[0111] Calculating the homography matrix between the dial area image and the dial area correction template;
[0112] Performing correction on the dial area image, the scale area mask, and the indication area mask respectively through the homography matrix.
[0113] According to the dial area type, select the corresponding standard template. For example, if the dial area type is circular, then from the circular standard templates, use the matching algorithm to traverse and calculate the similarity between the standard template corresponding to the dial area type and the dial area image, and find the standard template of the dial area type with the highest similarity as the correction template for the dial area. Among them, the matching algorithm can be the Perceptual Hash algorithm, that is, the phash algorithm. The phash algorithm is a method for calculating similar pictures and can be used to detect the repeatability of pictures. If the contents of two pictures are similar, then their Perceptual Hash values will also be similar.
[0114] After determining the dial area correction template with the highest similarity to the dial area image, according to the dial area image and the dial area correction template, use the ORB key point algorithm to calculate the ORB key points of the dial area image and the ORB key points of the dial area correction template respectively, and further calculate the homography matrix between the ORB key points of the dial area image and the ORB key points of the dial area correction template.
[0115] Finally, through the multiplication operation between the homography matrix and the dial area image, the corrected dial area image is obtained. At the same time, through the multiplication operation between the homography matrix and the scale area mask and the indication area mask, the corrected scale area mask and the corrected indication area mask are obtained.
[0116] After obtaining the dial area image, the dial area type, the corrected scale area mask, and the corrected indication area mask, the total area of the scale area and the area of the indication area can be calculated. Since the calculation methods corresponding to different dial area types are different, the present application is classified as follows according to different dial area types.
[0117] This embodiment provides schematic structural diagrams of three different dials.
[0118] Figure 4 It is a schematic structural diagram of a rectangular dial provided for this embodiment.
[0119] Figure 5 It is a schematic structural diagram of a circular dial provided for this embodiment.
[0120] Figure 6 It is a schematic structural diagram of a square dial provided for this embodiment.
[0121] Generally speaking, the meters in a substation usually include two types. The first type of meter is a meter without a pointer, such as Figure 4 the oil level gauge shown in, which only shows the oil level. The second type of meter, such as Figure 5 and Figure 6 shown, is a meter that includes a pointer, such as a pressure gauge, a lightning arrester detector, etc.
[0122] For Figure 4 the rectangular dial without a pointer in, according to the scale area mask, the coordinates of 4 edge points (points A, B, C, and D) of the scale area are extracted, and the area of the scale area between the starting point and the ending point of the scale line is the area of the scale area mask, and its formula is:
[0123]
[0124] For Figure 5 and Figure 6 the circular or square dial with a pointer in, according to the scale area mask, the coordinates of the edge points of the scale area are extracted, and the gradient calculation (difference operation) is performed on the edge point coordinates, and the edge points with very small coordinate gradient changes are removed to obtain the effective scale area edge points. In this way, the two points with the largest coordinate gradient change among the effective scale area edge points are the starting point and the ending point of the scale line, and then an arbitrary target point on the circle , the center of the circle can be obtained and the radius of the circle , where is any point other than the starting point and the ending point of the scale line.
[0125] As Figure 5 or Figure 6 shown, the scale area is a sector area, which is a part of the circle. According to the characteristics of the circle and the center of the circle, the distance from the center of the circle to any point on the circle is the same. Therefore, based on three points , and on the circle, the position of the center of the circle and the radius of the circle can be calculated.
[0126] Then, the area of the scale area from the starting point to the ending point of the scale line is the sector area in the clockwise direction from the starting point to the ending point of the scale line, that is:
[0127]
[0128]
[0129]
[0130]
[0131] Among them, the total area of the scale area is , the area of the circle where the scale area mask of the circular dial is cut by the line connecting the scale starting point and the scale ending point is , and the area of the circle where the scale area mask of the square dial is cut by the line connecting the scale starting point and the scale ending point is .
[0132] Secondly, based on the corrected indication area mask, extract the coordinates of the edge points of the indication area, determine the indication position corresponding to the scale area, and then calculate the area of the indication area between the scale starting point and the indication position .
[0133] For Figure 4 the rectangular dial in , according to the oil body indication area mask, extract the coordinates of the edge points of the oil body indication area (points A, F, E, D), and the area of the indication area between the scale starting point and the indication position
[0134]
[0135] For Figure 5The circular dial or Figure 6 For the square dial in Figure 6 , according to the pointer indication area mask, extract the coordinates of the edge points of the pointer indication area, calculate the distance between the edge points of the pointer indication area and the edge points of the effective scale area, and select the edge point of the effective scale area corresponding to the shortest distance as the pointer indication position. The area of the indication area from the starting point of the scale area to the pointer indication position is the sector area in the clockwise direction from the starting point of the scale line to the pointer indication position, that is:
[0136]
[0137]
[0138] In this embodiment, different area calculation methods are selected according to different types of dials, which can be applied to various scenarios of meters, making the results of meter recognition more accurate.
[0139] In one implementation manner, determining whether the substation meter to be recognized is in a low - level defect state according to the total area of the scale area and the area of the indication area includes:
[0140] Calculate the area ratio between the area of the indication area and the total area of the scale area;
[0141] If the area ratio is greater than or equal to a preset area ratio threshold, determine that the substation meter to be recognized is in a normal state;
[0142] If the area ratio is less than the preset area ratio threshold, determine that the substation meter to be recognized is in a low - level defect state.
[0143] By using a preset area ratio threshold, that is, the meter low - level threshold, generally 20%, determine whether the meter reading is in a low - level defect state. Specifically, if the area ratio is greater than or equal to the meter low - level threshold, then the meter reading is in a normal state; if the area ratio is less than the meter low - level threshold, then the meter reading is in a low - level defect state, and potential hazards need to be checked in time.
[0144] In order to achieve low - level alarms for different meters, according to the meter type, or the meter image, etc., determine whether the meter is an oil - level meter, a pressure gauge, a lightning arrester detector, etc., and then generate different alarm methods according to different meters, such as voice announcements, so that the staff can quickly determine the meter in the low - level defect state according to the alarm.
[0145] Referring to Figure 7 , this embodiment also provides a substation meter low - level defect recognition system 700, including:
[0146] The detection and segmentation module 701 is used to obtain the substation meter image of the substation meter to be recognized, input the substation meter image into the improved Yolov9-m meter recognition model, and perform dial area detection processing, scale area and indication area instance segmentation on the substation meter image through the improved Yolov9-m meter recognition model, so as to obtain the dial area type, dial area detection frame, scale area mask and indication area mask in the substation meter image; the dial area type is any one of a rectangular dial, a circular dial and a square dial;
[0147] The matching and correction module 702 is used to crop the substation meter image according to the dial area detection frame to obtain a dial area image, obtain a dial area correction template of the dial area image from multiple dial area standard templates, and perform correction processing on the dial area image, the scale area mask and the indication area mask according to the dial area correction template to obtain a corrected dial area image, a corrected scale area mask and a corrected indication area mask;
[0148] The low-level defect identification module 703 is used to, for different dial area types, calculate the total area of the scale area based on the corrected scale area mask, calculate the area of the indication area based on the corrected indication area mask, and judge whether the substation meter to be recognized is in a low-level defect state according to the total area of the scale area and the area of the indication area. If so, an alarm is given for the substation meter to be recognized being in a low-level defect state.
[0149] It can be understood that the substation meter low-level defect identification system in this embodiment corresponds to the substation meter low-level defect identification method in the above embodiment. The optional items in the above embodiment are also applicable to this embodiment, so they will not be repeated here.
[0150] The present application also provides a computer device. Exemplarily, the computer device includes a processor and a memory. The memory stores a computer program, and the processor runs the computer program to enable the computer device to execute the above substation meter low-level defect identification method or the functions of each module in the above substation meter low-level defect identification system.
[0151] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, etc., and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application.
[0152] The memory can be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. Among them, the memory is used to store a computer program, and after receiving an execution instruction, the processor can execute the computer program accordingly.
[0153] The present application also provides a computer storage medium for storing the computer program used in the above computer device. Among them, the computer storage medium can be a readable storage medium, a non-volatile storage medium, or a volatile storage medium. For example, the computer storage medium can include, but is not limited to: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, etc., all of which are various media that can store program codes.
[0154] In several embodiments provided by this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and structural diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of this application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the blocks can occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the structural diagram and / or flowchart, as well as the combination of blocks in the structural diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0155] In addition, in each embodiment of this application, each functional module or unit can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.
[0156] If the described function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of this application.
[0157] As described above, the above are only the specific implementation manners of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered by the protection scope of this application.
Claims
1. A method for identifying low-level defects of substation meters, characterized in that: include: Obtain a substation meter image of a substation meter to be identified, input the substation meter image into an improved Yolov9-m meter recognition model, perform dial area detection processing and instance segmentation of the scale area and the indication area on the substation meter image through the improved Yolov9-m meter recognition model, and obtain a dial area type, a dial area detection frame, a scale area mask, and an indication area mask in the substation meter image; the dial area type is any one of a rectangular dial, a circular dial, and a square dial; The substation meter image is cropped according to the dial area detection frame to obtain a dial area image, a dial area correction template of the dial area image is obtained from a plurality of dial area standard templates, and the dial area image, the scale area mask and the indication area mask are corrected according to the dial area correction template to obtain a corrected dial area image, a corrected scale area mask and a corrected indication area mask; For different dial area types, the total area of the scale area is calculated based on the correction scale area mask, and the area of the indication area is calculated based on the correction indication area mask. According to the total area of the scale area and the area of the indication area, it is judged whether the substation meter to be identified is in a low-level defect state. If so, an alarm is issued that the substation meter to be identified is in a low-level defect state; The step of judging whether the substation meter to be identified is in a low-level defect state according to the total area of the scale area and the area of the indication area includes: Calculating the area ratio between the area of the indication region and the total area of the scale region; If the area ratio is greater than or equal to a preset area ratio threshold, it is determined that the substation meter to be identified is in a normal state; If the area ratio is less than the preset area ratio threshold, it is determined that the substation meter to be identified is in a low-level defect state; The improved Yolov9-m meter recognition model includes a backbone network, an improved feature pyramid network and a head network, wherein the improved feature pyramid network includes a spatial attention mechanism module and a fusion module, and the head network includes a classification regression processing module, an area of interest alignment module, and an instance segmentation module; The method of performing dial area detection processing, scale area and indication area instance segmentation on the substation meter image by using the improved Yolov9-m meter recognition model includes: Extracting features from the substation meter image through the backbone network to obtain a plurality of initial feature maps; Inputting a plurality of the initial feature maps into the improved feature pyramid network, processing the plurality of the initial feature maps through the spatial attention mechanism module to obtain a plurality of spatial attention feature maps, and fusing the plurality of the spatial attention feature maps through the fusion module to obtain a fused feature map; The fusion feature map is classified and regressed by the classification and regression processing module to obtain the dial area type and the dial area detection frame in the substation meter image; Obtaining a region of interest feature map of a preset size according to the image area corresponding to the dial area detection frame through the region of interest alignment module; The instance segmentation module performs classification, regression and instance segmentation processing on the feature map of the region of interest to obtain the scale region mask and the indication region mask respectively; The initial feature map includes a low-level high-resolution feature map and a high-level low-resolution feature map, and the processing of each of the initial feature maps by the spatial attention mechanism module includes: Performing channel maximum pooling on the low-level high-resolution feature map to obtain a single-channel maximum value feature map, and performing channel average pooling on the low-level high-resolution feature map to obtain a single-channel mean feature map; Perform channel concatenation on the single-channel maximum value feature map and the single-channel mean feature map to obtain a two-channel feature map, and perform a 1x1 convolution operation on the two-channel feature map to obtain a single-channel feature map; Processing the single-channel feature map through an activation function to obtain a spatial weighted feature map; The high-level low-resolution feature map is convolved and up-sampled by 1x1 to generate an up-sampled feature map with the same resolution as the low-level high-resolution feature map; The upsampled feature map is multiplied by the spatial weighted feature map to obtain the spatial attention feature map.
2. The method for identifying low-level defects of substation meters according to claim 1, characterized in that: For different dial area types, the total area of the scale area is calculated based on the corrected scale area mask, and the area of the indication area is calculated based on the corrected indication area mask, including: If the dial area type is the rectangular dial, four scale area edge points are extracted according to the corrected scale area mask; and the total scale area area corresponding to the rectangular dial is calculated according to the four scale area edge points; Four indication region edge points are extracted according to the corrected indication region mask, and the indication region area is calculated according to the four indication region edge points.
3. The method for identifying low-level defects of substation meters according to claim 1, characterized in that: For different dial area types, the total area of the scale area is calculated based on the corrected scale area mask, and the area of the indication area is calculated based on the corrected indication area mask, including: If the dial area type is the circular dial or the square dial, extract multiple scale area edge points according to the corrected scale area mask, and determine two points with the largest gradient change among the multiple scale area edge points as the scale start point and the scale end point; A target point is selected from the remaining edge points of the scale area, and the center and radius of the circle where the correction scale area mask is located are calculated according to the target point, the scale starting point and the scale end point, wherein the remaining edge point of the scale area is the coordinate of the plurality of edge points of the scale area excluding the scale starting point and the scale end point; Calculate the total area of the scale region according to the target point, the scale starting point, the scale end point, the center of the circle and the radius; Extracting a plurality of indication area edge points according to the corrected indication area mask, and calculating the distance between each of the indication area edge points and each of the scale area edge points; The shortest distance among the multiple distances is determined, the edge point of the scale area corresponding to the shortest distance is used as the pointer indication position, and the area of the indication area is calculated according to the pointer indication position.
4. The method for identifying low-level defects of substation meters according to claim 3 is characterized in that: Calculating the total area of the scale region according to the target point, the scale starting point, the scale end point, the center of the circle and the radius includes: If the dial area type is the circular dial, the total area of the scale area of the circular dial is calculated according to the following formula 1; Formula 1: ; If the dial area type is the square dial, the total area of the scale area of the square dial is calculated according to the following formula 2; Formula 2: ; in, The starting point of the scale is , the end point of the scale is , the target point is , the center of the circle is , the radius is r, and the total area of the scale area is The area of the circle where the scale area mask of the circular dial is located is cut by the line connecting the scale starting point and the scale end point. The area of the circle where the scale area mask of the square dial is located is cut by the line connecting the scale starting point and the scale end point. ; The calculating the area of the indicated region according to the position indicated by the pointer comprises: The area of the indicated region is calculated according to the following formula 3 and formula 4; Formula 3: Formula 4: The pointer indicates the position , the indicated area is .
5. The method for identifying low-level defects of a substation meter according to any one of claims 1 to 4, characterized in that: The step of acquiring a dial area correction template of the dial area image from a plurality of dial area standard templates comprises: Get the standard templates of the dial area corresponding to different dial area types; Determine, by using a matching algorithm, from the plurality of standard dial area templates, a standard dial area template having the greatest similarity to the dial area image as the dial area correction template; The correcting process of the dial area image, the scale area mask and the indication area mask according to the dial area correction template includes: Calculating a homography matrix between the dial area image and the dial area correction template; The dial area image, the scale area mask and the indication area mask are corrected respectively by the homography matrix.
6. Substation meter low-level defect identification system, characterized by: include: A detection and segmentation module, used for acquiring a substation meter image of a substation meter to be identified, inputting the substation meter image into an improved Yolov9-m meter recognition model, performing dial area detection processing and instance segmentation of a scale area and an indication area on the substation meter image through the improved Yolov9-m meter recognition model, and obtaining a dial area type, a dial area detection frame, a scale area mask and an indication area mask in the substation meter image; the dial area type is any one of a rectangular dial, a circular dial and a square dial; A matching correction module, used for cropping the substation meter image according to the dial area detection frame to obtain a dial area image, obtaining a dial area correction template of the dial area image from a plurality of dial area standard templates, and performing correction processing on the dial area image, the scale area mask and the indication area mask according to the dial area correction template to obtain a corrected dial area image, a corrected scale area mask and a corrected indication area mask; A low-level defect recognition module is used for calculating the total area of the scale area based on the correction scale area mask, and calculating the area of the indication area based on the correction indication area mask for different dial area types, and judging whether the substation meter to be identified is in a low-level defect state according to the total area of the scale area and the area of the indication area, and if so, giving an alarm that the substation meter to be identified is in a low-level defect state; The step of judging whether the substation meter to be identified is in a low-level defect state according to the total area of the scale area and the area of the indication area includes: Calculating the area ratio between the area of the indication region and the total area of the scale region; If the area ratio is greater than or equal to a preset area ratio threshold, it is determined that the substation meter to be identified is in a normal state; If the area ratio is less than the preset area ratio threshold, it is determined that the substation meter to be identified is in a low-level defect state; The improved Yolov9-m meter recognition model includes a backbone network, an improved feature pyramid network and a head network, wherein the improved feature pyramid network includes a spatial attention mechanism module and a fusion module, and the head network includes a classification regression processing module, an area of interest alignment module, and an instance segmentation module; The method of performing dial area detection processing, scale area and indication area instance segmentation on the substation meter image by using the improved Yolov9-m meter recognition model includes: Extracting features from the substation meter image through the backbone network to obtain a plurality of initial feature maps; Inputting a plurality of the initial feature maps into the improved feature pyramid network, processing the plurality of the initial feature maps through the spatial attention mechanism module to obtain a plurality of spatial attention feature maps, and fusing the plurality of the spatial attention feature maps through the fusion module to obtain a fused feature map; The fusion feature map is classified and regressed by the classification and regression processing module to obtain the dial area type and the dial area detection frame in the substation meter image; Obtaining a region of interest feature map of a preset size according to the image area corresponding to the dial area detection frame through the region of interest alignment module; The instance segmentation module performs classification, regression and instance segmentation processing on the feature map of the region of interest to obtain the scale region mask and the indication region mask respectively; The initial feature map includes a low-level high-resolution feature map and a high-level low-resolution feature map, and the processing of each of the initial feature maps by the spatial attention mechanism module includes: Performing channel maximum pooling on the low-level high-resolution feature map to obtain a single-channel maximum value feature map, and performing channel average pooling on the low-level high-resolution feature map to obtain a single-channel mean feature map; Perform channel concatenation on the single-channel maximum value feature map and the single-channel mean feature map to obtain a two-channel feature map, and perform a 1x1 convolution operation on the two-channel feature map to obtain a single-channel feature map; Processing the single-channel feature map through an activation function to obtain a spatial weighted feature map; The high-level low-resolution feature map is convolved and up-sampled by 1x1 to generate an up-sampled feature map with the same resolution as the low-level high-resolution feature map; The upsampled feature map is multiplied by the spatial weighted feature map to obtain the spatial attention feature map.
7. A computer device, characterized in that: The computer device comprises a processor and a memory, the memory stores a computer program, and the processor is used to execute the computer program to implement the substation meter low-level defect identification method according to any one of claims 1-5.
8. A computer storage medium, characterized in that The computer program is stored therein, and when the computer program is executed on a processor, the method for identifying low-level defects of a substation meter according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Instrument panel pointer reading prediction method and device, computer equipment and storage medium
CN112115896A
Reading identification method and system for pointer type instrument of substation equipment
CN117746025A