Pointer type meter identification method and device
By constructing multiple models for meter detection, classification and semantic segmentation, the location and range of meters are automatically identified, which solves the problem of requiring preset information in the existing technology and improves the efficiency and accuracy of meter identification.
Patent Information
- Application Number
- CN202410944088.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-10-18
AI Technical Summary
The existing automated meter identification method requires preset ledger information and cannot automatically identify meter types, resulting in heavy workload and low identification efficiency, and the inability to accurately identify dial scales.
Build multiple models for meter detection, classification, key point detection and pointer semantic segmentation, collect images through drones or robots, automatically identify the meter location, type and range, fit the dial structure to obtain readings, and avoid template matching and reliance on preset information.
It improves the efficiency and accuracy of meter identification, can automatically identify meter types and select ranges without manual intervention, and enhances the accuracy of readings.
Smart Images

Figure CN118799543A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of meter identification, and in particular to a pointer-type meter identification method and device. Background Art
[0002] At present, the power and new energy industries use analog meters to monitor equipment operation data. In the past, analog meter readings were read manually, but manual meter reading is time-consuming and labor-intensive, which easily leads to low efficiency and inaccurate data. Therefore, automatic meter recognition technology came into being to enable computers to more accurately analyze and recognize the data of analog dials and realize automatic meter reading.
[0003] Most of the existing automatic meter recognition methods rely on target detection and template matching technology. First, the target meter is identified through target detection, and then the target meter is matched with the pre-marked template meter through template matching to obtain the target meter position; then the position of the target mark pointer is detected based on key point detection; the position of the identified meter pointer and the range of the type of meter are obtained to obtain the reading of the target meter. However, this method requires that the ledger information of each meter at each location be preset, and the meter and marking information be recorded, which is a lot of work; it cannot automatically identify the meter type, and it is necessary to rely on the ledger information to select the meter range. Summary of the invention
[0004] The present invention provides a pointer-type meter identification method and device to solve the technical problem that the existing automatic meter identification method requires preset ledger information and cannot automatically identify the meter type.
[0005] In order to solve the above technical problems, the present invention provides a pointer meter identification method, comprising:
[0006] Constructing a meter detection model, identifying the location information of a target meter in an inspection image according to the meter detection model, and acquiring an image of the target meter according to the location information;
[0007] Constructing a meter classification model, identifying a meter type in the target meter image according to the meter classification model, and acquiring a corresponding meter range according to the meter type;
[0008] Constructing a key point detection model, identifying dial scale key points according to the key point detection model, identifying target dial scale according to the dial scale key points, and fitting a dial structure according to the target dial scale;
[0009] Constructing a meter pointer semantic segmentation model, identifying the pointer position information of the meter in the target meter image according to the pointer semantic segmentation model, and obtaining a simulated dial according to the pointer position information and the dial structure;
[0010] The reading of the target meter in the inspection image is determined according to the analog dial, the pointer position information and the meter range.
[0011] The present invention constructs several different models to perform dial detection, dial type classification, dial scale key point detection and meter pointer semantic segmentation on the inspection image, thereby fitting the dial scale key points and meter pointer obtained by detection to obtain a simulated dial, so as to identify the reading of the target meter in the inspection image according to the simulated dial. There is no need to set a template, and the meter type and meter range are automatically identified, so as to improve the recognition efficiency; and through the recognition of the dial scale key points, the dial scale can be more accurately identified, the dial structure can be simulated, and the dial reading accuracy can be improved.
[0012] Furthermore, the construction of the meter detection model is specifically as follows:
[0013] Collecting a meter image set according to the inspection of the drone or robot, wherein the meter image set includes meter images of all meters to be identified;
[0014] Annotating all meter images in the meter image set according to rectangular frames to generate a first data set;
[0015] A meter detection model is constructed according to a target detection algorithm, and the meter detection model is trained according to the first data set and a first loss function until a preset condition is met, and the trained meter detection model is output; the first loss function includes a classification loss and a target box regression loss.
[0016] Furthermore, the construction of the meter classification model is specifically as follows:
[0017] Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified;
[0018] Annotating the meter image according to the meter type to generate a second data set;
[0019] A meter classification model is constructed according to a classification algorithm, and the meter classification model is trained according to the second data set and a cross entropy loss function until a preset condition is met, and the trained meter classification model is output.
[0020] Furthermore, before acquiring the corresponding meter range according to the meter type, the method further includes:
[0021] Obtain meter types of all meter images, and determine meter ranges corresponding to the meters according to the meter images;
[0022] A range table is generated according to the meter type and the corresponding meter range.
[0023] Furthermore, the key point detection model is constructed as follows:
[0024] Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified;
[0025] Annotate the meter image according to the dial scale lines to generate a third data set;
[0026] A key point detection model is constructed according to the key point detection algorithm, and the key point detection model is trained according to the third data set and the second loss function until a preset condition is met, and the trained key point detection model is output; the second loss function includes classification loss, target box regression loss, key point classification loss and key point confidence loss.
[0027] Furthermore, the construction of the meter pointer semantic segmentation model is specifically as follows:
[0028] Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified;
[0029] Annotate the pointer position information in the meter image according to the polygonal frame to generate a fourth data set;
[0030] A meter pointer semantic segmentation model is constructed according to atrous convolution and pyramid pooling, and the meter pointer semantic segmentation model is trained according to the fourth data set and the third loss function until a preset condition is met, and the trained meter pointer semantic segmentation model is output; the third loss function includes a cross entropy loss function.
[0031] Further, the determining of the reading of the target meter in the inspection image according to the analog dial, the pointer position information and the meter range is specifically:
[0032] Performing a homogenization correction process on the dial scale of the analog dial; and performing an image corrosion process on the pointer area of the analog dial;
[0033] Determine the position information of the pointer in the analog dial relative to the dial scale, and calculate the pointer position ratio according to the position information;
[0034] The reading of the target meter in the inspection image is determined according to the pointer position ratio and the meter range.
[0035] In a second aspect, the present invention provides a pointer-type meter identification device, comprising: a meter detection module, a meter classification module, a key point identification module, a pointer identification module and a reading module;
[0036] The meter detection module is used to construct a meter detection model, identify the location information of the target meter in the inspection image according to the meter detection model, and obtain the target meter image according to the location information;
[0037] The meter classification module is used to construct a meter classification model, identify the meter type in the target meter image according to the meter classification model, and obtain the corresponding meter range according to the meter type;
[0038] The key point recognition module is used to construct a key point detection model, identify the dial scale key points according to the key point detection model, identify the target dial scale according to the dial scale key points, and fit the dial structure according to the target dial scale;
[0039] The pointer recognition module is used to construct a semantic segmentation model for a meter pointer, identify the pointer position information of a meter in a target meter image according to the pointer semantic segmentation model, and obtain a simulated dial according to the pointer position information and the dial structure;
[0040] The reading module is used to determine the reading of the target meter in the inspection image according to the analog dial, the pointer position information and the meter range.
[0041] In a third aspect, the present invention provides a computer device comprising: a processor, a communication interface and a memory, wherein the processor, the communication interface and the memory are interconnected, wherein the memory stores an executable program code, and the processor is used to call the executable program code to execute the pointer meter identification method.
[0042] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions implement the pointer meter identification method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of a flow chart of a pointer meter identification method provided by an embodiment of the present invention;
[0044] Figure 2 A flow chart of a meter detection model training of a pointer meter identification method provided in an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of a marking target meter of the pointer meter identification method provided in an embodiment of the present invention;
[0046] Figure 4 A flow chart of a meter classification model training of a pointer meter identification method provided in an embodiment of the present invention;
[0047] Figure 5 A key point detection model training flow chart of a pointer meter recognition method provided in an embodiment of the present invention;
[0048] Figure 6 A schematic diagram of key point marking of a pointer meter identification method provided by an embodiment of the present invention;
[0049] Figure 7 A training flow chart of a semantic segmentation model of a meter pointer of a pointer meter recognition method provided in an embodiment of the present invention;
[0050] Figure 8 A pointer marking schematic diagram of a pointer meter identification method provided by an embodiment of the present invention;
[0051] Fig. 9 Another schematic diagram of a flow chart of a pointer meter identification method provided by an embodiment of the present invention;
[0052] Fig.10 A dial fitting schematic diagram of a pointer meter identification method provided by an embodiment of the present invention;
[0053] Fig.11 A schematic structural diagram of a pointer meter identification device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] Embodiment 1
[0056] Please refer to Figure 1 , Figure 1 A flowchart of a pointer meter identification method provided by an embodiment of the present invention includes steps 101 to 105, which are specifically as follows:
[0057] Step 101: constructing a meter detection model, identifying the location information of a target meter in an inspection image according to the meter detection model, and acquiring an image of the target meter according to the location information;
[0058] In this embodiment, the construction of the meter detection model is specifically as follows:
[0059] Collecting a meter image set according to the inspection of the drone or robot, wherein the meter image set includes meter images of all meters to be identified;
[0060] Annotating all meter images in the meter image set according to rectangular frames to generate a first data set;
[0061] A meter detection model is constructed according to a target detection algorithm, and the meter detection model is trained according to the first data set and a first loss function until a preset condition is met, and the trained meter detection model is output; the first loss function includes a classification loss and a target box regression loss.
[0062] Please refer to Figure 2 , Figure 2 A flow chart of a meter detection model training for a pointer meter identification method provided in an embodiment of the present invention.
[0063] In this embodiment, for application scenarios such as meter identification in a substation, inspection images of all meters in a substation or other plant are taken by drone or robot inspection, and the inspection images cover all meter images that require algorithm identification.
[0064] In this embodiment, if Figure 3 As shown, all meters in the inspection image are marked with rectangular frames, a first data set of meters is constructed by marking a large amount of inspection image data, and the first data set is divided into a first training set and a first test set.
[0065] In this embodiment, the meter detection model M is constructed according to the classic yo l ov8-detect model detect .
[0066] In this embodiment, the meter detection model is trained by a first training set, a first test set and a first loss function. The first loss function is composed of a classification loss and a target box regression loss, specifically:
[0067] Loss= RegressionLoss + BCE (1)
[0068] Among them, BCE is the classification loss and RegressionLoss is the target box regression loss.
[0069] In this embodiment, the classification loss BCE is specifically:
[0070]
[0071] Among them, y is the true value and y1 is the predicted value.
[0072] In this embodiment, the target box regression loss RegressionLoss is specifically:
[0073] RegressionLoss=DFL + CIOU (3)
[0074] In this embodiment, the DFL (distributed feature loss, data average fidelity) loss function optimizes the probabilities of the two positions closest to the label y, one on the left and one on the right, in the form of cross entropy, so that the network can focus on the distribution of the neighboring area of the target position more quickly. Specifically:
[0075] DFL_Loss(S i ,S i+1 )=-((y i+1 -y)log(S i )+(yy i )log(S i+1 )) (4)
[0076] Among them, y is the target value, and y i+1 ≤y≤y i+1 . S i represents the predicted probability at position i; S i+1 Represents the predicted probability at position i+1.
[0077] In this embodiment, the CIOU loss function is composed of overlapping area, center point distance and aspect ratio to further refine the coordinate position.
[0078]
[0079] Among them, box represents the prediction box, box gt Represents the true target box; IoU(box,box gt ) means box,box gt The intersection and union ratio of 2 Indicates box,box gt The center point distance; ρ 2 (box,box gt ) means box,box gt The overlapping area; α is the weight parameter, specifically:
[0080]
[0081] v is a parameter that measures the aspect ratio of the predicted box and the real box, specifically:
[0082]
[0083] Among them, w gt Indicates the width of the real box, h gt Represents the height of the real box; w represents the width of the predicted box, and h represents the height of the predicted box.
[0084] In this embodiment, the meter detection model is trained by using a first loss function until the model converges to obtain a trained meter detection model.
[0085] Step 102: constructing a meter classification model, identifying the meter type in the target meter image according to the meter classification model, and acquiring the corresponding meter range according to the meter type;
[0086] In this embodiment, the construction of the meter classification model is specifically as follows:
[0087] Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified;
[0088] Annotating the meter image according to the meter type to generate a second data set;
[0089] A meter classification model is constructed according to a classification algorithm, and the meter classification model is trained according to the second data set and a cross entropy loss function until a preset condition is met, and the trained meter classification model is output.
[0090] Please refer to Figure 4 , Figure 4 A flow chart of a meter classification model training for a pointer meter identification method provided in an embodiment of the present invention.
[0091] In this embodiment, inspection images taken during inspections are obtained, and all meter images are captured from the inspection images. The meter types of all meter images are labeled to generate a second data set, and the second data set is divided into a second training set and a second test set.
[0092] In this embodiment, the meter classification model M is constructed by the classic ResNet50 model. cls , and train the meter classification model according to the second data set and the cross entropy loss function, wherein the cross entropy loss function is specifically:
[0093]
[0094] Where M represents the number of meter types; y ic If the real meter type of sample i is equal to category c, then y = 1, otherwise y = 0; p ic represents the predicted probability that sample i belongs to category c.
[0095] In this embodiment, the meter classification model is trained until convergence to obtain the meter classification model M cls .
[0096] In this embodiment, before acquiring the corresponding meter range according to the meter type, the method further includes:
[0097] Obtain meter types of all meter images, and determine meter ranges corresponding to the meters according to the meter images;
[0098] A range table is generated according to the meter type and the corresponding meter range.
[0099] As shown in Table 1, Table 1 is a range table of the pointer meter identification method provided by an embodiment of the present invention.
[0100]
[0101] Table 1
[0102] In this embodiment, a meter range is preset for each type of meter, and a meter range table is prepared. After the meter type is identified through the classification model, the range of the corresponding meter can be obtained through the meter range table.
[0103] Step 103: construct a key point detection model, identify the key points of the dial scale according to the key point detection model, identify the target dial scale according to the dial scale key points, and fit the dial structure according to the target dial scale;
[0104] In this embodiment, the key point detection model is constructed as follows:
[0105] Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified;
[0106] Annotate the meter image according to the dial scale lines to generate a third data set;
[0107] A key point detection model is constructed according to the key point detection algorithm, and the key point detection model is trained according to the third data set and the second loss function until a preset condition is met, and the trained key point detection model is output; the second loss function includes classification loss, target box regression loss, key point classification loss and key point confidence loss.
[0108] Please refer to Figure 5 , Figure 5 A key point detection model training flow chart of the pointer meter recognition method provided in an embodiment of the present invention.
[0109] In this embodiment, inspection images taken during inspections are obtained, and all meter images are captured from the inspection images. Key points of the dials of all meter images are annotated to generate a third data set, and the third data set is divided into a third training set and a third test set.
[0110] Please refer to Figure 6 , Figure 6 A schematic diagram of key point marking of a pointer meter identification method provided in an embodiment of the present invention.
[0111] In this embodiment, all scale lines on the dial are used as the key points of the dial.
[0112] In this embodiment, a key point detection model is constructed based on the classic yo l o-pose model, so as to use the dial scale key point detection to simulate the dial method. The target dial scale is identified through the dial scale key point recognition technology, and the arc dial structure is fitted.
[0113] In this embodiment, the key point detection model is trained according to the third data set and the second loss function. The second loss function includes classification loss, target box regression loss, key point classification loss and key point confidence loss, specifically:
[0114]
[0115] Among them, λ cls , box , kpts , kpts_conf are the coefficients of each loss function, λ cls Set to 0.5, set to 0.05, λ kpts Set to 0.1, λ kpts_conf Set to 0.5.
[0116] L cls is the classification loss, specifically:
[0117]
[0118] Where y is the true value and y1 is the predicted value.
[0119] L box is the target box regression loss, specifically:
[0120] L box =1-CIOU (11)
[0121] L kpts is the key point classification loss, specifically:
[0122]
[0123] Among them, d n Represents the distance between the predicted point and the true point of the nth key point; k n is a hyperparameter, which indicates the weight of the nth key point; s indicates the size of the target; δ(v n )=Visual symbol representing each key point.
[0124] For L kpts_conf Key point confidence loss, specifically:
[0125]
[0126] in, Represents the prediction confidence of the nth key point.
[0127] In this embodiment, the key point detection model is trained until convergence to obtain the key point detection model M kpts .
[0128] Step 104: constructing a meter pointer semantic segmentation model, identifying the pointer position information of the meter in the target meter image according to the pointer semantic segmentation model, and obtaining a simulated dial according to the pointer position information and the dial structure;
[0129] In this embodiment, the construction of the meter pointer semantic segmentation model is specifically as follows:
[0130] Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified;
[0131] Annotate the pointer position information in the meter image according to the polygonal frame to generate a fourth data set;
[0132] A meter pointer semantic segmentation model is constructed according to atrous convolution and pyramid pooling, and the meter pointer semantic segmentation model is trained according to the fourth data set and the third loss function until a preset condition is met, and the trained meter pointer semantic segmentation model is output; the third loss function includes a cross entropy loss function.
[0133] Please refer to Figure 7 and Figure 8 , Figure 7 8 is a training flow chart of a meter pointer semantic segmentation model of a pointer meter recognition method provided in an embodiment of the present invention; 8 is a pointer annotation schematic diagram of a pointer meter recognition method provided in an embodiment of the present invention.
[0134] In this embodiment, inspection images taken during inspection are obtained, and all meter images are captured from the inspection images. The pointers of the meter images are marked according to polygonal boxes to generate a fourth data set, and the fourth data set is divided into a fourth training set and a fourth test set.
[0135] In this embodiment, a semantic segmentation model is constructed based on the classic Deep l abV3+ model, the input image is classified at the pixel level, and the model is trained using a pixel-by-pixel cross entropy loss function, where the pixel-by-pixel cross entropy loss function is:
[0136]
[0137] Among them, w and h represent the width and height of the output feature map respectively; Represents the classification prediction probability of pixel (i, j).
[0138] In this embodiment, the semantic segmentation model is trained according to the pixel-by-pixel cross entropy loss function, the fourth training set and the fourth test set until the model converges to obtain the meter pointer semantic segmentation model M seg .
[0139] Step 105: Determine the reading of the target meter in the inspection image according to the analog dial, the pointer position information and the meter range.
[0140] Please refer to Fig. 9 , Fig. 9 Another schematic flow chart of a pointer meter identification method provided in an embodiment of the present invention.
[0141] In this embodiment, after acquiring the inspection image, the inspection image is input into a target detection model, which is a meter detection model. The location information of the target meter in the inspection image is acquired based on the meter detection model. The location information includes a target frame, and the target meter image is captured based on the target frame.
[0142] In this embodiment, the target meter image is input into a meter classification model, a key point detection model and a meter pointer semantic segmentation model respectively.
[0143] Please refer to Fig.10 , Fig.10 A dial fitting schematic diagram of a pointer meter identification method provided in an embodiment of the present invention.
[0144] In this embodiment, the meter type in the target meter image is identified according to the meter classification model, and the corresponding meter range is acquired according to the meter type.
[0145] In this embodiment, the dial scale key points are identified according to the key point detection model, and the target dial scale is identified according to the dial scale key points, so that the arc-shaped dial structure is fitted according to the target dial scale.
[0146] In this embodiment, the pointer position information of the meter in the target meter image is identified according to the pointer semantic segmentation model, and an analog dial is obtained according to the pointer position information and the dial structure, so as to identify the meter reading according to the analog dial, the pointer position information and the meter range.
[0147] In this embodiment, the determination of the reading of the target meter in the inspection image according to the analog dial, the pointer position information and the meter range is specifically as follows:
[0148] Performing a homogenization correction process on the dial scale of the analog dial; and performing an image corrosion process on the pointer area of the analog dial;
[0149] Determine the position information of the pointer in the analog dial relative to the dial scale, and calculate the pointer position ratio according to the position information;
[0150] The reading of the target meter in the inspection image is determined according to the pointer position ratio and the meter range.
[0151] In this embodiment, the meter reading is obtained by multiplying the meter range by the ratio to obtain the target meter reading.
[0152] In this embodiment, several different models are constructed to perform dial detection, dial type classification, dial scale key point detection, and meter pointer semantic segmentation on the inspection image, so as to fit the dial scale key points and meter pointer obtained by detection to obtain a simulated dial, so as to identify the reading of the target meter in the inspection image according to the simulated dial. There is no need to set a template, and the recognition efficiency is improved by automatically identifying the meter type and automatically selecting the meter range; and through the recognition of the dial scale key points, the dial scale can be more accurately identified, the dial structure can be simulated, and the accuracy of the dial reading can be improved.
[0153] Please refer to Fig.11 , Fig.11 A schematic diagram of a pointer meter identification device provided by an embodiment of the present invention includes: a meter detection module 1101, a meter classification module 1102, a key point identification module 1103, a pointer identification module 1104 and a reading module 1105;
[0154] The meter detection module 1101 is used to construct a meter detection model, identify the location information of the target meter in the inspection image according to the meter detection model, and obtain the target meter image according to the location information;
[0155] The meter classification module 1102 is used to construct a meter classification model, identify the meter type in the target meter image according to the meter classification model, and obtain the corresponding meter range according to the meter type;
[0156] The key point recognition module 1103 is used to construct a key point detection model, identify the dial scale key points according to the key point detection model, identify the target dial scale according to the dial scale key points, and fit the dial structure according to the target dial scale;
[0157] The pointer recognition module 1104 is used to construct a semantic segmentation model for a meter pointer, recognize the pointer position information of a meter in a target meter image according to the pointer semantic segmentation model, and obtain a simulated dial according to the pointer position information and the dial structure;
[0158] The reading module 1105 is used to determine the reading of the target meter in the inspection image according to the analog dial, the pointer position information and the meter range.
[0159] In this embodiment, the meter detection module is specifically used for:
[0160] Collecting a meter image set according to the inspection of the drone or robot, wherein the meter image set includes meter images of all meters to be identified;
[0161] Annotating all meter images in the meter image set according to rectangular frames to generate a first data set;
[0162] A meter detection model is constructed according to a target detection algorithm, and the meter detection model is trained according to the first data set and a first loss function until a preset condition is met, and the trained meter detection model is output; the first loss function includes a classification loss and a target box regression loss.
[0163] In this embodiment, the classification module is specifically used for:
[0164] Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified;
[0165] Annotating the meter image according to the meter type to generate a second data set;
[0166] A meter classification model is constructed according to a classification algorithm, and the meter classification model is trained according to the second data set and a cross entropy loss function until a preset condition is met, and the trained meter classification model is output.
[0167] In this embodiment, before acquiring the corresponding meter range according to the meter type, the method further includes:
[0168] Obtain meter types of all meter images, and determine meter ranges corresponding to the meters according to the meter images;
[0169] A range table is generated according to the meter type and the corresponding meter range.
[0170] In this embodiment, the key point identification module is specifically:
[0171] Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified;
[0172] Annotate the meter image according to the dial scale lines to generate a third data set;
[0173] A key point detection model is constructed according to the key point detection algorithm, and the key point detection model is trained according to the third data set and the second loss function until a preset condition is met, and the trained key point detection model is output; the second loss function includes classification loss, target box regression loss, key point classification loss and key point confidence loss.
[0174] In this embodiment, the pointer identification module is specifically used for:
[0175] Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified;
[0176] Annotate the pointer position information in the meter image according to the polygonal frame to generate a fourth data set;
[0177] A meter pointer semantic segmentation model is constructed according to atrous convolution and pyramid pooling, and the meter pointer semantic segmentation model is trained according to the fourth data set and the third loss function until a preset condition is met, and the trained meter pointer semantic segmentation model is output; the third loss function includes a cross entropy loss function.
[0178] In this embodiment, the reading module is specifically used for:
[0179] Performing a homogenization correction process on the dial scale of the analog dial; and performing an image corrosion process on the pointer area of the analog dial;
[0180] Determine the position information of the pointer in the analog dial relative to the dial scale, and calculate the pointer position ratio according to the position information;
[0181] The reading of the target meter in the inspection image is determined according to the pointer position ratio and the meter range.
[0182] An embodiment of the present invention also provides a computer device, comprising: a processor, a communication interface and a memory, wherein the processor, the communication interface and the memory are interconnected, wherein the memory stores an executable program code, and the processor is used to call the executable program code to execute the pointer meter identification method.
[0183] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the pointer meter identification method is implemented.
[0184] In this embodiment, several different models are constructed to perform dial detection, dial type classification, dial scale key point detection, and meter pointer semantic segmentation on the inspection image, so as to fit the dial scale key points and meter pointer obtained by detection to obtain a simulated dial, so as to identify the reading of the target meter in the inspection image according to the simulated dial. There is no need to set a template, and the recognition efficiency is improved by automatically identifying the meter type and automatically selecting the meter range; and through the recognition of the dial scale key points, the dial scale can be more accurately identified, the dial structure can be simulated, and the accuracy of the dial reading can be improved.
[0185] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A pointer meter identification method, characterized in that: include: Constructing a meter detection model, identifying location information of a target meter in an inspection image based on the meter detection model, and acquiring an image of the target meter based on the location information; Constructing a meter classification model, identifying a meter type in the target meter image according to the meter classification model, and obtaining a corresponding meter range according to the meter type; Constructing a key point detection model, identifying dial scale key points according to the key point detection model, identifying target dial scale according to the dial scale key points, and fitting a dial structure according to the target dial scale; Constructing a meter pointer semantic segmentation model, identifying the pointer position information of the meter in the target meter image according to the pointer semantic segmentation model, and obtaining an analog dial according to the pointer position information and the dial structure; The reading of the target meter in the inspection image is determined according to the analog dial, the pointer position information and the meter range.
2. The pointer meter identification method according to claim 1, wherein: The construction of the meter detection model is specifically as follows: Collecting a meter image set based on inspection by a drone or robot, wherein the meter image set includes meter images of all meters to be identified; Annotating all meter images in the meter image set according to rectangular frames to generate a first data set; A meter detection model is constructed according to a target detection algorithm, and the meter detection model is trained according to the first data set and a first loss function until a preset condition is met, and the trained meter detection model is output; the first loss function includes a classification loss and a target box regression loss.
3. The pointer meter identification method according to claim 1, wherein: The construction of the meter classification model is specifically as follows: Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified; Annotating the meter image according to meter type to generate a second data set; A meter classification model is constructed according to a classification algorithm, and the meter classification model is trained according to the second data set and a cross entropy loss function until a preset condition is met, and the trained meter classification model is output.
4. The pointer meter identification method according to claim 1, wherein: Before acquiring the corresponding meter range according to the meter type, the method further includes: Obtain the meter types of all meter images, and determine the meter ranges corresponding to the meters based on the meter images; A range table is generated according to the meter type and the corresponding meter range.
5. The pointer meter identification method according to any one of claims 1 to 4, characterized in that: The key point detection model is constructed as follows: Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified; Annotate the meter image according to dial scale lines to generate a third data set; A key point detection model is constructed according to the key point detection algorithm, and the key point detection model is trained according to the third data set and the second loss function until the preset conditions are met, and the trained key point detection model is output; the second loss function includes classification loss, target box regression loss, key point classification loss and key point confidence loss.
6. The pointer meter identification method according to claim 1, wherein: The construction of the meter pointer semantic segmentation model is specifically as follows: Acquire a meter image set, wherein the meter image set includes meter images of all meters to be identified; marking the pointer position information in the meter image according to the polygonal frame to generate a fourth data set; A meter pointer semantic segmentation model is constructed based on void convolution and pyramid pooling, and the meter pointer semantic segmentation model is trained according to the fourth data set and a third loss function until a preset condition is met, and the trained meter pointer semantic segmentation model is output; the third loss function includes a cross-entropy loss function.
7. The pointer meter identification method according to claim 1, wherein: The method of determining the reading of the target meter in the inspection image according to the analog dial, the pointer position information and the meter range is as follows: Performing a homogenization correction process on the dial scale of the analog dial; and performing an image corrosion process on the pointer area of the analog dial; Determining position information of a pointer in the analog dial relative to the dial scale, and calculating a pointer position ratio based on the position information; The reading of the target meter in the inspection image is determined according to the pointer position ratio and the meter range.
8. A pointer meter identification device, characterized in that: include: Meter detection module, meter classification module, key point identification module, pointer identification module and reading module; The meter detection module is used to construct a meter detection model, identify the location information of the target meter in the inspection image according to the meter detection model, and obtain the target meter image according to the location information; The meter classification module is configured to construct a meter classification model, identify the meter type in the target meter image according to the meter classification model, and obtain the corresponding meter range according to the meter type; The key point recognition module is used to build a key point detection model, identify dial scale key points according to the key point detection model, identify target dial scale according to the dial scale key points, and fit the dial structure according to the target dial scale; The pointer recognition module is used to build a semantic segmentation model for the meter pointer, identify the pointer position information of the meter in the target meter image according to the pointer semantic segmentation model, and obtain the analog dial according to the pointer position information and the dial structure; The reading module is used to determine the reading of the target meter in the inspection image according to the analog dial, pointer position information and the meter range.
9. A computer device, characterized in that: include: A processor, a communication interface, and a memory, wherein the processor, the communication interface, and the memory are interconnected, wherein the memory stores an executable program code, and the processor is used to call the executable program code to execute the pointer meter identification method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the pointer meter identification method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Pointer instrument identification and reading method based on deep learning
CN116386019A
Cited By
Power meter reading method, device and equipment based on key points and storage medium
CN120260053A
