WO2023103894A1 - Nameplate recognition model training method, nameplate recognition method, and related apparatuses - Google Patents

Nameplate recognition model training method, nameplate recognition method, and related apparatuses Download PDF

Info

Publication number
WO2023103894A1
WO2023103894A1 PCT/CN2022/136080 CN2022136080W WO2023103894A1 WO 2023103894 A1 WO2023103894 A1 WO 2023103894A1 CN 2022136080 W CN2022136080 W CN 2022136080W WO 2023103894 A1 WO2023103894 A1 WO 2023103894A1
Authority
WO
WIPO (PCT)
Prior art keywords
area data
nameplate
data
label
loss value
Prior art date
Application number
PCT/CN2022/136080
Other languages
French (fr)
Chinese (zh)
Inventor
李可敬
郑耀辉
邓淑敏
方伟坚
程启祥
刘文生
Original Assignee
广东电网有限责任公司东莞供电局
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广东电网有限责任公司东莞供电局 filed Critical 广东电网有限责任公司东莞供电局
Publication of WO2023103894A1 publication Critical patent/WO2023103894A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application relates to the technical field of electric power, for example, it relates to a training of a nameplate recognition model, a nameplate recognition method and related devices.
  • OCR Optical Character Recognition
  • This application proposes a nameplate recognition model training, a nameplate recognition method and a related device, in order to solve the problem that the content of the nameplate is peeled off and the result of optical character recognition is wrong.
  • the embodiment of the present application provides a training method for a nameplate recognition model
  • the nameplate recognition model includes an encoder and a regression network
  • the method includes:
  • sample image data collected on nameplates installed on electrical equipment and equipment parameters recorded on the nameplates, wherein the sample image data includes sample area data where multiple boxes are located;
  • the difference between the reference point and the label point the difference between the reference area data and the label area data, the encoder, the regression network and the decoder are trained until The reference points are aligned with the reference region data, which the decoder discards when training is complete.
  • the embodiment of the present application also provides a method for identifying a nameplate, including:
  • target image data for nameplates installed on electrical equipment, where the target image data includes target area data where multiple boxes are located;
  • the embodiment of the present application also provides a training device for a nameplate recognition model
  • the nameplate recognition model includes an encoder and a regression network
  • the device includes:
  • the sample acquisition module is configured to acquire the sample image data collected on the nameplate installed on the electric equipment, the equipment parameters recorded in the nameplate, and the sample image data includes the sample area data where multiple boxes are located;
  • the label area data generation module is configured to write the device parameters located in the box on the imprint in the sample area data as label area data;
  • a label point sampling module is configured to sample label points for the device parameters in the label area data
  • a feature data extraction module configured to input the sample image data into the encoder to extract feature data
  • a reference point sampling module configured to input the characteristic data into the regression network, and sample reference points for the imprints in the sample area data
  • a reference area data reconstruction module configured to input the feature data into a decoder, and reconstruct the imprint in the sample area data into fonts as reference area data;
  • An auxiliary training module configured to perform training on the encoder, the regression network, and the The decoder trains until the reference point is aligned with the reference region data, the decoder discards when training is complete.
  • the embodiment of the present application also provides a nameplate identification device, including:
  • the nameplate recognition model loading module is configured to load the nameplate recognition model trained according to the method described in the first aspect
  • the target image data collection module is configured to collect target image data for nameplates installed on electric equipment, and the target image data includes target area data where multiple boxes are located;
  • a feature data extraction module configured to input the target image data into the encoder to extract feature data
  • the target point sampling module is configured to input the characteristic data into the regression network, and sample target points for the imprints in the target area data;
  • a reconstructed image data generation module configured to write the target point in the target image data on the imprint in the target area data to obtain reconstructed image data
  • the optical character recognition module is configured to perform optical character recognition on the reconstructed image data to obtain the device parameters recorded in the nameplate.
  • the embodiment of the present application also provides a computer device, the computer device comprising:
  • the processor When the program is executed by the processor, the processor implements the nameplate recognition model training method according to the first aspect or the nameplate recognition method according to the second aspect.
  • the embodiment of the present application also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the nameplate identification as described in the first aspect is realized The training method of the model or the nameplate recognition method as described in the second aspect.
  • FIG. 1 is a flowchart of a training method for a nameplate recognition model provided in Embodiment 1 of the present application;
  • FIG. 2 is an example diagram of a nameplate provided in Embodiment 1 of the present application.
  • Fig. 3 is a flowchart of a method for identifying a nameplate provided in Embodiment 2 of the present application;
  • FIG. 4 is a schematic structural diagram of a training device for a nameplate recognition model provided in Embodiment 3 of the present application;
  • FIG. 5 is a schematic structural diagram of a nameplate identification device provided in Embodiment 4 of the present application.
  • FIG. 6 is a schematic structural diagram of a computer device provided in Embodiment 5 of the present application.
  • Figure 1 is a flow chart of a training method for a nameplate recognition model provided in Embodiment 1 of the present application.
  • This embodiment is applicable to the situation of training a nameplate recognition model for auxiliary optical character recognition, and the method can be implemented by a training device for a nameplate recognition model.
  • the training device of the nameplate recognition model can be implemented by software and/or hardware, and can be configured in computer equipment, such as servers, workstations, personal computers, etc., the method includes the following steps:
  • Step 101 Obtain sample image data collected from nameplates installed on electrical equipment and equipment parameters recorded on the nameplates.
  • technicians When promoting digital management of electrical equipment, technicians will collect image data on the nameplate installed on the electrical equipment, use optical character recognition technology to identify the equipment parameters recorded in the nameplate on the image data, and manually check the equipment through technical personnel. The parameters are proofread and entered into the database.
  • the image data can be extracted from the database, recorded as sample image data, and the device parameters corresponding to the image data can be extracted, and the sample image data and device parameters can be reused as the data for training the nameplate recognition model, which can reduce labeling data workload.
  • Step 102 write the device parameters located in the box on the imprint in the sample area data as the label area data.
  • the information recorded on the nameplate generally includes the type of electric equipment, the equipment parameters recorded on the nameplate, the manufacturer of the electric equipment, and the like.
  • the equipment parameters of electric equipment include parameter names and parameter values.
  • parameter names and parameter values are different.
  • Some parameter values can be divided into numerical values and units, and some parameter values cannot be divided into numerical values and units, such as model .
  • parameter name and parameter value are generally located on the same line, and the parameter name is generally located before the parameter value.
  • the parameter name of one of the equipment parameters is "rated frequency” and the parameter value is "50Hz", where "50” is a value, and "Hz” is a unit of Hertz
  • the parameter name of another device parameter is "high voltage rated voltage” and the parameter value is "12KV”, where "12” is the value and "KV” is the kilovolt unit.
  • the nameplate is produced for the same type of electrical equipment, not for a specific type of electrical equipment. Therefore, before leaving the factory, the nameplate will be printed with some information common to different types of electrical equipment in the equipment parameters, such as the parameter name, while for the equipment parameters Some information that is not common to different types of electrical equipment is left blank, such as parameter values.
  • the unit of the parameter value can be included as common information and pre-recorded before leaving the factory, or it can be included as non-common information.
  • the model of the electrical equipment is determined after the nameplate leaves the factory, so that the model can be identified using a marking machine.
  • the parameter values in are engraved into the boxes.
  • part of the information in the box is prone to paint off during the outdoor aging process, leaving imprints, which are prone to errors in the process of optical character recognition.
  • the nameplate recognition model for assisted optical character recognition can be trained for imprints.
  • the box can be used as the target, and the target detection algorithm can be used to detect and crop the box in the sample image data.
  • the area of is recorded as the sample area data, that is, the sample image data contains the sample area data where multiple boxes are located, so that the device parameters located in the box are written on the imprint of the corresponding sample area data, which is recorded as Label area data to achieve nameplate restoration.
  • the sample area data can be divided into first sample area data with fonts (i.e., device parameters) and second sample area data with prints, that is, the device parameters in the first sample area data are not lost.
  • lacquer presents relatively clear, colored (usually black, red, etc.) fonts, and does not show imprints
  • the original equipment parameters in the data of the second sample area are lacquered, and cannot present clear, colored (usually Black, red, etc.) fonts show imprints instead.
  • the style parameter is written on the imprint of the second sample area data as the label area data, thereby improving the authenticity of the nameplate.
  • Step 103 sampling label points for the device parameters in the label area data.
  • the device parameters in the label area data belong to visible fonts, and the device parameters in the label area data are down-sampled to obtain a plurality of points constituting the device parameters (ie, fonts), which are marked as label points.
  • the label points can be considered as the trend of the strokes of the device parameters (ie font).
  • Step 104 Input the sample image data into the encoder to extract feature data.
  • the regression network and the decoder Decoder share the low-latitude encoder Encoder, and the decoder Decoder can be used to enhance the ability of the encoder Encoder to extract the strokes of the font, so that the strokes of the encoder Encoder font assist in training the regression network.
  • the Encoder does not enhance the ability to extract the strokes of the font, and the points extracted by the regression network do not fall on the strokes of the font. The reason is that the Encoder and the regression network are optimal during training. Yes, it is not the Encoder, the regression network, and the Decoder that are optimal.
  • the information learned by the encoder Encoder is more mixed information, that is, the points of the font and the strokes of the font are mixed, and the influence of the strokes of the font on the points of the font is strengthened. Therefore, the points of the font are more sensitive to the strokes of the font, and the points of the font are placed on the strokes of the font.
  • the role of the Encoder is to transform an input sequence of variable length into a background variable of fixed length, and encode the input sequence information in the background variable.
  • the basic module of encoder Encoder uses multiple convolutional layers, pooling layer Polling (such as average pooling), mainly realizes the function of feature extraction, that is, extracts feature data on the trend from sample image data , to extract the feature data on the texture.
  • pooling layer Polling such as average pooling
  • Step 105 input the characteristic data into the regression network, and sample the reference points of the imprints in the sample area data.
  • the regression network includes ShufflenetV2, MobileNet, ShuffleNetV1, Sception, etc., for identifying points in traces in image data.
  • ShufflenetV2 divides the input feature data into two branches in the channel dimension, and concatenates the outputs of the two branches into one feature element.
  • the ShuffleNetv2 network is a lightweight neural network, a neural network model with a small number of parameters and a low computational cost. Using the ShuffleNetv2 network for high-dimensional feature extraction can reduce the computing resource consumption of the regression network and improve the recognition efficiency of points.
  • the sample area data is input into the regression network, and the regression network samples a plurality of points from the imprint in the sample area data, which are recorded as reference points.
  • Step 106 Input the feature data into the decoder, and reconstruct the imprints in the sample area data into fonts as reference area data.
  • the initial time step input of the Decoder comes from a specific symbol.
  • the Decoder searches out the symbol in a time step, the output sequence is completed.
  • the background variable output by the encoder Encoder encodes the information of the entire input sequence. Given the output sequence in the training sample, for each time step, the conditional probability output by the decoder Decoder will be calculated based on the previous output sequence and background variables.
  • the decoder Decoder is usually a multi-layer RNN. For the time step of the output sequence, the decoder Decoder takes the output of the previous time step and the background variable as input, and transforms them and the hidden state of the previous time step into the current time step hidden state.
  • the feature data is input into the Decoder, and the Decoder reconstructs the imprints in the sample area data into fonts, which are recorded as reference area data.
  • Step 107 According to the difference between the reference point and the label point, and the difference between the reference area data and the label area data, train the encoder, regression network and decoder until the reference point and the reference area data are aligned.
  • the difference between the reference point and the label point, and the difference between the reference area data and the label area data can be calculated respectively, so as to perform backpropagation on the encoder and backpropagation on the regression network respectively.
  • Backpropagation and backpropagation to the decoder update the weights in the encoder, the weights in the regression network and the weights in the decoder, respectively, until the reference point is aligned with the reference area data.
  • the so-called alignment can mean that the trend of the reference point and the reference area data are consistent.
  • the reference point and the reference area data fit together.
  • the encoder, regression network and decoder training Complete store the encoder, regression network, including storing the structure and parameters of the encoder, the structure and parameters of the regression network, in addition, the decoder is discarded when the training is completed.
  • step 107 may include the following steps:
  • Step 1071 Calculate the difference between the reference point and the label point as the first loss value.
  • the reference point and the label point are substituted into the preset first loss function, and the difference between the reference point and the label point is calculated to obtain the first loss value, that is, the first loss value is used to evaluate the reference point
  • the overall positional deviation between the (predicted value) and the label point (true value) which can be used to update the regression network.
  • the norm distance L2 between the reference point and the label point may be calculated, and an average value of all norm distances L2 may be calculated as the first loss value.
  • Step 1072 Calculate the difference between the reference area data and the label area data as a second loss value.
  • the reference area data and the label area data are substituted into the preset second loss function, and the difference between the reference area data and the label area data is calculated to obtain the second loss value, that is, the second loss value is used
  • the overall writing deviation between the evaluation reference point (reference area data) and label point (label area data) can be used to update the decoder.
  • the reference area data may be converted into a first matrix
  • the label area data may be converted into a second matrix
  • the Euclidean distance between the first matrix and the second matrix may be calculated as the second loss value
  • Step 1073 Combine the first loss value and the second loss value into a third loss value.
  • the first loss value and the second loss value can be fused to obtain a third loss value
  • the third loss value can be used to update the encoder by integrating the position deviation and the stroke deviation.
  • the first loss value and the second loss value may be linearly fused to obtain the third loss value.
  • the product of the first loss value and the first weight is calculated as the first weight adjustment value; on the other hand, the product of the second loss value and the second weight is calculated as the second For the weight adjustment value, the first weight is greater than the second weight, and the sum of the first weight adjustment value and the second weight adjustment value is calculated as the third loss value.
  • the first weight is greater than the second weight.
  • Step 1074 respectively use the first loss value to update the regression network, use the second loss value to update the decoder, and use the third loss value to update the encoder.
  • the first loss value is substituted into optimization algorithms such as stochastic gradient descent (SGD) and adaptive momentum (Adaptive momentum, Adam) to calculate the update range of weights in the regression network, so that according to the update Magnitude updates the weights in the regression network.
  • optimization algorithms such as stochastic gradient descent (SGD) and adaptive momentum (Adaptive momentum, Adam) to calculate the update range of weights in the regression network, so that according to the update Magnitude updates the weights in the regression network.
  • Step 1075 judge whether the number of current iterations reaches the preset threshold, based on the judgment result that the number of current iterations reaches the preset threshold, execute step 1076, and return to execute based on the judgment result that the number of current iterations does not reach the preset threshold Step 104.
  • Step 1076 determine that the training of the encoder, regression network and decoder is completed, and discard the decoder.
  • a threshold value can be set in advance for the number of iterations as a stop condition. In each round of iterative training, the number of current iterations is counted, so as to determine whether the number of times of training the encoder, regression network, and decoder in the current iteration reaches the threshold. threshold.
  • the threshold it can be considered that the training of the encoder, regression network and decoder is completed. At this time, the weights in the encoder and regression network are recorded respectively, and the decoder is discarded.
  • the next round of iterative training can be entered, and the iterative training is repeated in this way until the training of the encoder, regression network and decoder is completed.
  • the encoder, regression network and decoder are trained offline, the structure and weight of the encoder and regression network are recorded, and distributed to the detection device in various ways.
  • the detection device can load the encoder and regression network, Detect the equipment parameters recorded on the nameplate on the electrical equipment.
  • the nameplate recognition model includes an encoder and a regression network to obtain sample image data collected from nameplates installed on electrical equipment and equipment parameters recorded in the nameplate.
  • the sample image data includes samples where multiple boxes are located. Area data; write the device parameters located in the box into the imprint in the sample area data as label area data; sample label points for the device parameters in the label area data; input the sample image data into the encoder to extract feature data;
  • the characteristic data is input into the regression network, and the reference point is sampled for the imprint in the sample area data; the feature data is input into the decoder, and the imprint in the sample area data is reconstructed into a font as the reference area data; according to the relationship between the reference point and the label point
  • the difference between the reference point and the label region data, the encoder, the regression network and the decoder are trained until the reference point is aligned with the reference region data, and the decoder is discarded when the training is completed.
  • This embodiment uses written strokes as supervision to help the low-dimensional features of the regression network focus on the information extraction of strokes.
  • the points that help regression can fall on the written strokes, that is, Help the regression point to fall on the engraved trace, reorganize the written strokes instead of falling on the experience value, avoid overfitting and make the written strokes unable to be composed, and the regression point can fall on the written strokes, which can be more accurate
  • the help of optical character recognition it can improve the accuracy of identifying the equipment parameters recorded in the nameplate, reduce the cost of manual proofreading and entering the database, reduce the time spent, and greatly improve the efficiency.
  • Fig. 3 is a flow chart of a nameplate recognition method provided in Embodiment 2 of the present application.
  • This embodiment is applicable to the situation where a nameplate recognition model is used to assist in the recognition of a nameplate of an electric device, and the method can be executed by a nameplate recognition device.
  • the identification device of the nameplate can be implemented by software and/or hardware, and can be configured in computer equipment, such as servers, workstations, personal computers, mobile terminals (such as mobile phones, tablet computers, etc.), and the method includes the following steps:
  • Step 301 load the nameplate recognition model.
  • a nameplate recognition model can be trained in advance, and the nameplate recognition model is used to recognize equipment parameters recorded in the nameplate (image data).
  • the nameplate recognition model includes an encoder and a regression network.
  • the training method of the nameplate recognition model is as follows:
  • the difference between the reference point and the label point the difference between the reference area data and the label area data, the encoder, the regression network and the decoder are trained until the reference point and the reference area data are aligned.
  • the decoder throw away.
  • Step 302 collecting target image data of nameplates installed on electric equipment.
  • the user can collect image data facing the nameplate installed on the electrical equipment, which is recorded as target image data.
  • the target image data includes areas where multiple boxes are located, which is recorded as target area data.
  • Step 303 Input the target image data into the encoder to extract feature data.
  • the target image data is input into the encoder, and the encoder processes the target image data to extract low-latitude feature data.
  • Step 304 input the feature data into the regression network, and sample the target points for the footprints in the target area data.
  • the feature data is input into the regression network, and the regression network samples multiple points from the imprint in the target area data, which are recorded as target points.
  • Step 305 Write the target point on the imprint in the target area data in the target image data to obtain reconstructed image data.
  • Step 306 perform optical character recognition on the reconstructed image data, and obtain the equipment parameters recorded in the nameplate.
  • deep learning technology can be applied to perform optical character recognition on the reconstructed image data to obtain information recorded on the nameplate, for example, end-to-end text recognition algorithm (End-to-End Text Spotting), end-to-end text spotting Detection and recognition algorithm (FOTS), text box recognition algorithm (TextBoxes), text detection algorithm (PSENet), etc.
  • End-to-End Text Spotting end-to-end text recognition algorithm
  • FOTS end-to-end text spotting Detection and recognition algorithm
  • TextBoxes text box recognition algorithm
  • PSENet text detection algorithm
  • the target point In the case of relatively dense target points, the target point can be considered as the trend of the strokes of the device parameters (fonts), and the compatibility of OCR is strong. The impact of the trend of strokes on OCR is significantly greater than the details of the strokes.
  • the target points in the reconstructed image data will be recognized as fonts, and in the case of a good trend, the success rate of recognition can be improved.
  • the information recorded on the nameplate generally includes the type of the electric equipment, the equipment parameters recorded on the nameplate, the manufacturer of the electric equipment, and the like.
  • the type of power equipment and the manufacturer of the power equipment are generally located at specific positions such as the top and bottom of the nameplate, and the type of power equipment and the manufacturer of the power equipment are relatively fixed. Therefore, the power can be identified by location or keywords.
  • the device parameters include parameter names and parameter values.
  • the parameter names and parameter values are generally located in the same line, and the parameter names are generally located before the parameter values. Then, optical character recognition can be performed on the reconstructed image data to obtain text information.
  • the parameter value can be divided into numerical value and unit.
  • the unit may be printed behind the box before the nameplate leaves the factory, that is, the box is used to record the numerical value in the parameter value, and the unit may also be in the The nameplate is engraved in the box after leaving the factory, that is, the box is used to record the value and unit of the parameter value, then, if the text information in the box is the unit, the text information is determined to be the parameter value recorded in the nameplate .
  • the information recorded on the identified nameplate (such as the type of electrical equipment, the equipment parameters recorded in the nameplate, the manufacturer of the electrical equipment, etc.), it can be stored in the database according to the established format.
  • the nameplate recognition model is loaded; the target image data is collected for the nameplate installed on the electric equipment, and the target image data includes the target area data where multiple boxes are located; the target image data is input into the encoder to extract feature data ;Input the feature data into the regression network, and sample the target point on the imprint in the target area data; write the target point in the target image data on the imprint in the target area data to obtain the reconstructed image data; execute on the reconstructed image data Optical character recognition to obtain equipment parameters recorded in the nameplate.
  • This embodiment uses written strokes as supervision to help the low-dimensional features of the regression network focus on the information extraction of strokes.
  • the points that help regression can fall on the written strokes, that is, Help the regression point to fall on the engraved trace, reorganize the written strokes instead of falling on the experience value, avoid overfitting and make the written strokes unable to be composed, and the regression point can fall on the written strokes, which can be more accurate
  • the help of optical character recognition it can improve the accuracy of identifying the equipment parameters recorded in the nameplate, reduce the cost of manual proofreading and entering the database, reduce the time spent, and greatly improve the efficiency.
  • Fig. 4 is a structural block diagram of a training device for a nameplate recognition model provided in Embodiment 3 of the present application.
  • the nameplate recognition model includes an encoder and a regression network.
  • the device may include the following modules:
  • the sample acquisition module 401 is configured to acquire the sample image data collected on the nameplate installed on the electric equipment, the equipment parameters recorded in the nameplate, and the sample image data includes the sample area data where multiple boxes are located;
  • the label area data generation module 402 is configured to write the device parameters located in the box on the imprint in the sample area data as label area data;
  • the label point sampling module 403 is configured to sample label points for the device parameters in the label area data
  • a feature data extraction module 404 configured to input the sample image data into the encoder to extract feature data
  • the reference point sampling module 405 is configured to input the feature data into the regression network, and sample reference points for the imprints in the sample area data;
  • the reference area data reconstruction module 406 is configured to input the characteristic data into the decoder, and reconstruct the imprint in the sample area data into a font as the reference area data;
  • Auxiliary training module 407 configured to train the encoder, the regression network and the The decoder is trained until the reference point is aligned with the reference region data, and the decoder is discarded when training is complete.
  • the label area data generation module 402 is also set to:
  • sample area data into first sample area data having fonts and second sample area data having prints
  • the auxiliary training module 407 is also set to:
  • the auxiliary training module 407 is also set to:
  • An average value is calculated for the norm distance as a first loss value.
  • the auxiliary training module 407 is also set to:
  • the auxiliary training module 407 is also set to:
  • the first weight is greater than the second weight.
  • the nameplate recognition model training device provided in the embodiment of the present application can execute the nameplate recognition model training method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method.
  • Fig. 5 is a structural block diagram of a nameplate identification device provided in Embodiment 4 of the present application, and the device may include the following modules:
  • the nameplate recognition model loading module 501 is configured to load the nameplate recognition model
  • the target image data collection module 502 is configured to collect target image data for the nameplate installed on the electrical equipment, and the target image data includes target area data where multiple boxes are located;
  • the feature data extraction module 503 is configured to input the target image data into the encoder to extract feature data
  • the target point sampling module 504 is configured to input the feature data into the regression network, and sample target points for the imprints in the target area data;
  • the reconstructed image data generation module 505 is configured to write the target point in the target image data on the imprint in the target area data to obtain reconstructed image data;
  • the optical character recognition module 506 is configured to perform optical character recognition on the reconstructed image data to obtain the device parameters recorded in the nameplate.
  • the nameplate recognition model includes an encoder and a regression network
  • the training method of the nameplate recognition model is as follows:
  • sample image data collected on nameplates installed on electrical equipment and equipment parameters recorded on the nameplates, wherein the sample image data includes sample area data where multiple boxes are located;
  • the difference between the reference point and the label point the difference between the reference area data and the label area data, the encoder, the regression network and the decoder are trained until The reference points are aligned with the reference region data, which the decoder discards when training is complete.
  • the device parameters include parameter names and parameter values
  • the optical character recognition module 506 is also set to:
  • the text information in the box is a unit, it is determined that the text information is the parameter value recorded in the nameplate.
  • the nameplate recognition device provided in the embodiment of the present application can execute the nameplate recognition method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method.
  • FIG. 6 is a schematic structural diagram of a computer device provided in Embodiment 5 of the present application.
  • FIG. 6 shows a block diagram of an exemplary computer device 12 suitable for implementing embodiments of the present application.
  • the computer device 12 shown in FIG. 6 is only one example.
  • computer device 12 takes the form of a general-purpose computing device.
  • Components of computer device 12 may include at least one processor or processing unit 16 , memory 28 , and bus 18 connecting various system components including memory 28 and processing unit 16 .
  • Bus 18 represents at least one of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus structures.
  • bus structures include, for example, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MCA) bus, the Enhanced ISA bus, the Video Electronics Standard Association (VESA) ) Local bus and Peripheral Component Interconnect (PCI) bus.
  • ISA Industry Standard Architecture
  • MCA Micro Channel Architecture
  • VESA Video Electronics Standard Association
  • PCI Peripheral Component Interconnect
  • Computer device 12 may include a variety of computer system readable media. Such media can be all available media that can be accessed by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
  • Memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32 .
  • Computer device 12 may include other removable/non-removable, volatile/nonvolatile computer system storage media.
  • storage system 34 may be used to read from and write to non-removable, non-volatile magnetic media (commonly referred to as a "hard drive”).
  • Disk drives for reading and writing to removable non-volatile disks (such as "floppy disks") and for removable non-volatile optical disks (such as Compact Disc-Read Only Memory (CD) -ROM), Digital Video Disc-Read Only Memory (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) CD-ROM drive.
  • each drive may be connected to bus 18 via at least one data medium interface.
  • Memory 28 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present application.
  • a program/utility tool 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including an operating system, at least one application program, other program modules, and program data, in these examples
  • Each or a combination may include implementations of network environments.
  • the program modules 42 generally perform the functions and/or methods of the embodiments described herein.
  • Computer device 12 may also communicate with at least one external device 14 (e.g., a keyboard, pointing device, display 24, etc.), and at least one device that enables a user to interact with 12 A device (eg, network card, modem, etc.) capable of communicating with at least one other computing device. This communication can be performed through an input/output (Input/Output, I/O) interface 22 .
  • the computer device 12 can also communicate with at least one network (such as a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN) and/or a public network, such as the Internet) through the network adapter 20.
  • network adapter 20 communicates with other modules of computer device 12 via bus 18 .
  • the processing unit 16 executes various functional applications and data processing by running the programs stored in the memory 28 , for example, implementing the nameplate recognition model training method or the nameplate recognition method provided in the embodiment of the present application.
  • Embodiment 6 of the present application also provides a computer-readable storage medium, on which a computer program is stored.
  • a computer program is stored.
  • the computer program is executed by a processor, each process of the above-mentioned nameplate recognition model training method or nameplate recognition method is realized. , and can achieve the same technical effect, in order to avoid repetition, it will not be repeated here.
  • the computer-readable storage medium may include, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination thereof.
  • Examples of computer readable storage media include: an electrical connection having at least one lead, a portable computer disk, a hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (such as electronic programmable read-only memory (Electronic Programable Read Only Memory, EPROM) or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or a suitable combination of the above.
  • a computer-readable storage medium may be a tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

Abstract

Provided in the present application are a nameplate recognition model training method, a nameplate recognition method, and related apparatuses. The nameplate recognition model training method comprises: acquiring sample image data, which is collected from a nameplate that is mounted on a power device, and device parameters, which are recorded in the nameplate; writing the device parameters, which are located in boxes, into an imprint in sample area data, and taking same as label area data; sampling a label point from the device parameters in the label area data; inputting the sample image data into an encoder and extracting feature data; inputting the feature data into a regression network, and sampling a reference point from the imprint in the sample area data; inputting the feature data into a decoder, reconstructing the imprint in the sample area data into characters, and taking the characters as reference area data; and training the encoder, the regression network and the decoder according to the difference between the reference point and the label point and the difference between the reference area data and the label area data, until the reference point is aligned with the reference area data.

Description

铭牌识别模型的训练、铭牌的识别方法及相关装置Nameplate recognition model training, nameplate recognition method and related devices
本公开要求在2021年12月7日提交中国专利局、申请号为202111479203.X的中国专利申请的优先权,以上申请的全部内容通过引用结合在本申请中。This disclosure claims priority to a Chinese patent application with application number 202111479203.X filed with the China Patent Office on December 7, 2021, the entire contents of which are incorporated herein by reference.
技术领域technical field
本申请涉及电力的技术领域,例如涉及一种铭牌识别模型的训练、铭牌的识别方法及相关装置。The present application relates to the technical field of electric power, for example, it relates to a training of a nameplate recognition model, a nameplate recognition method and related devices.
背景技术Background technique
在电力行业中,电力设备的种类、数量繁多,如电力液压鼓式制动器、电力电缆、电力变压器、综合配电箱、电能计量箱等,这些电力设备的设备参数通常刻录在铭牌上,该铭牌装贴在电力设备上。In the power industry, there are many types and quantities of power equipment, such as electro-hydraulic drum brakes, power cables, power transformers, integrated distribution boxes, electric energy metering boxes, etc. The equipment parameters of these power equipment are usually recorded on the nameplate, the nameplate Mounted on electrical equipment.
在推进数字化管理的过程时,技术人员会对铭牌采集图像数据,对该图像数据使用光学字符识别(Optical Character Recognition,OCR)技术识别铭牌的内容。When promoting the process of digital management, technicians will collect image data on the nameplate, and use Optical Character Recognition (OCR) technology to identify the content of the nameplate on the image data.
但是,由于电力设备多部署在户外,铭牌老化较为明显,部分内容掉漆,导致光学字符识别的结果出错,此时往往需要技术人人工对这些内容进行校对、并录入数据库,花费的时间较长,效率较低。However, since the power equipment is mostly deployed outdoors, the aging of the nameplate is relatively obvious, and some of the contents are peeled off, resulting in errors in the results of optical character recognition. At this time, technical personnel are often required to manually proofread these contents and enter them into the database, which takes a long time , the efficiency is low.
发明内容Contents of the invention
本申请提出了一种铭牌识别模型的训练、铭牌的识别方法及相关装置,以解决铭牌的内容掉漆导致光学字符识别的结果出错的问题。This application proposes a nameplate recognition model training, a nameplate recognition method and a related device, in order to solve the problem that the content of the nameplate is peeled off and the result of optical character recognition is wrong.
第一方面,本申请实施例提供了一种铭牌识别模型的训练方法,所述铭牌识别模型包括编码器、回归网络,所述方法包括:In the first aspect, the embodiment of the present application provides a training method for a nameplate recognition model, the nameplate recognition model includes an encoder and a regression network, and the method includes:
获取对安装在电力设备上的铭牌采集的样本图像数据、所述铭牌中记录的设备参数,所述样本图像数据中包含多个方框所在的样本区域数据;Acquiring sample image data collected on nameplates installed on electrical equipment and equipment parameters recorded on the nameplates, wherein the sample image data includes sample area data where multiple boxes are located;
将位于所述方框的所述设备参数写入所述样本区域数据中的印痕上,作为标签区域数据;Writing the device parameters located in the box on the imprint in the sample area data as label area data;
对所述标签区域数据中的所述设备参数采样标签点;Sampling label points for the device parameters in the label area data;
将所述样本图像数据输入所述编码器中提取特征数据;inputting the sample image data into the encoder to extract feature data;
将所述特征数据输入所述回归网络中,对所述样本区域数据中的印痕采样参考点;inputting the feature data into the regression network, and sampling reference points for the imprints in the sample area data;
将所述特征数据输入解码器中,将所述样本区域数据中的印痕重构为字体、作为参考区域数据;inputting the feature data into a decoder, reconstructing the imprint in the sample area data into a font as reference area data;
根据所述参考点与所述标签点之间的差异、所述参考区域数据与所述标签区域数据之间的差异,对所述编码器、所述回归网络与所述解码器进行训练,直至所述参考点与所述参考区域数据对齐,所述解码器在训练完成时丢弃。According to the difference between the reference point and the label point, the difference between the reference area data and the label area data, the encoder, the regression network and the decoder are trained until The reference points are aligned with the reference region data, which the decoder discards when training is complete.
第二方面,本申请实施例还提供了一种铭牌的识别方法,包括:In the second aspect, the embodiment of the present application also provides a method for identifying a nameplate, including:
加载根据第一方面所述的方法训练的铭牌识别模型;Load the nameplate recognition model trained according to the method described in the first aspect;
对安装在电力设备上的铭牌采集目标图像数据,所述目标图像数据中包含多个方框所在的目标区域数据;collecting target image data for nameplates installed on electrical equipment, where the target image data includes target area data where multiple boxes are located;
将所述目标图像数据输入编码器中提取特征数据;Input the target image data into the encoder to extract feature data;
将所述特征数据输入回归网络中,对所述目标区域数据中的印痕采样目标点;inputting the feature data into the regression network, and sampling target points for the imprints in the target area data;
在所述目标图像数据中将所述目标点写入所述目标区域数据中的印痕上,获得重构图像数据;writing the target point on the footprint in the target area data in the target image data to obtain reconstructed image data;
对所述重构图像数据执行光学字符识别,获得所述铭牌中记录的设备参数。Performing optical character recognition on the reconstructed image data to obtain device parameters recorded in the nameplate.
第三方面,本申请实施例还提供了一种铭牌识别模型的训练装置,所述铭牌识别模型包括编码器、回归网络,所述装置包括:In the third aspect, the embodiment of the present application also provides a training device for a nameplate recognition model, the nameplate recognition model includes an encoder and a regression network, and the device includes:
样本获取模块,设置为获取对安装在电力设备上的铭牌采集的样本图像数据、所述铭牌中记录的设备参数,所述样本图像数据中包含多个方框所在的样本区域数据;The sample acquisition module is configured to acquire the sample image data collected on the nameplate installed on the electric equipment, the equipment parameters recorded in the nameplate, and the sample image data includes the sample area data where multiple boxes are located;
标签区域数据生成模块,设置为将位于所述方框的所述设备参数写入所述样本区域数据中的印痕上,作为标签区域数据;The label area data generation module is configured to write the device parameters located in the box on the imprint in the sample area data as label area data;
标签点采样模块,设置为对所述标签区域数据中的所述设备参数采样标签 点;A label point sampling module is configured to sample label points for the device parameters in the label area data;
特征数据提取模块,设置为将所述样本图像数据输入所述编码器中提取特征数据;A feature data extraction module, configured to input the sample image data into the encoder to extract feature data;
参考点采样模块,设置为将所述特征数据输入所述回归网络中,对所述样本区域数据中的印痕采样参考点;A reference point sampling module, configured to input the characteristic data into the regression network, and sample reference points for the imprints in the sample area data;
参考区域数据重构模块,设置为将所述特征数据输入解码器中,将所述样本区域数据中的印痕重构为字体、作为参考区域数据;A reference area data reconstruction module, configured to input the feature data into a decoder, and reconstruct the imprint in the sample area data into fonts as reference area data;
辅助训练模块,设置为根据所述参考点与所述标签点之间的差异、所述参考区域数据与所述标签区域数据之间的差异,对所述编码器、所述回归网络与所述解码器进行训练,直至所述参考点与所述参考区域数据对齐,所述解码器在训练完成时丢弃。An auxiliary training module, configured to perform training on the encoder, the regression network, and the The decoder trains until the reference point is aligned with the reference region data, the decoder discards when training is complete.
第四方面,本申请实施例还提供了一种铭牌的识别装置,包括:In the fourth aspect, the embodiment of the present application also provides a nameplate identification device, including:
铭牌识别模型加载模块,设置为加载根据第一方面所述的方法训练的铭牌识别模型;The nameplate recognition model loading module is configured to load the nameplate recognition model trained according to the method described in the first aspect;
目标图像数据采集模块,设置为对安装在电力设备上的铭牌采集目标图像数据,所述目标图像数据中包含多个方框所在的目标区域数据;The target image data collection module is configured to collect target image data for nameplates installed on electric equipment, and the target image data includes target area data where multiple boxes are located;
特征数据提取模块,设置为将所述目标图像数据输入编码器中提取特征数据;A feature data extraction module, configured to input the target image data into the encoder to extract feature data;
目标点采样模块,设置为将所述特征数据输入回归网络中,对所述目标区域数据中的印痕采样目标点;The target point sampling module is configured to input the characteristic data into the regression network, and sample target points for the imprints in the target area data;
重构图像数据生成模块,设置为在所述目标图像数据中将所述目标点写入所述目标区域数据中的印痕上,获得重构图像数据;A reconstructed image data generation module, configured to write the target point in the target image data on the imprint in the target area data to obtain reconstructed image data;
光学字符识别模块,设置为对所述重构图像数据执行光学字符识别,获得所述铭牌中记录的设备参数。The optical character recognition module is configured to perform optical character recognition on the reconstructed image data to obtain the device parameters recorded in the nameplate.
第五方面,本申请实施例还提供了一种计算机设备,所述计算机设备包括:In the fifth aspect, the embodiment of the present application also provides a computer device, the computer device comprising:
处理器;processor;
存储器,设置为存储程序,memory, set to store program,
在所述程序被所述处理器执行时,所述处理器实现如第一方面所述的铭牌识别模型的训练方法或者如第二方面所述的铭牌识别方法。When the program is executed by the processor, the processor implements the nameplate recognition model training method according to the first aspect or the nameplate recognition method according to the second aspect.
第六方面,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如第一方面所述的铭牌识别模型的训练方法或者如第二方面所述的铭牌识别方法。In the sixth aspect, the embodiment of the present application also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the nameplate identification as described in the first aspect is realized The training method of the model or the nameplate recognition method as described in the second aspect.
附图说明Description of drawings
图1为本申请实施例一提供的一种铭牌识别模型的训练方法的流程图;FIG. 1 is a flowchart of a training method for a nameplate recognition model provided in Embodiment 1 of the present application;
图2为本申请实施例一提供的一种铭牌的示例图;FIG. 2 is an example diagram of a nameplate provided in Embodiment 1 of the present application;
图3是本申请实施例二提供的一种铭牌的识别方法的流程图;Fig. 3 is a flowchart of a method for identifying a nameplate provided in Embodiment 2 of the present application;
图4为本申请实施例三提供的一种铭牌识别模型的训练装置的结构示意图;4 is a schematic structural diagram of a training device for a nameplate recognition model provided in Embodiment 3 of the present application;
图5为本申请实施例四提供的一种铭牌的识别装置的结构示意图;FIG. 5 is a schematic structural diagram of a nameplate identification device provided in Embodiment 4 of the present application;
图6为本申请实施例五提供的一种计算机设备的结构示意图。FIG. 6 is a schematic structural diagram of a computer device provided in Embodiment 5 of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作说明。可以理解的是,此处所描述的实施例仅仅用于解释本申请。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分。The application will be described below in conjunction with the accompanying drawings and embodiments. It should be understood that the embodiments described here are only for explaining the present application. In addition, it should be noted that, for ease of description, only parts relevant to the present application are shown in the drawings.
实施例一Embodiment one
图1为本申请实施例一提供的一种铭牌识别模型的训练方法的流程图,本实施例可适用于训练辅助光学字符识别的铭牌识别模型的情况,该方法可以由铭牌识别模型的训练装置来执行,该铭牌识别模型的训练装置可以由软件和/或硬件实现,可配置在计算机设备中,例如,服务器、工作站、个人电脑等,该方法包括如下步骤:Figure 1 is a flow chart of a training method for a nameplate recognition model provided in Embodiment 1 of the present application. This embodiment is applicable to the situation of training a nameplate recognition model for auxiliary optical character recognition, and the method can be implemented by a training device for a nameplate recognition model. To perform, the training device of the nameplate recognition model can be implemented by software and/or hardware, and can be configured in computer equipment, such as servers, workstations, personal computers, etc., the method includes the following steps:
步骤101、获取对安装在电力设备上的铭牌采集的样本图像数据、铭牌中记录的设备参数。 Step 101. Obtain sample image data collected from nameplates installed on electrical equipment and equipment parameters recorded on the nameplates.
在对电力设备推进数字化管理的过程时,技术人员会对安装在电力设备上的铭牌采集图像数据,对该图像数据使用光学字符识别技术识别铭牌中记录的设备参数,并通过技术人人工对设备参数进行校对、并录入数据库。When promoting digital management of electrical equipment, technicians will collect image data on the nameplate installed on the electrical equipment, use optical character recognition technology to identify the equipment parameters recorded in the nameplate on the image data, and manually check the equipment through technical personnel. The parameters are proofread and entered into the database.
在本实施例中,可以从数据库中提取该图像数据,记为样本图像数据,并提取该图像数据对应的设备参数,复用样本图像数据、设备参数作为训练铭牌 识别模型的数据,可以减少标注数据的工作量。In this embodiment, the image data can be extracted from the database, recorded as sample image data, and the device parameters corresponding to the image data can be extracted, and the sample image data and device parameters can be reused as the data for training the nameplate recognition model, which can reduce labeling data workload.
步骤102、将位于方框的设备参数写入样本区域数据中的印痕上,作为标签区域数据。 Step 102, write the device parameters located in the box on the imprint in the sample area data as the label area data.
在实际应用中,如图2所示,铭牌上记录的信息一般包括电力设备的类型、铭牌中记录的设备参数、生产电力设备的厂商等。In practical applications, as shown in FIG. 2 , the information recorded on the nameplate generally includes the type of electric equipment, the equipment parameters recorded on the nameplate, the manufacturer of the electric equipment, and the like.
对于电力设备的类型(如图2中的“箱式变电站”)、生产电力设备的厂商(如图2中的“XXXX电器有限公司”)一般位于铭牌的最上方和最下方等特定的位置。For the type of power equipment ("box-type substation" in Figure 2), the manufacturer of the power equipment ("XXXX Electric Co., Ltd." in Figure 2) is generally located at the top and bottom of the nameplate and other specific positions.
电力设备的设备参数包括参数名、参数值,针对不同类型的电力设备,参数名、参数值有所不同,部分参数值可划分为数值和单位,部分参数值不可划分为数值和单位,如型号。The equipment parameters of electric equipment include parameter names and parameter values. For different types of electric equipment, parameter names and parameter values are different. Some parameter values can be divided into numerical values and units, and some parameter values cannot be divided into numerical values and units, such as model .
一般情况下,参数名、参数值一般位于同一行中,参数名一般位于参数值之前。In general, the parameter name and parameter value are generally located on the same line, and the parameter name is generally located before the parameter value.
示例性地,如图2所示,对于箱式变电站,其中一个设备参数的参数名为“额定频率”、参数值为“50Hz”,其中,“50”为数值,“Hz”为赫兹单位,另外一个设备参数的参数名为“高压额定电压”、参数值为“12KV”,其中,“12”为数值,“KV”为千伏单位。Exemplarily, as shown in Figure 2, for a box-type substation, the parameter name of one of the equipment parameters is "rated frequency" and the parameter value is "50Hz", where "50" is a value, and "Hz" is a unit of Hertz, The parameter name of another device parameter is "high voltage rated voltage" and the parameter value is "12KV", where "12" is the value and "KV" is the kilovolt unit.
铭牌是针对同一类型的电力设备生产,而并非针对特定型号的电力设备生产,因此,铭牌在出厂之前会刻印设备参数中不同型号的电力设备通用的部分信息,如参数名,而对设备参数中不同型号的电力设备并不通用的部分信息留空,如参数值。The nameplate is produced for the same type of electrical equipment, not for a specific type of electrical equipment. Therefore, before leaving the factory, the nameplate will be printed with some information common to different types of electrical equipment in the equipment parameters, such as the parameter name, while for the equipment parameters Some information that is not common to different types of electrical equipment is left blank, such as parameter values.
在不同情况中,参数值的单位可以纳入为通用的信息而预先在出厂前刻录,也可以纳入为并不通用的信息。In different situations, the unit of the parameter value can be included as common information and pre-recorded before leaving the factory, or it can be included as non-common information.
对于留空的部分信息,通常是印刷有方框(即矩形框,背景可能与其他区域相同,也可能与其他区域不同),在铭牌出厂之后确定电力设备的型号,从而使用刻印机器将该型号中的参数值刻印至方框中。For the part of the information that is left blank, it is usually printed with a box (that is, a rectangular box, the background may be the same as or different from other areas), and the model of the electrical equipment is determined after the nameplate leaves the factory, so that the model can be identified using a marking machine. The parameter values in are engraved into the boxes.
在铭牌出厂之后,受限于刻印机器的性能,方框中的部分信息在户外老化的过程中容易掉漆,剩余印痕,这些印痕在光学字符识别的过程中容易出错。After the nameplate leaves the factory, limited by the performance of the engraving machine, part of the information in the box is prone to paint off during the outdoor aging process, leaving imprints, which are prone to errors in the process of optical character recognition.
那么,在本实施例中,可以针对印痕训练辅助光学字符识别的铭牌识别模型,在训练的过程中,可以以方框作为目标,使用目标检测算法在样本图像数据中检测并裁剪该方框所在的区域,记为样本区域数据,即,样本图像数据中包含多个方框所在的样本区域数据,从而将将位于该方框的设备参数写入相应的样本区域数据中的印痕上,记为标签区域数据,以实现铭牌的还原。Then, in this embodiment, the nameplate recognition model for assisted optical character recognition can be trained for imprints. During the training process, the box can be used as the target, and the target detection algorithm can be used to detect and crop the box in the sample image data. The area of , is recorded as the sample area data, that is, the sample image data contains the sample area data where multiple boxes are located, so that the device parameters located in the box are written on the imprint of the corresponding sample area data, which is recorded as Label area data to achieve nameplate restoration.
在一实施例中,可以将样本区域数据区分为具有字体(即设备参数)的第一样本区域数据、具有印痕的第二样本区域数据,即第一样本区域数据中的设 备参数未掉漆,呈现较为清晰的、带颜色(一般为黑色、红色等)的字体,并不显现出印痕,第二样本区域数据中原本的设备参数掉漆,并不能呈现清晰的、带颜色(一般为黑色、红色等)的字体,而是显现出印痕。In one embodiment, the sample area data can be divided into first sample area data with fonts (i.e., device parameters) and second sample area data with prints, that is, the device parameters in the first sample area data are not lost. lacquer, presents relatively clear, colored (usually black, red, etc.) fonts, and does not show imprints, and the original equipment parameters in the data of the second sample area are lacquered, and cannot present clear, colored (usually Black, red, etc.) fonts show imprints instead.
考虑到数据库中存储的设备参数与刻印至铭牌上的字体风格并不一致,因此,使用Multi-Content GAN等算法按照第一样本区域数据上的字体对位于第二样本区域数据所属方框的设备参数进行风格迁移,获得风格参数,即风格参数与第一样本区域数据上的字体(即设备参数)的风格一致。Considering that the equipment parameters stored in the database are not consistent with the font style engraved on the nameplate, therefore, use algorithms such as Multi-Content GAN to compare the equipment located in the box of the second sample area data according to the font on the first sample area data. Perform style migration on the parameters to obtain style parameters, that is, the style parameters are consistent with the style of the font (ie, device parameters) on the first sample area data.
此时,将风格参数写入第二样本区域数据的印痕上,作为标签区域数据,从而提高了铭牌的真实性。At this time, the style parameter is written on the imprint of the second sample area data as the label area data, thereby improving the authenticity of the nameplate.
步骤103、对标签区域数据中的设备参数采样标签点。 Step 103, sampling label points for the device parameters in the label area data.
在本实施例中,标签区域数据中的设备参数属于可视的字体,对标签区域数据中的设备参数执行下采样,得到多个组成设备参数(即字体)的点,记为标签点。In this embodiment, the device parameters in the label area data belong to visible fonts, and the device parameters in the label area data are down-sampled to obtain a plurality of points constituting the device parameters (ie, fonts), which are marked as label points.
在标签点较为密集的情况下,标签点可以认为是设备参数(即字体)的笔画呈现的趋势。In the case of relatively dense label points, the label points can be considered as the trend of the strokes of the device parameters (ie font).
步骤104、将样本图像数据输入编码器中提取特征数据。 Step 104. Input the sample image data into the encoder to extract feature data.
在本实施例中,回归网络、解码器Decoder共用低纬度的编码器Encoder,解码器Decoder可用于增强编码器Encoder提取字体的笔画的能力,从而使得解码器Encoder字体的笔画辅助训练回归网络。In this embodiment, the regression network and the decoder Decoder share the low-latitude encoder Encoder, and the decoder Decoder can be used to enhance the ability of the encoder Encoder to extract the strokes of the font, so that the strokes of the encoder Encoder font assist in training the regression network.
反之,如果忽略解码器Decoder,编码器Encoder并不增强提取字体的笔画的能力,回归网络提取的点并不落在字体的笔画上,原因是在训练时编码器Encoder、回归网络达到最优即可,而并非是编码器Encoder、回归网络、解码器Decoder达到最优。Conversely, if the Decoder is ignored, the Encoder does not enhance the ability to extract the strokes of the font, and the points extracted by the regression network do not fall on the strokes of the font. The reason is that the Encoder and the regression network are optimal during training. Yes, it is not the Encoder, the regression network, and the Decoder that are optimal.
在编码器Encoder、回归网络、解码器Decoder共同训练时,编码器Encoder学到的信息更多是混合信息,即混合了字体的点、字体的笔画,强化字体的笔画对字体的点的影响,从而字体的点对字体的笔画更加敏感,将字体的点落在字体的笔画处。When the encoder Encoder, the regression network, and the decoder Decoder are jointly trained, the information learned by the encoder Encoder is more mixed information, that is, the points of the font and the strokes of the font are mixed, and the influence of the strokes of the font on the points of the font is strengthened. Therefore, the points of the font are more sensitive to the strokes of the font, and the points of the font are placed on the strokes of the font.
当然,也不能只靠字体的笔画就可以做好字体的点,因为字体的类型众多,笔画也是多种多样的,尤其是在字体的细节上,容易造成过拟合,这些细节对于光学字符识别而言意义不大,并且,有些字体的笔画还是被遮挡的,这时混合了字体的点、字体的笔画可以相互借鉴,使得字体的点在趋势上表现的效果更好。Of course, you can’t just rely on the strokes of the font to make the font point, because there are many types of fonts and strokes are also diverse, especially in the details of the font, it is easy to cause overfitting. These details are very important for OCR. It is not very meaningful, and the strokes of some fonts are still blocked. At this time, the dots of mixed fonts and the strokes of fonts can learn from each other, so that the dots of fonts can perform better in terms of trends.
在设计的时候,编码器Encoder的作用是把一个不定长的输入序列变换成一个定长的背景变量,并在该背景变量中编码输入序列信息。At the time of design, the role of the Encoder is to transform an input sequence of variable length into a background variable of fixed length, and encode the input sequence information in the background variable.
在本实施例中,编码器Encoder的基本模块使用多个卷积层、池化层Polling (如平均池化),主要实现特征提取的功能,即,从样本图像数据中提取趋势上的特征数据,提取纹理上的特征数据,这部分特征数据提取的强弱会影响回归网络在高维卷积输入的响应强弱,从而影响到回归网络的准确性。In this embodiment, the basic module of encoder Encoder uses multiple convolutional layers, pooling layer Polling (such as average pooling), mainly realizes the function of feature extraction, that is, extracts feature data on the trend from sample image data , to extract the feature data on the texture. The strength of this part of feature data extraction will affect the response of the regression network to the high-dimensional convolution input, thereby affecting the accuracy of the regression network.
步骤105、将特征数据输入回归网络中,对样本区域数据中的印痕采样参考点。 Step 105, input the characteristic data into the regression network, and sample the reference points of the imprints in the sample area data.
在一实施例中,回归网络包括ShufflenetV2、MobileNet、ShuffleNetV1、Sception等,用于在图像数据中识别痕迹中的点。In one embodiment, the regression network includes ShufflenetV2, MobileNet, ShuffleNetV1, Sception, etc., for identifying points in traces in image data.
以ShufflenetV2为例,ShufflenetV2是将输入的特征数据在通道维度分成两个分支,并将两个分支的输出串接成一个特征元素。并且,ShuffleNetv2网络是一种轻量级神经网络,是一种参数数量较少和计算代价较小的神经网络模型。采用ShuffleNetv2网络进行高维特征提取,可以减少回归网络的计算资源消耗,提高点的识别效率。Taking ShufflenetV2 as an example, ShufflenetV2 divides the input feature data into two branches in the channel dimension, and concatenates the outputs of the two branches into one feature element. Moreover, the ShuffleNetv2 network is a lightweight neural network, a neural network model with a small number of parameters and a low computational cost. Using the ShuffleNetv2 network for high-dimensional feature extraction can reduce the computing resource consumption of the regression network and improve the recognition efficiency of points.
在本实施例中,将样本区域数据输入回归网络中,回归网络对样本区域数据中的印痕采样多个点,记为参考点。In this embodiment, the sample area data is input into the regression network, and the regression network samples a plurality of points from the imprint in the sample area data, which are recorded as reference points.
步骤106、将特征数据输入解码器中,将样本区域数据中的印痕重构为字体、作为参考区域数据。Step 106: Input the feature data into the decoder, and reconstruct the imprints in the sample area data into fonts as reference area data.
解码器Decoder的最初时间步输入来自特定的符号。对于一个输出中的序列,当解码器Decoder在一时间步搜索出该符号时,即完成该输出序列。The initial time step input of the Decoder comes from a specific symbol. For an output sequence, when the Decoder searches out the symbol in a time step, the output sequence is completed.
编码器Encoder输出的背景变量编码了整个输入序列的信息,给定训练样本中的输出序列,对每个时间步,解码器Decoder输出的条件概率将基于之前的输出序列和背景变量计算。The background variable output by the encoder Encoder encodes the information of the entire input sequence. Given the output sequence in the training sample, for each time step, the conditional probability output by the decoder Decoder will be calculated based on the previous output sequence and background variables.
解码器Decoder通常为多层的RNN,对于输出序列的时间步,解码器Decoder将上一时间步的输出以及背景变量作为输入,并将它们与上一时间步的隐藏状态变换为当前时间步的隐藏状态。The decoder Decoder is usually a multi-layer RNN. For the time step of the output sequence, the decoder Decoder takes the output of the previous time step and the background variable as input, and transforms them and the hidden state of the previous time step into the current time step hidden state.
在本实施例中,将特征数据输入解码器Decoder中,解码器Decoder将样本区域数据中的印痕重构为字体,记为参考区域数据。In this embodiment, the feature data is input into the Decoder, and the Decoder reconstructs the imprints in the sample area data into fonts, which are recorded as reference area data.
步骤107、根据参考点与标签点之间的差异、参考区域数据与标签区域数据之间的差异,对编码器、回归网络与解码器进行训练,直至参考点与参考区域数据对齐。Step 107: According to the difference between the reference point and the label point, and the difference between the reference area data and the label area data, train the encoder, regression network and decoder until the reference point and the reference area data are aligned.
在本实施例中,可以分别计算参考点与标签点之间的差异,以及,计算参考区域数据与标签区域数据之间的差异,以此分别对编码器行反向传播、对回归网络行反向传播、对解码器进行反向传播,分别更新编码器中的权重、回归网络中的权重与解码器中的权重,直至参考点与参考区域数据对齐。In this embodiment, the difference between the reference point and the label point, and the difference between the reference area data and the label area data can be calculated respectively, so as to perform backpropagation on the encoder and backpropagation on the regression network respectively. Backpropagation and backpropagation to the decoder, update the weights in the encoder, the weights in the regression network and the weights in the decoder, respectively, until the reference point is aligned with the reference area data.
所谓对齐,可以指参考点与参考区域数据的趋势一致,将参考点与参考区域数据叠加在一起时,参考点与参考区域数据贴合,此时,可以认为编码器、 回归网络与解码器训练完成,存储编码器、回归网络,包含存储编码器的结构及参数、回归网络的结构及参数,此外,解码器在训练完成时丢弃。The so-called alignment can mean that the trend of the reference point and the reference area data are consistent. When the reference point and the reference area data are superimposed together, the reference point and the reference area data fit together. At this time, it can be considered that the encoder, regression network and decoder training Complete, store the encoder, regression network, including storing the structure and parameters of the encoder, the structure and parameters of the regression network, in addition, the decoder is discarded when the training is completed.
在本申请的一个实施例中,步骤107可以包括如下步骤:In one embodiment of the present application, step 107 may include the following steps:
步骤1071、计算参考点与标签点之间的差异,作为第一损失值。Step 1071. Calculate the difference between the reference point and the label point as the first loss value.
在本实施例中,将参考点与标签点代入预设的第一损失函数中,计算参考点与标签点之间的差异,得到第一损失值,即,第一损失值用于评价参考点(预测值)与标签点(真实值)之间在整体上的位置偏差,可用于更新回归网络。In this embodiment, the reference point and the label point are substituted into the preset first loss function, and the difference between the reference point and the label point is calculated to obtain the first loss value, that is, the first loss value is used to evaluate the reference point The overall positional deviation between the (predicted value) and the label point (true value), which can be used to update the regression network.
示例性地,在生成参考点、标签点时,均可以对参考点、标签点配置编号,编号相同的参考点、标签点,位置理论上相同,因此,对于相同编号的参考点与标签点,可以计算参考点与标签点之间的范数距离L2,对所有范数距离L2计算平均值,作为第一损失值。For example, when generating reference points and label points, you can configure numbers for the reference points and label points. The reference points and label points with the same number have the same position in theory. Therefore, for the reference points and label points with the same number, The norm distance L2 between the reference point and the label point may be calculated, and an average value of all norm distances L2 may be calculated as the first loss value.
步骤1072、计算参考区域数据与标签区域数据之间的差异,作为第二损失值。Step 1072. Calculate the difference between the reference area data and the label area data as a second loss value.
在本实施例中,将参考区域数据与标签区域数据代入预设的第二损失函数中,计算参考区域数据与标签区域数据之间的差异,得到第二损失值,即,第二损失值用于评价参考点(参考区域数据)与标签点(标签区域数据)之间在整体上的书写偏差,可用于更新解码器。In this embodiment, the reference area data and the label area data are substituted into the preset second loss function, and the difference between the reference area data and the label area data is calculated to obtain the second loss value, that is, the second loss value is used The overall writing deviation between the evaluation reference point (reference area data) and label point (label area data) can be used to update the decoder.
示例性地,可以将参考区域数据转换为第一矩阵,将标签区域数据转换为第二矩阵,计算第一矩阵与第二矩阵之间的欧式距离,作为第二损失值。Exemplarily, the reference area data may be converted into a first matrix, the label area data may be converted into a second matrix, and the Euclidean distance between the first matrix and the second matrix may be calculated as the second loss value.
步骤1073、将第一损失值与第二损失值结合为第三损失值。Step 1073. Combine the first loss value and the second loss value into a third loss value.
在本实施例中,可以将第一损失值与第二损失值进行融合,得到第三损失值,第三损失值综合位置偏差、笔画偏差,可用于更新编码器。In this embodiment, the first loss value and the second loss value can be fused to obtain a third loss value, and the third loss value can be used to update the encoder by integrating the position deviation and the stroke deviation.
示例性地,可以对第一损失值与第二损失值进行线性融合,得到第三损失值。Exemplarily, the first loss value and the second loss value may be linearly fused to obtain the third loss value.
在本示例中,一方面,计算第一损失值与第一权重之间的乘积,作为第一调权值,另一方面,计算第二损失值与第二权重之间的乘积,作为第二调权值,第一权重大于第二权重,计算第一调权值与第二调权值之间的和值,作为第三损失值。In this example, on the one hand, the product of the first loss value and the first weight is calculated as the first weight adjustment value; on the other hand, the product of the second loss value and the second weight is calculated as the second For the weight adjustment value, the first weight is greater than the second weight, and the sum of the first weight adjustment value and the second weight adjustment value is calculated as the third loss value.
其中,第一权重大于第二权重。Wherein, the first weight is greater than the second weight.
步骤1074、分别使用第一损失值更新回归网络、使用第二损失值更新解码器、使用第三损失值更新编码器。Step 1074, respectively use the first loss value to update the regression network, use the second loss value to update the decoder, and use the third loss value to update the encoder.
对回归网络进行反向传播,基于第一损失值更新回归网络中的权重,对解码器进行反向传播,基于第二损失值更新解码器中的权重,对编码器进行反向传播,基于第三损失值更新编码器中的权重。Backpropagating the regression network, updating the weights in the regression network based on the first loss value, backpropagating the decoder, updating the weights in the decoder based on the second loss value, and backpropagating the encoder, based on the first loss value Three loss values update the weights in the encoder.
在一实施例中,将第一损失值代入随机梯度下降(stochastic gradient descent,SGD)、自适应动量(Adaptive momentum,Adam)等优化算法中,计算回归网络中权重的更新幅度,从而按照该更新幅度更新回归网络中的权重。In one embodiment, the first loss value is substituted into optimization algorithms such as stochastic gradient descent (SGD) and adaptive momentum (Adaptive momentum, Adam) to calculate the update range of weights in the regression network, so that according to the update Magnitude updates the weights in the regression network.
将第二损失值代入SGD、Adam等优化算法中,计算解码器中权重的更新幅度,从而按照该更新幅度更新解码器中的权重。Substitute the second loss value into optimization algorithms such as SGD and Adam to calculate the update range of the weights in the decoder, so as to update the weights in the decoder according to the update range.
将第三损失值代入SGD、Adam等优化算法中,计算编码器中权重的更新幅度,从而按照该更新幅度更新编码器中的权重。Substitute the third loss value into optimization algorithms such as SGD and Adam to calculate the update range of the weight in the encoder, so as to update the weight in the encoder according to the update range.
步骤1075、判断当前迭代的次数是否到达预设的阈值,基于当前迭代的次数到达预设的阈值的判断结果,执行步骤1076,基于当前迭代的次数未到达预设的阈值的判断结果,返回执行步骤104。Step 1075, judge whether the number of current iterations reaches the preset threshold, based on the judgment result that the number of current iterations reaches the preset threshold, execute step 1076, and return to execute based on the judgment result that the number of current iterations does not reach the preset threshold Step 104.
步骤1076、确定编码器、回归网络与解码器训练完成,丢弃解码器。Step 1076, determine that the training of the encoder, regression network and decoder is completed, and discard the decoder.
在本实施例中,可以预先对迭代的次数设置阈值,作为停止条件,在每轮迭代训练中,统计当前迭代的次数,从而判断当前迭代训练编码器、回归网络与解码器的次数是否到达该阈值。In this embodiment, a threshold value can be set in advance for the number of iterations as a stop condition. In each round of iterative training, the number of current iterations is counted, so as to determine whether the number of times of training the encoder, regression network, and decoder in the current iteration reaches the threshold. threshold.
如果到达该阈值,则可以认为编码器、回归网络与解码器训练完成,此时,分别记录编码器、回归网络中的权重,并丢弃解码器。If the threshold is reached, it can be considered that the training of the encoder, regression network and decoder is completed. At this time, the weights in the encoder and regression network are recorded respectively, and the decoder is discarded.
如果未到达该阈值,则可以进入下一轮迭代训练,如此循环迭代训练,直至编码器、回归网络与解码器训练完成。If the threshold is not reached, the next round of iterative training can be entered, and the iterative training is repeated in this way until the training of the encoder, regression network and decoder is completed.
在本实施例中,离线训练编码器、回归网络与解码器,记录编码器、回归网络的结构及其权重,通过各种方式分发至检测的设备,检测的设备可加载编码器、回归网络,检测电力设备上铭牌记录的设备参数。In this embodiment, the encoder, regression network and decoder are trained offline, the structure and weight of the encoder and regression network are recorded, and distributed to the detection device in various ways. The detection device can load the encoder and regression network, Detect the equipment parameters recorded on the nameplate on the electrical equipment.
在本实施例中,铭牌识别模型包括编码器、回归网络,获取对安装在电力设备上的铭牌采集的样本图像数据、铭牌中记录的设备参数,样本图像数据中包含多个方框所在的样本区域数据;将位于方框的设备参数写入样本区域数据中的印痕上,作为标签区域数据;对标签区域数据中的设备参数采样标签点;将样本图像数据输入编码器中提取特征数据;将特征数据输入回归网络中,对样本区域数据中的印痕采样参考点;将特征数据输入解码器中,将样本区域数据中的印痕重构为字体、作为参考区域数据;根据参考点与标签点之间的差异、参考区域数据与标签区域数据之间的差异,对编码器、回归网络与解码器进行训练,直至参考点与参考区域数据对齐,解码器在训练完成时丢弃。本实施例利用书写的笔画作为监督,帮助回归网络的低维特征关注笔画的信息提取,在铭牌上的信息因老化掉漆的情况下,帮助回归的点能落到书写的笔画上,即,帮助回归的点落到刻印的痕迹上,重组出书写的笔画,而不是落到经验值上,避免过渡拟合导致无法组成书写的笔画,回归的点能落在书写的笔画上,能更准确的帮助光学字符识别,从而提高识别铭牌中记录的设备参数的精确度,减少人工校对的、录入数据库的成本,减少花费的时间,大大提高了效率。In this embodiment, the nameplate recognition model includes an encoder and a regression network to obtain sample image data collected from nameplates installed on electrical equipment and equipment parameters recorded in the nameplate. The sample image data includes samples where multiple boxes are located. Area data; write the device parameters located in the box into the imprint in the sample area data as label area data; sample label points for the device parameters in the label area data; input the sample image data into the encoder to extract feature data; The characteristic data is input into the regression network, and the reference point is sampled for the imprint in the sample area data; the feature data is input into the decoder, and the imprint in the sample area data is reconstructed into a font as the reference area data; according to the relationship between the reference point and the label point The difference between the reference point and the label region data, the encoder, the regression network and the decoder are trained until the reference point is aligned with the reference region data, and the decoder is discarded when the training is completed. This embodiment uses written strokes as supervision to help the low-dimensional features of the regression network focus on the information extraction of strokes. When the information on the nameplate is aged and painted, the points that help regression can fall on the written strokes, that is, Help the regression point to fall on the engraved trace, reorganize the written strokes instead of falling on the experience value, avoid overfitting and make the written strokes unable to be composed, and the regression point can fall on the written strokes, which can be more accurate With the help of optical character recognition, it can improve the accuracy of identifying the equipment parameters recorded in the nameplate, reduce the cost of manual proofreading and entering the database, reduce the time spent, and greatly improve the efficiency.
实施例二Embodiment two
图3为本申请实施例二提供的一种铭牌的识别方法的流程图,本实施例可适用于使用铭牌识别模型辅助识别电力设备的铭牌的情况,该方法可以由铭牌的识别装置来执行,该铭牌的识别装置可以由软件和/或硬件实现,可配置在计算机设备中,例如,服务器、工作站、个人电脑、移动终端(如手机、平板电脑等)等,该方法包括如下步骤:Fig. 3 is a flow chart of a nameplate recognition method provided in Embodiment 2 of the present application. This embodiment is applicable to the situation where a nameplate recognition model is used to assist in the recognition of a nameplate of an electric device, and the method can be executed by a nameplate recognition device. The identification device of the nameplate can be implemented by software and/or hardware, and can be configured in computer equipment, such as servers, workstations, personal computers, mobile terminals (such as mobile phones, tablet computers, etc.), and the method includes the following steps:
步骤301、加载铭牌识别模型。 Step 301, load the nameplate recognition model.
在本实施例中,可以预先训练铭牌识别模型,该铭牌识别模型用于识别铭牌(图像数据)中记录的设备参数。In this embodiment, a nameplate recognition model can be trained in advance, and the nameplate recognition model is used to recognize equipment parameters recorded in the nameplate (image data).
其中,铭牌识别模型包括编码器、回归网络,铭牌识别模型的训练方法如下:Among them, the nameplate recognition model includes an encoder and a regression network. The training method of the nameplate recognition model is as follows:
获取对安装在电力设备上的铭牌采集的样本图像数据、铭牌中记录的设备参数,样本图像数据中包含多个方框所在的样本区域数据;Obtain the sample image data collected on the nameplate installed on the electrical equipment, the equipment parameters recorded in the nameplate, and the sample image data includes the sample area data where multiple boxes are located;
将位于方框的设备参数写入样本区域数据中的印痕上,作为标签区域数据;Write the device parameters located in the box on the imprint in the sample area data as the label area data;
对标签区域数据中的设备参数采样标签点;Sampling label points for device parameters in label area data;
将样本图像数据输入编码器中提取特征数据;Input the sample image data into the encoder to extract the feature data;
将特征数据输入回归网络中,对样本区域数据中的印痕采样参考点;Input the feature data into the regression network, and sample the reference points for the imprints in the sample area data;
将特征数据输入解码器中,将样本区域数据中的印痕重构为字体、作为参考区域数据;Input the feature data into the decoder, reconstruct the imprint in the sample area data into a font, and use it as the reference area data;
根据参考点与标签点之间的差异、参考区域数据与标签区域数据之间的差异,对编码器、回归网络与解码器进行训练,直至参考点与参考区域数据对齐,解码器在训练完成时丢弃。According to the difference between the reference point and the label point, the difference between the reference area data and the label area data, the encoder, the regression network and the decoder are trained until the reference point and the reference area data are aligned. When the training is completed, the decoder throw away.
在本申请实施例中,由于铭牌识别模型的训练方法与实施例一的应用基本相似,所以描述的比较简单,相关之处参见实施例一的部分说明即可。In the embodiment of the present application, since the training method of the nameplate recognition model is basically similar to the application of the first embodiment, the description is relatively simple, and for relevant details, please refer to the part of the description of the first embodiment.
将铭牌识别模型中的编码器、回归网络(结构及其参数)加载至内存中运行,待识别铭牌(图像数据)中记录的设备参数。Load the encoder and regression network (structure and its parameters) in the nameplate recognition model into the memory for operation, and the device parameters recorded in the nameplate (image data) are to be recognized.
步骤302、对安装在电力设备上的铭牌采集目标图像数据。 Step 302, collecting target image data of nameplates installed on electric equipment.
在本实施例中,用户可以面向安装在电力设备上的铭牌采集图像数据,记为目标图像数据,一般情况下,目标图像数据中包含多个方框所在的区域,记为目标区域数据。In this embodiment, the user can collect image data facing the nameplate installed on the electrical equipment, which is recorded as target image data. Generally, the target image data includes areas where multiple boxes are located, which is recorded as target area data.
步骤303、将目标图像数据输入编码器中提取特征数据。Step 303: Input the target image data into the encoder to extract feature data.
将目标图像数据输入编码器中,编码器对目标图像数据进行处理,提取低纬度的特征数据。The target image data is input into the encoder, and the encoder processes the target image data to extract low-latitude feature data.
步骤304、将特征数据输入回归网络中,对目标区域数据中的印痕采样目标点。 Step 304, input the feature data into the regression network, and sample the target points for the footprints in the target area data.
将特征数据输入回归网络中,回归网络对目标区域数据中的印痕采样多个点,记为目标点。The feature data is input into the regression network, and the regression network samples multiple points from the imprint in the target area data, which are recorded as target points.
步骤305、在目标图像数据中将目标点写入目标区域数据中的印痕上,获得重构图像数据。 Step 305. Write the target point on the imprint in the target area data in the target image data to obtain reconstructed image data.
记录目标点位于目标区域数据上的坐标,记为相对位置,在目标图像数据中,将目标点写入相应目标区域数据中的该相对位置上,使得目标点可以写入相应目标区域数据中的印痕上,获得重构图像数据。Record the coordinates of the target point on the target area data, and record it as the relative position. In the target image data, write the target point into the relative position in the corresponding target area data, so that the target point can be written into the corresponding target area data. On the imprint, the reconstructed image data is obtained.
步骤306、对重构图像数据执行光学字符识别,获得铭牌中记录的设备参数。 Step 306, perform optical character recognition on the reconstructed image data, and obtain the equipment parameters recorded in the nameplate.
在本实施例中,可以应用深度学习技术对重构图像数据执行光学字符识别,获得铭牌上记录的信息,例如,端到端文本识别算法(End-to-End Text Spotting)、端到端文本检测与识别算法(FOTS)、文本框识别算法(TextBoxes)、文本检测算法(PSENet)等。In this embodiment, deep learning technology can be applied to perform optical character recognition on the reconstructed image data to obtain information recorded on the nameplate, for example, end-to-end text recognition algorithm (End-to-End Text Spotting), end-to-end text spotting Detection and recognition algorithm (FOTS), text box recognition algorithm (TextBoxes), text detection algorithm (PSENet), etc.
在目标点较为密集的情况下,目标点可以认为是设备参数(字体)的笔画呈现的趋势,光学字符识别的兼容性较强,笔画呈现的趋势对于光学字符识别的影响明显大于笔画的细节,在光学字符识别的过程中,重构图像数据中的目标点会被当作字体进行识别,在具有良好的趋势的情况下,可以提高识别的成功率。In the case of relatively dense target points, the target point can be considered as the trend of the strokes of the device parameters (fonts), and the compatibility of OCR is strong. The impact of the trend of strokes on OCR is significantly greater than the details of the strokes. In the process of optical character recognition, the target points in the reconstructed image data will be recognized as fonts, and in the case of a good trend, the success rate of recognition can be improved.
在实际应用中,该铭牌上记录的信息一般包括电力设备的类型、铭牌中记录的设备参数、生产电力设备的厂商等。In practical applications, the information recorded on the nameplate generally includes the type of the electric equipment, the equipment parameters recorded on the nameplate, the manufacturer of the electric equipment, and the like.
对于电力设备的类型、生产电力设备的厂商一般位于铭牌的最上方和最下方等特定的位置,并且,电力设备的类型、生产电力设备的厂商较为固定,因此,可以通过位置或关键词识别电力设备的类型、生产电力设备的厂商。The type of power equipment and the manufacturer of the power equipment are generally located at specific positions such as the top and bottom of the nameplate, and the type of power equipment and the manufacturer of the power equipment are relatively fixed. Therefore, the power can be identified by location or keywords. Type of equipment, manufacturer of electrical equipment.
此外,设备参数包括参数名、参数值,参数名、参数值一般位于同一行中,参数名一般位于参数值之前,那么,可以对重构图像数据执行光学字符识别,获得文本信息。In addition, the device parameters include parameter names and parameter values. The parameter names and parameter values are generally located in the same line, and the parameter names are generally located before the parameter values. Then, optical character recognition can be performed on the reconstructed image data to obtain text information.
查找位于方框中的文本信息,作为铭牌中记录的参数值。Look for the text information located in the box as the parameter value recorded on the nameplate.
查找位于方框之前的文本信息,作为铭牌中记录的参数名。Look for the text information preceding the box as the parameter name recorded on the nameplate.
在一实施例中,参数值可划分为数值、单位,在部分情况下,该单位可能在铭牌出厂之前刻印在方框之后,即方框用于记录参数值中的数值,该单位也可能在铭牌出厂之后刻印在方框之中,即,方框用于记录参数值中数值与单位,那么,在位于方框中的文本信息为单位的情况下,确定文本信息为铭牌中记录的参数值。In one embodiment, the parameter value can be divided into numerical value and unit. In some cases, the unit may be printed behind the box before the nameplate leaves the factory, that is, the box is used to record the numerical value in the parameter value, and the unit may also be in the The nameplate is engraved in the box after leaving the factory, that is, the box is used to record the value and unit of the parameter value, then, if the text information in the box is the unit, the text information is determined to be the parameter value recorded in the nameplate .
对于识别出的铭牌上记录的信息(如电力设备的类型、铭牌中记录的设备 参数、生产电力设备的厂商等),可以按照既定的格式存储至数据库中。For the information recorded on the identified nameplate (such as the type of electrical equipment, the equipment parameters recorded in the nameplate, the manufacturer of the electrical equipment, etc.), it can be stored in the database according to the established format.
在本实施例中,加载铭牌识别模型;对安装在电力设备上的铭牌采集目标图像数据,目标图像数据中包含多个方框所在的目标区域数据;将目标图像数据输入编码器中提取特征数据;将特征数据输入回归网络中,对目标区域数据中的印痕采样目标点;在目标图像数据中将目标点写入目标区域数据中的印痕上,获得重构图像数据;对重构图像数据执行光学字符识别,获得铭牌中记录的设备参数。本实施例利用书写的笔画作为监督,帮助回归网络的低维特征关注笔画的信息提取,在铭牌上的信息因老化掉漆的情况下,帮助回归的点能落到书写的笔画上,即,帮助回归的点落到刻印的痕迹上,重组出书写的笔画,而不是落到经验值上,避免过渡拟合导致无法组成书写的笔画,回归的点能落在书写的笔画上,能更准确的帮助光学字符识别,从而提高识别铭牌中记录的设备参数的精确度,减少人工校对的、录入数据库的成本,减少花费的时间,大大提高了效率。In this embodiment, the nameplate recognition model is loaded; the target image data is collected for the nameplate installed on the electric equipment, and the target image data includes the target area data where multiple boxes are located; the target image data is input into the encoder to extract feature data ;Input the feature data into the regression network, and sample the target point on the imprint in the target area data; write the target point in the target image data on the imprint in the target area data to obtain the reconstructed image data; execute on the reconstructed image data Optical character recognition to obtain equipment parameters recorded in the nameplate. This embodiment uses written strokes as supervision to help the low-dimensional features of the regression network focus on the information extraction of strokes. When the information on the nameplate is aged and painted, the points that help regression can fall on the written strokes, that is, Help the regression point to fall on the engraved trace, reorganize the written strokes instead of falling on the experience value, avoid overfitting and make the written strokes unable to be composed, and the regression point can fall on the written strokes, which can be more accurate With the help of optical character recognition, it can improve the accuracy of identifying the equipment parameters recorded in the nameplate, reduce the cost of manual proofreading and entering the database, reduce the time spent, and greatly improve the efficiency.
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,一些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作并不一定是本申请实施例所必须的。It should be noted that, for the method embodiment, for the sake of simple description, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiment of the present application is not limited by the described action sequence, because According to the embodiment of the present application, some steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
实施例三Embodiment three
图4为本申请实施例三提供的一种铭牌识别模型的训练装置的结构框图,所述铭牌识别模型包括编码器、回归网络,所述装置可以包括如下模块:Fig. 4 is a structural block diagram of a training device for a nameplate recognition model provided in Embodiment 3 of the present application. The nameplate recognition model includes an encoder and a regression network. The device may include the following modules:
样本获取模块401,设置为获取对安装在电力设备上的铭牌采集的样本图像数据、所述铭牌中记录的设备参数,所述样本图像数据中包含多个方框所在的样本区域数据;The sample acquisition module 401 is configured to acquire the sample image data collected on the nameplate installed on the electric equipment, the equipment parameters recorded in the nameplate, and the sample image data includes the sample area data where multiple boxes are located;
标签区域数据生成模块402,设置为将位于所述方框的所述设备参数写入所述样本区域数据中的印痕上,作为标签区域数据;The label area data generation module 402 is configured to write the device parameters located in the box on the imprint in the sample area data as label area data;
标签点采样模块403,设置为对所述标签区域数据中的所述设备参数采样标签点;The label point sampling module 403 is configured to sample label points for the device parameters in the label area data;
特征数据提取模块404,设置为将所述样本图像数据输入所述编码器中提取特征数据;A feature data extraction module 404, configured to input the sample image data into the encoder to extract feature data;
参考点采样模块405,设置为将所述特征数据输入所述回归网络中,对所述样本区域数据中的印痕采样参考点;The reference point sampling module 405 is configured to input the feature data into the regression network, and sample reference points for the imprints in the sample area data;
参考区域数据重构模块406,设置为将所述特征数据输入解码器中,将所述样本区域数据中的印痕重构为字体、作为参考区域数据;The reference area data reconstruction module 406 is configured to input the characteristic data into the decoder, and reconstruct the imprint in the sample area data into a font as the reference area data;
辅助训练模块407,设置为根据所述参考点与所述标签点之间的差异、所述参考区域数据与所述标签区域数据之间的差异,对所述编码器、所述回归网络与所述解码器进行训练,直至所述参考点与所述参考区域数据对齐,所述解码器在训练完成时丢弃。 Auxiliary training module 407, configured to train the encoder, the regression network and the The decoder is trained until the reference point is aligned with the reference region data, and the decoder is discarded when training is complete.
在本申请的一个实施例中,所述标签区域数据生成模块402还设置为:In one embodiment of the present application, the label area data generation module 402 is also set to:
将所述样本区域数据区分为具有字体的第一样本区域数据、具有印痕的第二样本区域数据;distinguishing the sample area data into first sample area data having fonts and second sample area data having prints;
按照所述第一样本区域数据上的所述字体对位于所述第二样本区域数据所属方框的所述设备参数进行风格迁移,获得风格参数;performing style migration on the device parameters located in the box to which the second sample area data belongs according to the font on the first sample area data, to obtain style parameters;
将所述风格参数写入所述第二样本区域数据的印痕上,作为标签区域数据。Writing the style parameter into the imprint of the second sample area data as label area data.
在本申请的一个实施例中,所述辅助训练模块407还设置为:In one embodiment of the present application, the auxiliary training module 407 is also set to:
计算所述参考点与所述标签点之间的差异,作为第一损失值;calculating the difference between the reference point and the label point as a first loss value;
计算所述参考区域数据与所述标签区域数据之间的差异,作为第二损失值;calculating the difference between the reference area data and the label area data as a second loss value;
将所述第一损失值与所述第二损失值结合为第三损失值;combining the first loss value and the second loss value into a third loss value;
使用所述第一损失值更新所述回归网络;updating the regression network using the first loss value;
使用所述第二损失值更新所述解码器;updating the decoder using the second loss value;
使用所述第三损失值更新所述编码器;updating the encoder using the third loss value;
判断当前迭代的次数是否到达预设的阈值,基于当前迭代的次数到达预设的阈值的判断结果,则确定所述编码器、所述回归网络与所述解码器训练完成,丢弃所述解码器;基于当前迭代的次数未到达预设的阈值的判断结果,返回执行所述将所述样本图像数据输入所述编码器中提取特征数据。Judging whether the number of current iterations reaches a preset threshold, based on the judgment result that the number of current iterations reaches a preset threshold, it is determined that the training of the encoder, the regression network and the decoder is completed, and the decoder is discarded ; Based on the judging result that the number of current iterations does not reach the preset threshold, return to execute the step of inputting the sample image data into the encoder to extract feature data.
在本申请的一个实施例中,所述辅助训练模块407还设置为:In one embodiment of the present application, the auxiliary training module 407 is also set to:
对于相同编号的所述参考点与所述标签点,计算所述参考点与所述标签点之间的范数距离;For the reference point and the label point with the same number, calculate the norm distance between the reference point and the label point;
对所述范数距离计算平均值,作为第一损失值。An average value is calculated for the norm distance as a first loss value.
在本申请的一个实施例中,所述辅助训练模块407还设置为:In one embodiment of the present application, the auxiliary training module 407 is also set to:
将所述参考区域数据转换为第一矩阵;converting the reference area data into a first matrix;
将所述标签区域数据转换为第二矩阵;converting the label area data into a second matrix;
计算所述第一矩阵与所述第二矩阵之间的欧式距离,作为第二损失值。Calculate the Euclidean distance between the first matrix and the second matrix as a second loss value.
在本申请的一个实施例中,所述辅助训练模块407还设置为:In one embodiment of the present application, the auxiliary training module 407 is also set to:
计算所述第一损失值与第一权重之间的乘积,作为第一调权值;calculating the product of the first loss value and the first weight as a first weight adjustment value;
计算所述第二损失值与第二权重之间的乘积,作为第二调权值,所述第一 权重大于所述第二权重;Calculate the product between the second loss value and the second weight, as the second weight adjustment value, the first weight is greater than the second weight;
计算所述第一调权值与所述第二调权值之间的和值,作为第三损失值;calculating the sum of the first weight adjustment value and the second weight adjustment value as a third loss value;
其中,所述第一权重大于所述第二权重。Wherein, the first weight is greater than the second weight.
本申请实施例所提供的铭牌识别模型的训练装置可执行本申请任意实施例所提供的铭牌识别模型的训练方法,具备执行方法相应的功能模块和有益效果。The nameplate recognition model training device provided in the embodiment of the present application can execute the nameplate recognition model training method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method.
实施例四Embodiment four
图5为本申请实施例四提供的一种铭牌的识别装置的结构框图,所述装置可以包括如下模块:Fig. 5 is a structural block diagram of a nameplate identification device provided in Embodiment 4 of the present application, and the device may include the following modules:
铭牌识别模型加载模块501,设置为加载铭牌识别模型;The nameplate recognition model loading module 501 is configured to load the nameplate recognition model;
目标图像数据采集模块502,设置为对安装在电力设备上的铭牌采集目标图像数据,所述目标图像数据中包含多个方框所在的目标区域数据;The target image data collection module 502 is configured to collect target image data for the nameplate installed on the electrical equipment, and the target image data includes target area data where multiple boxes are located;
特征数据提取模块503,设置为将所述目标图像数据输入编码器中提取特征数据;The feature data extraction module 503 is configured to input the target image data into the encoder to extract feature data;
目标点采样模块504,设置为将所述特征数据输入回归网络中,对所述目标区域数据中的印痕采样目标点;The target point sampling module 504 is configured to input the feature data into the regression network, and sample target points for the imprints in the target area data;
重构图像数据生成模块505,设置为在所述目标图像数据中将所述目标点写入所述目标区域数据中的印痕上,获得重构图像数据;The reconstructed image data generation module 505 is configured to write the target point in the target image data on the imprint in the target area data to obtain reconstructed image data;
光学字符识别模块506,设置为对所述重构图像数据执行光学字符识别,获得所述铭牌中记录的设备参数。The optical character recognition module 506 is configured to perform optical character recognition on the reconstructed image data to obtain the device parameters recorded in the nameplate.
其中,所述铭牌识别模型包括编码器、回归网络,所述铭牌识别模型的训练方法如下:Wherein, the nameplate recognition model includes an encoder and a regression network, and the training method of the nameplate recognition model is as follows:
获取对安装在电力设备上的铭牌采集的样本图像数据、所述铭牌中记录的设备参数,所述样本图像数据中包含多个方框所在的样本区域数据;Acquiring sample image data collected on nameplates installed on electrical equipment and equipment parameters recorded on the nameplates, wherein the sample image data includes sample area data where multiple boxes are located;
将位于所述方框的所述设备参数写入所述样本区域数据中的印痕上,作为标签区域数据;Writing the device parameters located in the box on the imprint in the sample area data as label area data;
对所述标签区域数据中的所述设备参数采样标签点;Sampling label points for the device parameters in the label area data;
将所述样本图像数据输入所述编码器中提取特征数据;inputting the sample image data into the encoder to extract feature data;
将所述特征数据输入所述回归网络中,对所述样本区域数据中的印痕采样参考点;inputting the feature data into the regression network, and sampling reference points for the imprints in the sample area data;
将所述特征数据输入解码器中,将所述样本区域数据中的印痕重构为字体、作为参考区域数据;inputting the feature data into a decoder, reconstructing the imprint in the sample area data into a font as reference area data;
根据所述参考点与所述标签点之间的差异、所述参考区域数据与所述标签 区域数据之间的差异,对所述编码器、所述回归网络与所述解码器进行训练,直至所述参考点与所述参考区域数据对齐,所述解码器在训练完成时丢弃。According to the difference between the reference point and the label point, the difference between the reference area data and the label area data, the encoder, the regression network and the decoder are trained until The reference points are aligned with the reference region data, which the decoder discards when training is complete.
在本申请的一个实施例中,所述设备参数包括参数名、参数值;In one embodiment of the present application, the device parameters include parameter names and parameter values;
所述光学字符识别模块506还设置为:The optical character recognition module 506 is also set to:
对所述重构图像数据执行光学字符识别,获得文本信息;performing optical character recognition on the reconstructed image data to obtain text information;
查找位于所述方框中的所述文本信息,作为所述铭牌中记录的参数值;Find the text information located in the box as the parameter value recorded in the nameplate;
查找位于所述方框之前的文本信息,作为所述铭牌中记录的参数名;Find the text information before the box as the parameter name recorded in the nameplate;
在位于所述方框中的所述文本信息为单位的情况下,确定所述文本信息为所述铭牌中记录的参数值。If the text information in the box is a unit, it is determined that the text information is the parameter value recorded in the nameplate.
本申请实施例所提供的铭牌的识别装置可执行本申请任意实施例所提供的铭牌的识别方法,具备执行方法相应的功能模块和有益效果。The nameplate recognition device provided in the embodiment of the present application can execute the nameplate recognition method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method.
实施例五Embodiment five
图6为本申请实施例五提供的一种计算机设备的结构示意图。图6示出了适于用来实现本申请实施方式的示例性计算机设备12的框图。图6显示的计算机设备12仅仅是一个示例。FIG. 6 is a schematic structural diagram of a computer device provided in Embodiment 5 of the present application. FIG. 6 shows a block diagram of an exemplary computer device 12 suitable for implementing embodiments of the present application. The computer device 12 shown in FIG. 6 is only one example.
如图6所示,计算机设备12以通用计算设备的形式表现。计算机设备12的组件可以包括:至少一个处理器或者处理单元16,存储器28,连接不同系统组件(包括存储器28和处理单元16)的总线18。As shown in FIG. 6, computer device 12 takes the form of a general-purpose computing device. Components of computer device 12 may include at least one processor or processing unit 16 , memory 28 , and bus 18 connecting various system components including memory 28 and processing unit 16 .
总线18表示几类总线结构中的至少一种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括工业标准体系结构(Industry Standard Architecture,ISA)总线,微通道体系结构(Micro Channel Architecture,MCA)总线,增强型ISA总线、视频电子标准协会(Video Electronic Standard Association,VESA)局域总线以及外围组件互连(Peripheral Component Interconnect,PCI)总线。 Bus 18 represents at least one of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus structures. These architectures include, for example, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MCA) bus, the Enhanced ISA bus, the Video Electronics Standard Association (VESA) ) Local bus and Peripheral Component Interconnect (PCI) bus.
计算机设备12可以包括多种计算机系统可读介质。这些介质可以是能够被计算机设备12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。 Computer device 12 may include a variety of computer system readable media. Such media can be all available media that can be accessed by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(Random Access Memory,RAM)30和/或高速缓存存储器32。计算机设备12可以包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以用于读写不可移动的、非易失性磁介质(通常称为“硬盘驱动器”)。可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如便携式紧凑磁盘只读存 储器(Compact Disc-Read Only Memory,CD-ROM),数字通用光盘只读存储器(Digital Video Disc-Read Only Memory,DVD-ROM)或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过至少一个数据介质接口与总线18相连。存储器28可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本申请各实施例的功能。 Memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32 . Computer device 12 may include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, non-volatile magnetic media (commonly referred to as a "hard drive"). Disk drives for reading and writing to removable non-volatile disks (such as "floppy disks") and for removable non-volatile optical disks (such as Compact Disc-Read Only Memory (CD) -ROM), Digital Video Disc-Read Only Memory (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) CD-ROM drive. In these cases, each drive may be connected to bus 18 via at least one data medium interface. Memory 28 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present application.
具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如存储器28中,这样的程序模块42包括操作系统、至少一个应用程序、其它程序模块以及程序数据,这些示例中的每一个或一组合中可能包括网络环境的实现。程序模块42通常执行本申请所描述的实施例中的功能和/或方法。A program/utility tool 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including an operating system, at least one application program, other program modules, and program data, in these examples Each or a combination may include implementations of network environments. The program modules 42 generally perform the functions and/or methods of the embodiments described herein.
计算机设备12也可以与至少一个外部设备14(例如键盘、指向设备、显示器24等)通信,还可与至少一个使得用户能与该计算机设备12交互的设备通信,和/或与使得该计算机设备12能与至少一个其它计算设备进行通信的设备(例如网卡,调制解调器等)通信。这种通信可以通过输入/输出(Input/Output,I/O)接口22进行。并且,计算机设备12还可以通过网络适配器20与至少一个网络(例如局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器20通过总线18与计算机设备12的其它模块通信。应当明白,可以结合计算机设备12使用其它硬件和/或软件模块,包括:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、独立磁盘冗余阵列(Redundant Array of Inexpensive Disks,RAID)系统、磁带驱动器以及数据备份存储系统等。 Computer device 12 may also communicate with at least one external device 14 (e.g., a keyboard, pointing device, display 24, etc.), and at least one device that enables a user to interact with 12 A device (eg, network card, modem, etc.) capable of communicating with at least one other computing device. This communication can be performed through an input/output (Input/Output, I/O) interface 22 . Moreover, the computer device 12 can also communicate with at least one network (such as a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN) and/or a public network, such as the Internet) through the network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18 . It should be appreciated that other hardware and/or software modules may be used in conjunction with computer device 12, including: microcode, device drivers, redundant processing units, external disk drive arrays, Redundant Array of Inexpensive Disks (RAID) systems , tape drives, and data backup storage systems.
处理单元16通过运行存储在存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现本申请实施例所提供的铭牌识别模型的训练方法或铭牌的识别方法。The processing unit 16 executes various functional applications and data processing by running the programs stored in the memory 28 , for example, implementing the nameplate recognition model training method or the nameplate recognition method provided in the embodiment of the present application.
实施例六Embodiment six
本申请实施例六还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述铭牌识别模型的训练方法或铭牌的识别方法的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiment 6 of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned nameplate recognition model training method or nameplate recognition method is realized. , and can achieve the same technical effect, in order to avoid repetition, it will not be repeated here.
其中,计算机可读存储介质例如可以包括电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者以上的组合。计算机可读存储介质的示例包括:具有至少一个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(Read Only Memory,ROM)、可擦式可编程只读存储器(如电子可编程只读存储器(Electronic Programable Read Only Memory,EPROM)或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的合适的组合。在本文件中,计算机可读存储介质可以是包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者 器件使用或者与其结合使用。Wherein, the computer-readable storage medium may include, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination thereof. Examples of computer readable storage media include: an electrical connection having at least one lead, a portable computer disk, a hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (such as electronic programmable read-only memory (Electronic Programable Read Only Memory, EPROM) or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or a suitable combination of the above. In this document, a computer-readable storage medium may be a tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

Claims (10)

  1. 一种铭牌识别模型的训练方法,所述铭牌识别模型包括编码器、回归网络,所述方法包括:A training method for a nameplate recognition model, the nameplate recognition model comprising an encoder and a regression network, the method comprising:
    获取对安装在电力设备上的铭牌采集的样本图像数据、所述铭牌中记录的设备参数,所述样本图像数据中包含多个方框所在的样本区域数据;Acquiring sample image data collected on nameplates installed on electrical equipment and equipment parameters recorded on the nameplates, wherein the sample image data includes sample area data where multiple boxes are located;
    将位于所述方框的所述设备参数写入所述样本区域数据中的印痕上,作为标签区域数据;Writing the device parameters located in the box on the imprint in the sample area data as label area data;
    对所述标签区域数据中的所述设备参数采样标签点;Sampling label points for the device parameters in the label area data;
    将所述样本图像数据输入所述编码器中提取特征数据;inputting the sample image data into the encoder to extract feature data;
    将所述特征数据输入所述回归网络中,对所述样本区域数据中的印痕采样参考点;inputting the feature data into the regression network, and sampling reference points for the imprints in the sample area data;
    将所述特征数据输入解码器中,将所述样本区域数据中的印痕重构为字体、作为参考区域数据;inputting the feature data into a decoder, reconstructing the imprint in the sample area data into a font as reference area data;
    根据所述参考点与所述标签点之间的差异、所述参考区域数据与所述标签区域数据之间的差异,对所述编码器、所述回归网络与所述解码器进行训练,直至所述参考点与所述参考区域数据对齐,所述解码器在训练完成时丢弃。According to the difference between the reference point and the label point, the difference between the reference area data and the label area data, the encoder, the regression network and the decoder are trained until The reference points are aligned with the reference region data, which the decoder discards when training is complete.
  2. 根据权利要求1所述的方法,其中,所述将位于所述方框的所述设备参数写入所述样本区域数据中的印痕上,作为标签区域数据,包括:The method according to claim 1, wherein said writing said device parameters located in said box on the footprint in said sample area data as label area data comprises:
    将所述样本区域数据区分为具有字体的第一样本区域数据、具有印痕的第二样本区域数据;distinguishing the sample area data into first sample area data having fonts and second sample area data having prints;
    按照所述第一样本区域数据上的所述字体对位于所述第二样本区域数据所属方框的所述设备参数进行风格迁移,获得风格参数;performing style migration on the device parameters located in the box to which the second sample area data belongs according to the font on the first sample area data, to obtain style parameters;
    将所述风格参数写入所述第二样本区域数据的印痕上,作为标签区域数据。Writing the style parameter into the imprint of the second sample area data as label area data.
  3. 根据权利要求1或2所述的方法,其中,所述根据所述参考点与所述标签点之间的差异、所述参考区域数据与所述标签区域数据之间的差异,对所述编码器、所述回归网络与所述解码器进行训练,直至所述参考点与所述参考区域数据对齐,包括:The method according to claim 1 or 2, wherein the encoding is performed according to the difference between the reference point and the label point, the difference between the reference area data and the label area data The device, the regression network and the decoder are trained until the reference point is aligned with the reference area data, including:
    计算所述参考点与所述标签点之间的差异,作为第一损失值;calculating the difference between the reference point and the label point as a first loss value;
    计算所述参考区域数据与所述标签区域数据之间的差异,作为第二损失值;calculating the difference between the reference area data and the label area data as a second loss value;
    将所述第一损失值与所述第二损失值结合为第三损失值;combining the first loss value and the second loss value into a third loss value;
    使用所述第一损失值更新所述回归网络;updating the regression network using the first loss value;
    使用所述第二损失值更新所述解码器;updating the decoder using the second loss value;
    使用所述第三损失值更新所述编码器;updating the encoder using the third loss value;
    判断当前迭代的次数是否到达预设的阈值,基于当前迭代的次数到达预设的阈值的判断结果,确定所述编码器、所述回归网络与所述解码器训练完成,丢弃所述解码器;基于当前迭代的次数未到达预设的阈值的判断结果,返回执行所述将所述样本图像数据输入所述编码器中提取特征数据。Judging whether the number of current iterations reaches a preset threshold, based on the judgment result that the number of current iterations reaches a preset threshold, determining that the encoder, the regression network, and the decoder have been trained, and discarding the decoder; Based on the judging result that the number of current iterations does not reach the preset threshold, return to performing the step of inputting the sample image data into the encoder to extract feature data.
  4. 根据权利要求3所述的方法,其中,所述计算所述参考点与所述标签点之间的差异,作为第一损失值,包括:The method according to claim 3, wherein said calculating the difference between said reference point and said label point, as a first loss value, comprises:
    对于相同编号的所述参考点与所述标签点,计算所述参考点与所述标签点之间的范数距离;For the reference point and the label point with the same number, calculate the norm distance between the reference point and the label point;
    对所述范数距离计算平均值,作为第一损失值。An average value is calculated for the norm distance as a first loss value.
  5. 根据权利要求3所述的方法,其中,所述计算所述参考区域数据与所述 标签区域数据之间的差异,作为第二损失值,包括:The method according to claim 3, wherein said calculating the difference between said reference area data and said label area data, as a second loss value, comprises:
    将所述参考区域数据转换为第一矩阵;converting the reference area data into a first matrix;
    将所述标签区域数据转换为第二矩阵;converting the label area data into a second matrix;
    计算所述第一矩阵与所述第二矩阵之间的欧式距离,作为第二损失值。Calculate the Euclidean distance between the first matrix and the second matrix as a second loss value.
  6. 根据权利要求3所述的方法,其中,所述将所述第一损失值与所述第二损失值结合为第三损失值,包括:The method according to claim 3, wherein said combining the first loss value and the second loss value into a third loss value comprises:
    计算所述第一损失值与第一权重之间的乘积,作为第一调权值;calculating the product of the first loss value and the first weight as a first weight adjustment value;
    计算所述第二损失值与第二权重之间的乘积,作为第二调权值,所述第一权重大于所述第二权重;calculating the product of the second loss value and the second weight, as a second weight adjustment value, the first weight is greater than the second weight;
    计算所述第一调权值与所述第二调权值之间的和值,作为第三损失值;calculating the sum of the first weight adjustment value and the second weight adjustment value as a third loss value;
    其中,所述第一权重大于所述第二权重。Wherein, the first weight is greater than the second weight.
  7. 一种铭牌的识别方法,包括:A method for identifying a nameplate, comprising:
    加载根据权利要求1-6中任一项所述的方法训练的铭牌识别模型;Loading the nameplate recognition model trained according to the method according to any one of claims 1-6;
    对安装在电力设备上的铭牌采集目标图像数据,所述目标图像数据中包含多个方框所在的目标区域数据;collecting target image data for nameplates installed on electrical equipment, where the target image data includes target area data where multiple boxes are located;
    将所述目标图像数据输入编码器中提取特征数据;Input the target image data into the encoder to extract feature data;
    将所述特征数据输入回归网络中,对所述目标区域数据中的印痕采样目标点;inputting the feature data into the regression network, and sampling target points for the imprints in the target area data;
    在所述目标图像数据中将所述目标点写入所述目标区域数据中的印痕上,获得重构图像数据;writing the target point on the footprint in the target area data in the target image data to obtain reconstructed image data;
    对所述重构图像数据执行光学字符识别,获得所述铭牌中记录的设备参数。Performing optical character recognition on the reconstructed image data to obtain device parameters recorded in the nameplate.
  8. 根据权利要求7所述的方法,其中,所述设备参数包括参数名、参数值;The method according to claim 7, wherein the device parameters include parameter names and parameter values;
    所述对所述重构图像数据执行光学字符识别,获得所述铭牌中记录的设备参数,包括:The performing optical character recognition on the reconstructed image data to obtain the equipment parameters recorded in the nameplate includes:
    对所述重构图像数据执行光学字符识别,获得文本信息;performing optical character recognition on the reconstructed image data to obtain text information;
    查找位于所述方框中的所述文本信息,作为所述铭牌中记录的参数值;Find the text information located in the box as the parameter value recorded in the nameplate;
    查找位于所述方框之前的文本信息,作为所述铭牌中记录的参数名;Find the text information before the box as the parameter name recorded on the nameplate;
    在位于所述方框中的所述文本信息为单位的情况下,确定所述文本信息为所述铭牌中记录的参数值。If the text information in the box is a unit, it is determined that the text information is the parameter value recorded in the nameplate.
  9. 一种计算机设备,所述计算机设备包括:A computer device comprising:
    处理器;processor;
    存储器,设置为存储程序,memory, set to store program,
    在所述程序被所述处理器执行时,所述处理器实现如权利要求1-6中任一项所述的铭牌识别模型的训练方法或者如权利要求7-8中任一项所述的铭牌识别方法。When the program is executed by the processor, the processor implements the nameplate recognition model training method according to any one of claims 1-6 or the method described in any one of claims 7-8. Nameplate identification method.
  10. 一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如权利要求1-6中任一项所述的铭牌识别模型的训练方法或者如权利要求7-8中任一项所述的铭牌识别方法。A computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the nameplate recognition model training method according to any one of claims 1-6 or The nameplate identification method according to any one of claims 7-8.
PCT/CN2022/136080 2021-12-07 2022-12-02 Nameplate recognition model training method, nameplate recognition method, and related apparatuses WO2023103894A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111479203.XA CN113920497B (en) 2021-12-07 2021-12-07 Nameplate recognition model training method, nameplate recognition method and related devices
CN202111479203.X 2021-12-07

Publications (1)

Publication Number Publication Date
WO2023103894A1 true WO2023103894A1 (en) 2023-06-15

Family

ID=79248669

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/136080 WO2023103894A1 (en) 2021-12-07 2022-12-02 Nameplate recognition model training method, nameplate recognition method, and related apparatuses

Country Status (2)

Country Link
CN (1) CN113920497B (en)
WO (1) WO2023103894A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113920497B (en) * 2021-12-07 2022-04-08 广东电网有限责任公司东莞供电局 Nameplate recognition model training method, nameplate recognition method and related devices

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014063157A2 (en) * 2012-10-19 2014-04-24 Digimarc Corporation Methods and arrangements for identifying objects
CN110110726A (en) * 2019-05-15 2019-08-09 深圳供电局有限公司 The recognition methods of power equipment nameplate, device, computer equipment and storage medium
CN110414309A (en) * 2019-05-27 2019-11-05 上海眼控科技股份有限公司 A kind of automatic identifying method of vehicle nameplate
US10963719B1 (en) * 2019-03-04 2021-03-30 Ccc Information Services Inc. Optimized vehicle license plate recognition
CN113920497A (en) * 2021-12-07 2022-01-11 广东电网有限责任公司东莞供电局 Nameplate recognition model training method, nameplate recognition method and related devices

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
NL229663A (en) * 1957-04-17 1900-01-01
JP4011646B2 (en) * 1996-05-23 2007-11-21 株式会社東芝 Line detection method and character recognition device
CN101533474B (en) * 2008-03-12 2014-06-04 三星电子株式会社 Character and image recognition system based on video image and method thereof
US9483694B2 (en) * 2014-01-26 2016-11-01 Sang Hun Kim Image text search and retrieval system
CN106303225A (en) * 2016-07-29 2017-01-04 努比亚技术有限公司 A kind of image processing method and electronic equipment
CN106952257B (en) * 2017-03-21 2019-12-03 南京大学 A kind of curved surface label open defect detection method based on template matching and similarity calculation
GB201803795D0 (en) * 2018-03-09 2018-04-25 Prisymid Ltd Label data processing system
CN110659637A (en) * 2019-09-24 2020-01-07 国网河北省电力有限公司电力科学研究院 Electric energy meter number and label automatic identification method combining deep neural network and SIFT features
CN111860506B (en) * 2020-07-24 2024-03-29 北京百度网讯科技有限公司 Method and device for recognizing characters
CN112364860A (en) * 2020-11-05 2021-02-12 北京字跳网络技术有限公司 Training method and device of character recognition model and electronic equipment
CN112446370B (en) * 2020-11-24 2024-03-29 东南大学 Method for identifying text information of nameplate of power equipment
CN112508015A (en) * 2020-12-15 2021-03-16 山东大学 Nameplate identification method, computer equipment and storage medium
CN112613513A (en) * 2020-12-31 2021-04-06 北京市商汤科技开发有限公司 Image recognition method, device and system
CN112633419B (en) * 2021-03-09 2021-07-06 浙江宇视科技有限公司 Small sample learning method and device, electronic equipment and storage medium
CN113707280B (en) * 2021-10-28 2022-04-08 萱闱(北京)生物科技有限公司 Method, device, medium and computing equipment for expanding labeled data set

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014063157A2 (en) * 2012-10-19 2014-04-24 Digimarc Corporation Methods and arrangements for identifying objects
US10963719B1 (en) * 2019-03-04 2021-03-30 Ccc Information Services Inc. Optimized vehicle license plate recognition
CN110110726A (en) * 2019-05-15 2019-08-09 深圳供电局有限公司 The recognition methods of power equipment nameplate, device, computer equipment and storage medium
CN110414309A (en) * 2019-05-27 2019-11-05 上海眼控科技股份有限公司 A kind of automatic identifying method of vehicle nameplate
CN113920497A (en) * 2021-12-07 2022-01-11 广东电网有限责任公司东莞供电局 Nameplate recognition model training method, nameplate recognition method and related devices

Also Published As

Publication number Publication date
CN113920497B (en) 2022-04-08
CN113920497A (en) 2022-01-11

Similar Documents

Publication Publication Date Title
CN110084239B (en) Method for reducing overfitting of network training during off-line handwritten mathematical formula recognition
CN109285111B (en) Font conversion method, device, equipment and computer readable storage medium
CN106097381B (en) A kind of method for tracking target differentiating Non-negative Matrix Factorization based on manifold
WO2017088537A1 (en) Component classification method and apparatus
WO2023103894A1 (en) Nameplate recognition model training method, nameplate recognition method, and related apparatuses
CN111970400B (en) Crank call identification method and device
CN111738169A (en) Handwriting formula recognition method based on end-to-end network model
CN111428201A (en) Prediction method for time series data based on empirical mode decomposition and feedforward neural network
CN110287911A (en) A kind of content identification method of invoice, device, equipment and storage medium
CN113205160A (en) Model training method, text recognition method, model training device, text recognition device, electronic equipment and medium
CN111107107B (en) Network behavior detection method and device, computer equipment and storage medium
CN109492859A (en) Employees classification method and device based on neural network model, equipment, medium
CN112951233A (en) Voice question and answer method and device, electronic equipment and readable storage medium
CN116910752A (en) Malicious code detection method based on big data
CN110020638B (en) Facial expression recognition method, device, equipment and medium
CN111488501A (en) E-commerce statistical system based on cloud platform
CN110874591A (en) Image positioning method, device, equipment and storage medium
CN113780289A (en) Image recognition method and device, storage medium and electronic equipment
CN113869456A (en) Sampling monitoring method and device, electronic equipment and storage medium
CN111126056B (en) Method and device for identifying trigger words
CN112559741A (en) Nuclear power equipment defect recording text classification method, system, medium and electronic equipment
CN111401069A (en) Intention recognition method and intention recognition device for conversation text and terminal
CN114943306A (en) Intention classification method, device, equipment and storage medium
CN110414000B (en) Keyword extraction method and system based on template document comparison
CN113515614A (en) Knowledge distillation-based attribute identification method, terminal device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22903316

Country of ref document: EP

Kind code of ref document: A1