Meter reading determination method and model training method, device, equipment and storage medium
Through self-attention text recognition network model and shallow convolutional neural network, the readings in the meter reading image are automatically identified, which solves the problem that traditional meter reading reading accuracy depends on manual verification, and realizes efficient and accurate meter reading reading determination. Improve measurement accuracy and efficiency.
Patent Information
- Application Number
- CN202410910287.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-07-09
AI Technical Summary
The accuracy of traditional meter readings depends on manual estimation and verification, which makes it difficult to ensure accuracy, resulting in inaccurate readings of meter instruments, affecting the reasonable allocation of resources and the legitimate rights and interests of users.
The self-attention text recognition network model is used to combine shallow convolutional neural networks to generate a meter reading and determination model through image feature extraction, adaptive two-dimensional position coding, multi-head attention mechanism and position perception feedforward processing, and automatically identify meter reading Reads in the image and verify reading consistency through preset thresholds to ensure accuracy.
It realizes efficient, accurate and automatic identification of meter readings, reduces manual errors, saves human resources and time, improves meter reading efficiency, and ensures measurement accuracy.
Smart Images

Figure CN118470727B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a meter reading determination method and a model training method, device, equipment and storage medium. Background Art
[0002] In production and life, the use of various resources is indispensable. As a key tool for measuring resource usage, the measurement accuracy of various meters is directly related to the rational allocation and effective use of resources. If the readings of the meters are inaccurate, it may cause users to overpay or underpay, damaging the legitimate rights and interests of users. However, the accuracy of traditional meter readings requires manual estimation and one-to-one verification based on historical usage. Manual verification is difficult to ensure the accuracy of meter reading data by meter readers and is difficult to meet actual usage needs. Summary of the invention
[0003] The embodiments of the present application provide a method for determining meter readings and a model training method, device, equipment and storage medium, which can solve the technical problem of efficiently and accurately determining the meter readings of a metering instrument.
[0004] In a first aspect, an embodiment of the present application provides a method for determining a meter reading, comprising:
[0005] Acquire a meter reading image, wherein the meter reading image includes a meter reading;
[0006] The meter reading image is input into the meter reading determination model, and a meter reading determination process is performed to obtain a first meter reading;
[0007] Obtaining a second meter reading, where the acquisition time of the second meter reading and the acquisition time of the meter reading image meet a preset time period;
[0008] When the absolute value of the difference between the first meter reading and the second meter reading is less than or equal to a preset threshold, the first meter reading is determined as the target meter reading.
[0009] In one implementation, when the absolute value of the difference between the first meter reading and the second meter reading is greater than a preset threshold, the first meter reading is determined to be an abnormal meter reading; an early warning process is performed on the abnormal meter reading, and a meter reading image is acquired again.
[0010] In a second aspect, an embodiment of the present application provides a method for training a meter reading determination model, comprising:
[0011] A meter reading image training set is obtained, where the meter reading images in the meter reading image training set are labeled images.
[0012] The meter reading image training set is input into the self-attention text recognition network model, and the image feature extraction is performed using a shallow convolutional neural network to obtain image feature information.
[0013] The image feature information is subjected to adaptive two-dimensional position encoding processing, multi-head attention mechanism processing and position-aware feedforward processing to generate the first feature representation.
[0014] Get the current character information in the current meter reading image.
[0015] The predicted text sequence information is generated according to the first feature representation and the current character information, and a meter reading determination model is obtained.
[0016] In one implementation, after obtaining the current character information in the current meter reading image, the method further includes: performing character embedding processing on the current character information to obtain first character information.
[0017] In one implementation, position encoding processing is performed based on the first character information and the first feature representation to obtain second character information, where the second character information is used to represent the relative position relationship of the current character in the corresponding text sequence.
[0018] In one implementation, the second character information is subjected to masked multi-head attention mechanism processing, multi-head attention mechanism processing, and point feedforward processing to generate a second feature representation.
[0019] In one implementation, the Line&Softmax function is used to map the second feature representation to obtain predicted text sequence information.
[0020] In one implementation, a meter reading image training set is obtained, wherein the meter reading images in the meter reading image training set are annotated images; a self-attention text recognition network model is trained using the meter reading image training set to obtain a meter reading determination model, wherein the meter reading determination model includes an encoder, a decoder, and a predictor.
[0021] In one implementation, the self-attention text recognition network model is trained using a meter reading image training set, including:
[0022] The encoder is used to extract image features of the meter reading images in the meter reading image training set to obtain a deep feature map;
[0023] Use the decoder to generate a predicted text sequence based on the deep feature map;
[0024] The predictor is used to obtain meter readings based on the predicted text sequence.
[0025] In one implementation, using a decoder to generate a predicted text sequence according to a deep feature map includes:
[0026] Use the self-attention mechanism to determine the text sequence information in the deep feature map;
[0027] Generate a predicted text sequence based on text sequence information.
[0028] In one implementation, obtaining a meter reading according to a predicted text sequence using a predictor includes:
[0029] Mapping the predicted text sequence to a preset character set to obtain the probability distribution of each character in the preset character set;
[0030] Determine the characters that meet the preset probability threshold as target characters;
[0031] Get meter readings based on the target character.
[0032] In a third aspect, an embodiment of the present application provides a device for determining a meter reading, which has the function of implementing the method in the first aspect or any possible implementation thereof. Specifically, the device includes a unit for implementing the method in the first aspect or any possible implementation thereof.
[0033] In one embodiment, the device comprises:
[0034] An acquisition unit, used for acquiring a meter reading image, wherein the meter reading image includes a meter reading;
[0035] A processing unit, configured to input the meter reading image into a meter reading determination model, perform meter reading determination processing, and obtain a first meter reading;
[0036] The acquisition unit is further used to acquire a second meter reading, where the acquisition time of the second meter reading and the acquisition time of the meter reading image meet a preset time period;
[0037] The processing unit is further configured to, when an absolute value of a difference between the first meter reading and the second meter reading is less than or equal to a preset threshold, determine the first meter reading as a target meter reading.
[0038] In a fourth aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the computer device implements a method of any one of the first aspects or any one of the second aspects.
[0039] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a computer device, the computer device implements a method of any one of the first aspects or any one of the second aspects.
[0040] In a sixth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer device, the computer device executes a method of any one of the implementation modes of the first aspect or the second aspect.
[0041] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by using a trained meter reading determination model to automatically identify the meter readings in the input meter reading image, the errors of manual meter reading can be reduced, the accuracy can be improved, and a large amount of human resources and time can be saved, thereby improving the efficiency of meter reading. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a schematic diagram of an application scenario of a water meter provided in an embodiment of the present application.
[0043] Figure 2 It is a flow chart of a method for determining a meter reading provided in an embodiment of the present application.
[0044] Figure 3 It is a flow chart of a meter reading determination model training method provided in an embodiment of the present application.
[0045] Figure 4 It is a schematic diagram of the training process of a meter reading determination model provided in an embodiment of the present application.
[0046] Figure 5 It is a structural schematic diagram of a meter reading determination device provided in an embodiment of the present application.
[0047] Figure 6 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In daily production and life, people's various activities are closely related to the accurate counting of meters, such as common water meters, electricity meters, gas meters, industrial control meters, etc. Through the accurate measurement of various meters, on-demand billing can be achieved to avoid waste and unfair billing.
[0049] Combine the following Figure 1 Let's explain in detail the application scenario of a water meter.
[0050] Figure 1 It is a schematic diagram of an application scenario of a water meter provided in an embodiment of the present application.
[0051] like Figure 1 As shown, when users use water, the specific water usage readings will be displayed on the water meter. In order to charge fairly and reasonably, relevant staff will usually copy the water meter and then upload it to the payment platform.
[0052] In combination with the above scenario, it can be understood that errors and omissions are inevitable in the process of staff transcription, which will lead to errors in meter readings and affect the normal use of users.
[0053] In response to the above problems, the present application proposes a meter reading determination method and a model training method, which can accurately, efficiently and automatically identify meter readings, providing convenience for users.
[0054] In order to further illustrate the technical solution of the present application, specific embodiments are provided below.
[0055] Figure 2 It is a flow chart of a method for determining a meter reading provided in an embodiment of the present application.
[0056] like Figure 2 As shown, the above method includes the following steps S201~S204.
[0057] S201, obtaining a meter reading image.
[0058] The meter readings are included in the meter reading image.
[0059] Meter reading images refer to various meter dial images collected by users. Common ones include square reading meter dial images, such as water meter images, electricity meter images, gas meter images, etc.
[0060] Here, the meter reading image may be photographed by using a mobile device. The specific meter reading image may vary according to the actual situation and is not limited here.
[0061] The meter reading refers to the dial reading in the meter reading image, for example, the reading in the meter reading image may be "12345" etc. The specific meter reading varies according to different meter reading images and is not limited here.
[0062] S202: Input the meter reading image into a meter reading determination model, perform meter reading determination processing, and obtain a first meter reading.
[0063] The meter reading determination model is a trained Self-Attention Text Recognition Network (SATRN) model.
[0064] The SATRN model is a deep learning model for text recognition tasks that combines the ideas of the self-attention mechanism and the Transformer model.
[0065] SATRN uses the self-attention mechanism to automatically learn the dependencies between different positions in the input sequence. By calculating the relevance weight of each input position with other positions, it can achieve modeling of long-distance information and adaptive processing of text sequences without introducing a cyclic structure.
[0066] SATRN is based on the Transformer architecture, which contains multiple layers of self-attention layers and feedforward neural network layers. This architecture can process input sequences in parallel, has high computational efficiency and learning ability, and is suitable for processing long text sequences in text recognition tasks.
[0067] By inputting the meter reading image into the SATRN model for processing, the meter reading in the meter reading image can be automatically identified to obtain the first meter reading.
[0068] S203: Obtain a second meter reading.
[0069] The acquisition time of the second meter reading and the acquisition time of the meter reading image meet the preset time period.
[0070] The second meter reading is a reading collected on-site and is used for comparison with the first meter reading.
[0071] The preset time period is used to control the acquisition time of the meter reading image and the second meter reading. In order to verify the first meter reading and the second meter reading, the acquisition time of the meter reading image and the second meter reading should be in the same time period. For example, the meter reading image and the second meter reading are acquired within 1 minute. The specific value of the preset time period can be determined according to the actual situation and is not limited here.
[0072] S204: When the absolute value of the difference between the first meter reading and the second meter reading is less than or equal to a preset threshold, determine the first meter reading as a target meter reading.
[0073] Assume that the first meter reading is recorded as S1 and the second meter reading is recorded as S2, and the absolute value S of the two is |S2-S1|.
[0074] The specific preset threshold can be set according to actual conditions and is not limited here.
[0075] When the value of S is less than or equal to a preset threshold (eg, 1), the first meter reading is determined as the target meter reading.
[0076] It can also be understood that here the target meter reading is determined based on the first meter reading and the second meter reading.
[0077] From the above, it can be understood that the first meter reading is automatically identified by using the SATRN model. If the values of the first meter reading and the second meter reading are the same, for example, the first meter reading is "12345" and the second meter reading is also "12345", then it means that the target meter reading is "12345".
[0078] If the values of the first meter reading and the second meter reading are not exactly the same, for example, the first meter reading is "12345" and the second meter reading is "12845", it means that there is an abnormality in the meter reading and the target meter reading cannot be directly determined.
[0079] The above method can automatically identify the meter readings of the input meter reading images and compare the meter readings, solving the problem of low efficiency and easy errors in traditional manual review.
[0080] In one implementation, when the absolute value of the difference between the first meter reading and the second meter reading is greater than a preset threshold, the first meter reading is determined to be an abnormal meter reading; an early warning process is performed on the abnormal meter reading, and a meter reading image is acquired again.
[0081] In combination with the above, when the value of S is greater than a preset threshold (eg, 1), the first meter reading is determined as an abnormal meter reading.
[0082] As an example but not limitation, by storing the first meter reading and the second meter reading in a database, calling a database SQL statement to query data with |S2-S1|>1, such abnormal meter reading greater than 1 is queried.
[0083] Generate warning information based on abnormal meter readings and send instructions to re-acquire meter reading images to further check abnormal conditions and ensure data accuracy.
[0084] Through the above steps, when it is found that the difference between the first meter reading and the second meter reading exceeds the preset threshold, the abnormal situation can be discovered in time, the abnormal reading can be quickly screened out, and early warning processing can be performed, and then the meter reading image can be obtained again to further confirm and process the abnormal situation.
[0085] Figure 3 It is a flow chart of a meter reading determination model training method provided in an embodiment of the present application.
[0086] like Figure 3 As shown, the above method includes the following steps S301~S305.
[0087] S301, obtaining a meter reading image training set.
[0088] The meter reading images in the meter reading image training set are labeled images.
[0089] As an example but not limitation, the collected meter reading images are annotated with meter readings, such as annotating the meter reading images containing the meter reading "12345" with the text "12345" to obtain an annotated meter reading image, and finally obtaining a meter reading image training set by annotating multiple meter reading images.
[0090] S302: input the meter reading image training set into the self-attention text recognition network model, and use a shallow convolutional neural network to perform image feature extraction processing to obtain image feature information.
[0091] S303: Perform adaptive two-dimensional position encoding processing, multi-head attention mechanism processing and position-aware feedforward processing on the image feature information to generate a first feature representation.
[0092] S304: Acquire current character information in the current meter reading image.
[0093] S305: Generate predicted text sequence information according to the first feature representation and current character information to obtain a meter reading determination model.
[0094] In one implementation, after obtaining the current character information in the current meter reading image, the method further includes: performing character embedding processing on the current character information to obtain first character information.
[0095] In one implementation, position encoding processing is performed based on the first character information and the first feature representation to obtain second character information, where the second character information is used to represent the relative position relationship of the current character in the corresponding text sequence.
[0096] In one implementation, the second character information is subjected to masked multi-head attention mechanism processing, multi-head attention mechanism processing, and point feedforward processing to generate a second feature representation.
[0097] In one implementation, the Line&Softmax function is used to map the second feature representation to obtain predicted text sequence information.
[0098] Combine the following Figure 4 Let's take a closer look at how to train the meter reading determination model.
[0099] Figure 4 It is a schematic diagram of the training process of a meter reading determination model provided in an embodiment of the present application.
[0100] First, let me introduce some professional terminology concepts.
[0101] Shallow CNN network: usually consists of several convolutional layers and pooling layers to capture local features in the image.
[0102] Adaptive 2D Position Encoding: It is used to encode the input position information into the model to help the model understand the spatial relationship between characters.
[0103] Multi-head attention: An attention mechanism that allows the model to focus on different positions of the input simultaneously, helping to capture long-range dependencies.
[0104] Position-aware feedforward: A feedforward network that processes features generated by the attention mechanism while taking position information into account.
[0105] Character Embedding: The process of mapping each character into a high-dimensional vector space so that the model can better understand the semantic relationship between characters.
[0106] Positional encoding: An encoding method used to inject position information into the model to help the model understand the relative position relationship of the input data.
[0107] Masked Multi-Head Attention: A special form of multi-head attention used when processing text sequence data to ensure that the model only pays attention to the previous characters when generating each character to avoid information leakage.
[0108] Point Feedforward: A common feedforward neural network structure used to process features generated by multi-head attention.
[0109] Line&Softmax function: A function used to map model output to a text sequence, commonly used in text recognition tasks.
[0110] like Figure 4As shown in the figure, the meter reading image is input into the SATRN model, and the image feature extraction is performed through the shallow CNN network to obtain the image features. Then, the feature representation with position-aware properties (i.e., the first feature representation) can be generated by combining adaptive two-dimensional position encoding, multi-head attention mechanism, and position-aware feedforward for use in subsequent text recognition tasks; the current character in the current meter reading image is obtained, and the character embedding process is performed to obtain the first character information, which is processed by combining position encoding, shielded multi-head attention mechanism, multi-head attention mechanism, and point feedforward. Through character embedding processing, the current character is mapped to a high-dimensional vector space so that the model can better understand the semantic information of the current character; through position encoding, the position information of the character is encoded into the feature representation to obtain the second character information, so that the model can understand the relative position relationship of the character in the text sequence; through the shielded multi-head attention mechanism, the model will only focus on the characters before the current character, so that only the contextual information is considered when generating the current feature representation. This helps to avoid information leakage and better understand the structure of the text sequence; through the multi-head attention mechanism, the model can simultaneously focus on characters in different positions, capture long-distance dependencies, and thus generate a more comprehensive feature representation. Through the point feedforward network structure, the model further processes the features generated by the multi-head attention mechanism to generate a more expressive and semantic feature representation (i.e., the second feature representation). Finally, the text sequence (i.e., predicted text sequence information) is obtained by mapping through the Line&Softmax function.
[0111] To put it another way, the SATRN model mainly consists of a convolution branch and an attention branch.
[0112] The convolution branch extracts the features of the image through a series of convolutional layers and pooling layers. The convolutional layer can effectively capture the local features in the image, while the pooling layer helps to reduce the dimension and abstract the feature map, thereby extracting a more abstract and advanced feature representation.
[0113] The attention branch mainly reduces the size of the feature map through the squeeze operation and performs weighted averaging of the feature map through the excitation operation. In the squeeze operation, the dimension of the feature map is compressed to reduce the number of parameters and computational complexity while retaining the main information. Then in the excitation operation, different channels in the feature map are weighted according to their importance to increase the attention to the feature.
[0114] It can be understood that the SATRN model mentioned above is based on the transformer network structure and uses the self-attention mechanism to capture the long-distance dependencies between text features. It has excellent performance in processing texts with complex structures and contextual dependencies. At the same time, the calculation of the self-attention mechanism can be decomposed into independent subtasks, which can be executed in parallel. This enables the self-attention mechanism to efficiently process large-scale input sequences when there are sufficient computing resources. The self-attention mechanism only requires two matrix multiplications and some addition operations to calculate an attention score, so its computational efficiency is relatively high.
[0115] Another meter reading determination model training method provided in an embodiment of the present application is introduced below.
[0116] A meter reading image training set is obtained, and a self-attention text recognition network model is trained using the meter reading image training set to obtain a meter reading determination model.
[0117] The meter reading determination model includes an encoder, a decoder and a predictor.
[0118] Combined with the above, we can see that the SATRN model structure includes an encoder, a decoder and a predictor.
[0119] The encoder is responsible for extracting image features, the decoder is used to generate an output sequence of meter readings, and the predictor is used to predict the decoder output.
[0120] By using the annotated meter reading image training set to train the self-attention text recognition network model, a meter reading determination model is finally obtained. The meter reading image is input into the model to output the corresponding meter reading. This training method can improve the model's learning ability for meter reading image information, thereby achieving accurate meter reading recognition and determination.
[0121] In one implementation, a self-attention text recognition network model is trained using a meter reading image training set, including: using an encoder to extract image features of a meter reading image in the meter reading image training set to obtain a deep feature map; using a decoder to generate a predicted text sequence according to the deep feature map; and using a predictor to obtain a meter reading according to the predicted text sequence.
[0122] The main task of the encoder is to extract features from the input image. Specifically, it uses a series of convolutional layers and pooling layers to convert the input image into a deep feature map that can preserve the main information and structure of the image.
[0123] In one implementation, a decoder is used to generate a predicted text sequence based on a deep feature map, including: using a self-attention mechanism to determine text sequence information in the deep feature map; and generating a predicted text sequence based on the text sequence information.
[0124] The decoder receives the feature map from the encoder and uses the self-attention mechanism to transform the features. The self-attention mechanism allows the decoder to capture the dependencies between features globally. Specifically, the self-attention mechanism allows the model to consider all the information of the input features at each decoding step, not just the information at the current position.
[0125] In one implementation, a predictor is used to obtain a meter reading based on a predicted text sequence, including: mapping the predicted text sequence to a preset character set to obtain a probability distribution of each character in the preset character set; determining a character that meets a preset probability threshold as a target character; and obtaining a meter reading based on the target character.
[0126] The predictor converts the output of the decoder into the final text sequence. Specifically, it uses a fully connected layer and a Softmax activation function to map the output of the decoder to a character set, obtains the probability distribution of each character, and then selects the character with the highest probability as the prediction result.
[0127] In summary, the manual review of meter readings in traditional solutions is cumbersome and error-prone, and the meter reading determination method provided by the present application can complete these tasks automatically, quickly, and accurately. This greatly reduces manual intervention and errors, improves work efficiency and accuracy, and thus saves manpower and material costs.
[0128] The above mainly introduces the method of the embodiment of the present application in conjunction with the accompanying drawings. It should be understood that although the various steps in the flowcharts involved in the embodiments described above are shown in sequence, these steps are not necessarily performed in sequence in the order shown in the figure. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the embodiments described above may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a part of the steps or stages in other steps. A device of an embodiment of the present application is introduced below in conjunction with the accompanying drawings. For simplicity, when introducing the device below, it will be appropriately omitted, and the relevant content can refer to the relevant description in the method above, and will not be repeated.
[0129] Figure 5It is a structural schematic diagram of a meter reading determination device provided in an embodiment of the present application.
[0130] like Figure 5 As shown, the device 1000 includes the following units.
[0131] The acquisition unit 1001 is used to acquire a meter reading image, where the meter reading image includes a meter reading.
[0132] The processing unit 1002 is used to input the meter reading image into the meter reading determination model, perform meter reading determination processing, and obtain a first meter reading.
[0133] The acquisition unit 1001 is further configured to acquire a second meter reading, where the acquisition time of the second meter reading and the acquisition time of the meter reading image satisfy a preset time period.
[0134] The processing unit 1002 is further configured to, when an absolute value of a difference between the first meter reading and the second meter reading is less than or equal to a preset threshold, determine the first meter reading as a target meter reading.
[0135] In one implementation, the device 1000 further includes a storage unit 1003, which can be used to store instructions and / or data, so as to implement the method in the above embodiment.
[0136] It should be noted that the information interaction, execution process and other contents between the above-mentioned units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0137] Figure 6 Schematic diagram of the structure of the computer device provided in the embodiment of the present application. Figure 6 As shown, the computer device 3000 of this embodiment includes: at least one processor 3100 ( Figure 6 Only one) processor, memory 3200, and a computer program 3210 stored in the memory 3200 and executable on at least one processor 3100 are shown. When the processor 3100 executes the computer program 3210, the computer device implements the steps in the above embodiments.
[0138] The processor 3100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0139] The memory 3200 may be an internal storage unit of the computer device 3000 in some embodiments, such as a hard disk or memory of the computer device 3000. The memory 3200 may also be an external storage device of the computer device 3000 in other embodiments, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 3000. Further, the memory 3200 may also include both an internal storage unit of the computer device 3000 and an external storage device. The memory 3200 is used to store an operating system, an application program, a boot loader (Boot Loader) data, and other programs, such as a program code of a computer program, etc. The memory 3200 may also be used to temporarily store data that has been output or is to be output.
[0140] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0141] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a computer device, the computer device can implement the steps in the above-mentioned method embodiments.
[0142] The embodiment of the present application provides a computer program product. When the computer program product is executed on a computer device, the computer device can implement the above-mentioned methods.
[0143] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the computer device can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0144] It should be understood that the size of the sequence number of each step in the above-described embodiment does not mean the order of execution, and the order of execution of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiment of the present application. In the description, for the purpose of explanation rather than for limitation, specific details such as specific system structure, technology and the like are proposed, so as to thoroughly understand the embodiment of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, the detailed description of well-known systems, devices, circuits and methods is omitted to prevent unnecessary details from hindering the description of the present application.
[0145] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0146] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0147] Additionally, in the specification of the present application and the description of the appended claims, the terms “include,” “comprise,” “have,” and their variations all mean “including but not limited to,” unless otherwise specifically emphasized.
[0148] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0149] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0150] In the embodiments provided in the present application, it should be understood that the disclosed devices, computer equipment and methods can be implemented in other ways. For example, the device and computer equipment embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0151] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for determining a meter reading, characterized in that: include: Acquire a meter reading image, wherein the meter reading image includes a meter reading; The meter reading image is input into a meter reading determination model, and a meter reading determination process is performed to obtain a first meter reading, wherein the meter reading determination model is configured to obtain image feature information by inputting a meter reading image training set into a self-attention text recognition network model, and performing image feature extraction processing using a shallow convolutional neural network; the image feature information is subjected to adaptive two-dimensional position encoding processing, multi-head attention mechanism processing, and position-aware feedforward processing, and the multi-head attention mechanism processing is decomposed into independent subtasks, and the subtasks are executed in parallel to generate a first feature representation; Acquire current character information in the current meter reading image, perform character embedding processing on the current character information to obtain first character information, wherein the character embedding processing is used to map the character information to a high-dimensional vector space; generate predicted text sequence information according to the first feature representation and the first character information; Obtaining a second meter reading, where the acquisition time of the second meter reading and the acquisition time of the meter reading image satisfy a preset time period; When the absolute value of the difference between the first meter reading and the second meter reading is less than or equal to a preset threshold, the first meter reading is determined as a target meter reading.
2. The method according to claim 1, characterized in that: The method further comprises: When the absolute value of the difference between the first meter reading and the second meter reading is greater than a preset threshold, determining the first meter reading as an abnormal meter reading; Perform early warning processing on the abnormal meter reading, and obtain the meter reading image again.
3. A method for training a meter reading determination model, characterized in that: include: Obtaining a meter reading image training set, wherein the meter reading images in the meter reading image training set are labeled images; The meter reading image training set is input into the self-attention text recognition network model, and a shallow convolutional neural network is used to perform image feature extraction processing to obtain image feature information; Performing adaptive two-dimensional position encoding processing, multi-head attention mechanism processing and position-aware feedforward processing on the image feature information, decomposing the multi-head attention mechanism processing into independent subtasks, executing the subtasks in parallel, and generating a first feature representation; Acquire current character information in the current meter reading image, perform character embedding processing on the current character information to obtain first character information, wherein the character embedding processing is used to map the character information to a high-dimensional vector space; Performing position encoding processing on the first character information and the first feature representation to obtain second character information, where the second character information is used to represent the relative position relationship of the current character in the corresponding text sequence; Performing masked multi-head attention mechanism processing, multi-head attention mechanism processing and point feedforward processing on the second character information, decomposing the masked multi-head attention mechanism processing into independent subtasks, executing the subtasks in parallel, and generating a second feature representation; Generate predicted text sequence information according to the first feature representation and the first character information to obtain a meter reading determination model.
4. The method according to claim 3, characterized in that The method further comprises: The second feature representation is mapped using the Line&Softmax function to obtain the predicted text sequence information.
5. A device for determining meter readings, characterized in that: include: An acquisition unit, used for acquiring a meter reading image, wherein the meter reading image includes a meter reading; a processing unit, configured to input the meter reading image into a meter reading determination model, perform meter reading determination processing, and obtain a first meter reading, wherein the meter reading determination model is configured to obtain image feature information by inputting a meter reading image training set into a self-attention text recognition network model, and performing image feature extraction processing using a shallow convolutional neural network; performing adaptive two-dimensional position encoding processing, multi-head attention mechanism processing, and position-aware feedforward processing on the image feature information, decomposing the multi-head attention mechanism processing into independent subtasks, executing the subtasks in parallel, and generating a first feature representation; Acquire current character information in the current meter reading image, perform character embedding processing on the current character information to obtain first character information, wherein the character embedding processing is used to map the character information to a high-dimensional vector space; generate predicted text sequence information according to the first feature representation and the first character information; The acquisition unit is further used to acquire a second meter reading, where the acquisition time of the second meter reading and the acquisition time of the meter reading image meet a preset time period; The processing unit is further configured to, when an absolute value of a difference between the first meter reading and the second meter reading is less than or equal to a preset threshold, determine the first meter reading as a target meter reading.
6. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the computer device implements the method according to any one of claims 1 to 2 and claims 3 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer device, the method according to any one of claims 1 to 2 and claims 3 to 4 is implemented.
Citation Information
Patent Citations
Ammeter reading identification method and device, electronic equipment and storage medium
CN113642582A
Image feature extraction model training method and device, server and storage medium
CN114119997A
Camera direct-reading meter reading method and system
CN114155361A
Electricity consumption data detection method and device, equipment and storage medium
CN115186012A
Ammeter reading processing method and device, cloud, system and medium
CN116863122A
