A method and device for recognizing a dial type water meter reading based on deep learning
By using a deep learning-based digital region detection and correction segmentation algorithm combined with a convolutional neural network to identify water meter readings, the problem of high character segmentation error rate in traditional water meter reading recognition is solved, achieving efficient and accurate automatic water meter reading and supporting the intelligent application of traditional water meters.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGNAN UNIV
- Filing Date
- 2023-05-29
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies for traditional character wheel-type water meter reading recognition suffer from high character segmentation error rates and low recognition efficiency, making it difficult to achieve intelligent water meters.
A deep learning-based approach is adopted to extract digit regions from water meter images through a digit region detection model and a corrective segmentation algorithm. A convolutional neural network is used for reading recognition to avoid character segmentation, and a softmax activation function is combined for data classification.
It improves the accuracy and efficiency of water meter reading identification, reduces the input of manpower and material resources, and promotes the development of smart city water management infrastructure.
Smart Images

Figure CN116778137B_ABST
Abstract
Description
A method and apparatus for recognizing the readings of a wheel-type water meter based on deep learning. Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method and apparatus for recognizing the readings of a wheel-type water meter based on deep learning. Background Technology
[0002] In the construction of smart city infrastructure, the progress of smart city water supply systems has been relatively slow compared to other infrastructure. The annual operating and maintenance costs of urban water supply infrastructure worldwide are already around $100 billion. Smart city water supply systems can improve efficiency and reduce costs, while significantly reducing water waste. For example, smart water meters can be combined with noise loggers to detect and roughly locate leaks in the water supply network based on remote data, and can regulate pressure to reduce water loss when used with automated equipment. However, although smart water meter technology is now quite mature and can provide highly accurate data in real time, the high price of smart water meters means that most users still use traditional rotary meter meters, which are unlikely to be upgraded in the foreseeable future. The prevalence of rotary meter meters makes meter reading extremely tedious and complex. A city still has approximately one million traditional water meters in use, requiring a large number of meter readers to read and record data on-site, resulting in significant manpower and resource consumption. Meanwhile, each meter reader may have to record readings from hundreds or even thousands of water meters every day, making it difficult to guarantee data accuracy. Furthermore, this method of meter reading suffers from problems such as difficulty in data verification, poor data timeliness, and limited data utilization. The existence of traditional water meters significantly hinders the progress of intelligent urban water supply infrastructure. Therefore, there is an urgent need for a reliable method for automatic water meter reading to solve these problems.
[0003] Many traditional algorithms have been proposed for the automatic identification of traditional water meter readings, such as template matching. However, most of these algorithms have poor robustness and struggle to achieve high accuracy in water meter images across various environments. Deep learning algorithms have also been proposed, but most of them only recognize individual characters, requiring segmentation of the water meter reading characters before recognition. This undoubtedly increases the error rate and results in lower accuracy. Summary of the Invention
[0004] Therefore, the technical problem to be solved by the present invention is to provide a method and device for recognizing the readings of a character wheel water meter based on deep learning, so as to overcome the problems of data recognition errors and low recognition efficiency caused by character segmentation when detecting water meter readings in the prior art.
[0005] To address the aforementioned technical problems, this invention provides a deep learning-based method for recognizing the readings of a digit-wheel water meter, comprising the following steps: acquiring an image of the digit-wheel water meter; preprocessing the image and obtaining the location image of the digit region in the image through a digit region detection model; inputting the location image of the digit region into a network model based on a correction segmentation algorithm to correct and segment the location image of the digit region, obtaining a cropped image of the target region; inputting the cropped image of the target region into a digit recognition model after affine transformation; extracting image features through convolutional layers; classifying data using the extracted image features through fully connected layers; generating a 10×Q matrix with columns × rows as the output of the digit recognition model through a softmax activation function; the digit with the highest probability in each row is considered the recognition value, resulting in Q readings as the result of digit-wheel water meter reading recognition.
[0006] Preferably, the digital region detection model is based on the UNet deep learning network and is used to extract digital regions displayed in an image. Its training process uses the mean squared error loss function, the mathematical expression of which is:
[0007]
[0008] Where n is the number of output elements, y i It is the actual value of the i-th output element. It is the predicted value of the i-th output element.
[0009] Preferably, the digital region location image is input into a network model based on a correction and segmentation algorithm to correct and segment the digital region location image. The specific steps are as follows:
[0010] Edge detection is performed on the digital region location image to obtain the edge points of the digital region location, and the minimum bounding rectangle of the edge points and the coordinates of their four vertices are also obtained.
[0011] The minimum bounding rectangle is corrected using a correction algorithm to obtain a new quadrilateral region;
[0012] The mathematical expression for the correction algorithm is as follows:
[0013]
[0014]
[0015] In the above formula, (x i ,y i (i = 1, 2, ..., () are the coordinates of the edge points of the digital region location image, Let S be the coordinates of the four vertices of the minimum bounding rectangle. ij (i = 1, 2, ...; j = 1, 2, 3, 4) is the distance from the i-th edge point to the j-th vertex of the smallest bounding rectangle, d upi and d downi (i = 1, 2, ...) represents the distance from the i-th edge point to the top and bottom edges of the minimum bounding rectangle, ω1 and ω2 are weighting coefficients, ω1 = 0.975, ω2 = 1 - ω1, C ij It is the weighted distance from the i-th edge point to the j-th vertex of the minimum bounding rectangle.
[0016] The digital region position image is cropped and segmented according to the new quadrilateral region to obtain the cropped image of the target region.
[0017] The formula for calculating the vertex coordinates of the new quadrilateral region is as follows:
[0018] C mj =minC ij
[0019] In the above formula, C mj It is the weighted distance from the m-th edge point to the j-th vertex of the minimum bounding rectangle;
[0020] Use (x) m ,y m (i = m() substitution) As one vertex of the corrected quadrilateral, until all four vertices are corrected, forming a new quadrilateral region.
[0021] Preferably, the digit recognition model is based on a convolutional neural network. The network includes three blocks with the same structure. Each block includes two convolution operations using 3×3 convolution kernels and a max pooling operation, with the number of convolution kernels increasing.
[0022] Preferably, the loss function used in the training process of the digit recognition model is the cross-entropy loss function, the mathematical expression of which is:
[0023]
[0024] Where N represents the number of samples, M represents the number of categories, i represents the i-th sample, c represents the c-th category, and y ic It is a sign function; it takes the value 1 if the true class of sample i is c, and 0 otherwise. ic Let be the predicted probability that observed sample i belongs to category c.
[0025] Preferably, the training process of both the digital region detection model and the digital recognition model uses the Adam optimizer to update the network weights.
[0026] Preferably, the fully connected layer uses the extracted feature information for data classification, and the activation function used in the fully connected layer is softmax. The mathematical equation of the softmax activation function is as follows:
[0027]
[0028] Where k represents the number of outputs or categories, and z is the output vector. j is the value of the j-th output or category in z, where i represents the category that needs to be evaluated.
[0029] The present invention also provides a deep learning-based reading recognition device for a wheel-type water meter, comprising:
[0030] The digital region detection module acquires an image of a digit-wheel water meter, preprocesses the image, and obtains the location image of the digital region in the image through a digital region detection model.
[0031] The digital region correction module inputs the digital region location image into a network model based on a correction and segmentation algorithm, corrects and segments the digital region location image, and obtains a cropped image of the target region.
[0032] The digital region reading recognition module inputs a cropped image of the target region into the digital recognition model after affine transformation. It extracts image features through a convolutional layer, classifies the data using the extracted image features through a fully connected layer, and generates a 10×Q matrix with columns × rows through a softmax activation function as the output of the digital recognition model. The digit with the highest probability in each row is considered as the recognition value, and Q readings are obtained as the result of the reading recognition of the digit wheel water meter.
[0033] The technical solution of the present invention has the following advantages compared with the prior art:
[0034] This invention provides a deep learning-based method and apparatus for recognizing the readings of a digit-wheel water meter. It divides the reading problem of a digit-wheel water meter into two parts: digit region detection and reading recognition. A digit region detection model is proposed based on a deep learning network, and a network model based on a correction segmentation algorithm is proposed to correct and segment the predicted digit region location image, thereby obtaining a cropped image of the target region and improving the recognition effect of the subsequent digit recognition model. A digit recognition model for water meter digit recognition is built based on a convolutional neural network, enabling reading recognition without character segmentation. Furthermore, the digit recognition model is small in size, making it easy to deploy on embedded devices to realize the intelligentization of traditional water meters. It can be installed on mobile devices for meter readers or deployed in the cloud for data reading and verification. Therefore, this invention can save a significant amount of manpower and resources consumed in the meter reading process and has the potential to promote the development of smart city water management infrastructure. Attached Figure Description
[0035] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein...
[0036] Figure 1 is a flowchart of a deep learning-based reading recognition method for a water meter based on a character wheel, as proposed in this invention.
[0037] Figure 2 shows the network structure diagram of the digital area detection model for water meters;
[0038] Figure 3 shows the correspondence between the input mask of the water meter digital area detection model and the original image;
[0039] Figure 4 shows the operation flow of the network model based on the corrected segmentation algorithm;
[0040] Figure 5 shows the network structure of the water meter reading recognition model WMRRM.
[0041] Figure 6 shows an example of a test set image for water meter digital area detection;
[0042] Figure 7 shows an example of a water meter reading recognition test set image;
[0043] Figure 8 shows the effect of the correction algorithm;
[0044] Figure 9 shows the overall model recognition effect. Detailed Implementation
[0045] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0046] Referring to Figure 1, which is a flowchart of a deep learning-based reading recognition method for a water meter based on a digital wheel, the method includes the following steps:
[0047] Step S101: Obtain an image of a digit-wheel water meter, preprocess the image of the digit-wheel water meter, and obtain the location image of the digital region in the image of the digit-wheel water meter through a digital region detection model;
[0048] First, in order to input the water meter image into the detection model, the image needs to be resized to 512 pixels × 512 pixels × 3 (length × width × number of channels).
[0049] Referring to Figure 2, which shows the network structure of a water meter digital area detection model, a UNet network encoding and decoding framework, the left half of the network downsamples the input image to extract image features, while the right half upsamples the feature map to restore the image size. This embodiment modifies the convolutional layers of the UNet network. The UNet network uses 3×3 convolutional kernels with "same" padding, followed by batch normalization layers and a ReLU activation function. The downsampling operation uses max pooling with a 2×2 pooling window and a stride of 2. The upsampling method uses transposed convolution. UNet incorporates skip connections in each upsampling stage to fuse feature maps from corresponding positions in the encoder channels. By combining low-level and high-level features, the network can retain high-resolution detail information contained in the high-level feature maps, thereby improving the accuracy of image segmentation.
[0050] The training process of the detection network uses the mean squared error loss function. When the value of the loss function is minimized, the predicted value is closest to the true value. During training, the Adam (Adaptive Moment Estimation) optimizer is used to update the network weights. The mathematical expression of the loss function is:
[0051]
[0052] In the above formula, n is the number of output elements, and y i It is the actual value of the i-th output element. It is the predicted value of the i-th output element;
[0053] In this embodiment of the invention, the detection model is trained using a self-built dataset containing over 4000 labeled PNG images, resulting in a network model file in .h5 format. Specific information about this detection model is shown in Table 1.
[0054] Table 1 Information on the digital area detection model for water meters
[0055]
[0056] Referring to Figure 3, which shows the correspondence between the input mask and the original image of the water meter digital area detection model, the input of the detection model is a 512×512×3 water meter image, and the output is a 512×512×3 mask image. The white area in the mask is the detected water meter digital area, and the black area is the irrelevant area.
[0057] Step S102: Input the digital region location image into the network model based on the correction segmentation algorithm, correct and segment the digital region location image to obtain the cropped image of the target region;
[0058] Referring to Figure 4, which illustrates the operation flow of the network model based on the corrected segmentation algorithm, the specific steps are as follows:
[0059] Step S401: Perform edge detection on the digital region location image to obtain the edge points of the digital region location, and simultaneously obtain the minimum bounding rectangle of the edge points and the coordinates of their four vertices;
[0060] First, edge detection is used to obtain the edge points of the white area in the mask, that is, to obtain the edge points of the target area, and at the same time, the coordinates of the minimum bounding rectangle of these edge points (the coordinates of the four vertices of the rectangle) are obtained.
[0061] However, due to the angle of the water meter image during shooting, the digital area will be tilted. Therefore, directly using the rectangle for cropping will result in the cropped digital area containing too many irrelevant areas and being significantly tilted, which is not conducive to the next step of reading recognition. Therefore, a correction algorithm is proposed to further correct the minimum bounding rectangle.
[0062] Step S402: Use a correction algorithm to correct the minimum bounding rectangle to obtain a new quadrilateral region;
[0063] The mathematical expression for the correction algorithm is as follows:
[0064]
[0065]
[0066] In the above formula, (x i ,y i (i = 1, 2, ...) are the coordinates of the edge points of the white area output by the mask in Figure 3. (j=1,2,3,4) are the coordinates of the four vertices of the minimum bounding rectangle, S ij (i = 1, 2, ...; j = 1, 2, 3, 4) is the distance from the i-th edge point to the j-th vertex of the smallest bounding rectangle, d upi and d downi (i = 1, 2, ...) represents the distance from the i-th edge point to the top and bottom edges of the minimum bounding rectangle, ω1 and ω2 are weighting coefficients, ω1 = 0.975, ω2 = 1 - ω1, C ij It is the weighted distance from the i-th edge point to the j-th vertex of the minimum bounding rectangle;
[0067] Using the above calculation method, when j = 1, 2, 3, 4, the vertex coordinates of the new quadrilateral region are calculated using the following formula:
[0068] C mj =minC ij
[0069] Among them, C mj This represents the weighted distance from the m-th edge point to the j-th vertex of the minimum bounding rectangle;
[0070] Then use (x) m ,y m (i = m() substitution) As one vertex of the corrected quadrilateral, until all four vertices are corrected, a new quadrilateral region is obtained.
[0071] Step S403: Crop and segment the digital region position image according to the new quadrilateral region to obtain the cropped image of the target region;
[0072] Step S103: The cropped image of the target region is input into the digit recognition model after undergoing an affine transformation, generating a 10×Q matrix as the model output;
[0073] The cropped image of the target area is transformed by affine transformation to produce a 60-pixel × 200-pixel JPG image;
[0074] The digital recognition model is based on a convolutional neural network. The input and output of this model take into account the characteristics of the water meter's digital area being rectangular and the reading being 5 digits. At the same time, it can recognize the reading without character segmentation.
[0075] The network structure of the model is shown in Figure 5. Figure 5 is the network structure diagram of the water meter reading recognition model WMRRM. The main part of the network includes three blocks with the same structure (Conv2, Conv3, Conv4). Each block includes two convolution operations using 3×3 convolution kernels and one max pooling operation. The number of convolution kernels increases. Conv5 is a convolution operation with 1×1 convolution kernels. After the convolutional layers extract features, the fully connected layers perform classification. The activation function is the Softmax function. Softmax is often used for multi-class classification tasks. It transforms all input values to the range (0,1) while ensuring that the sum of all outputs is equal to 1. Its output can be interpreted as a probability distribution. The mathematical equation of Softmax is as follows:
[0076]
[0077] Where k represents the number of outputs or categories, and z is the output vector. j It is the value of the j-th output or category in z, where i represents the category that needs to be evaluated. The category with the highest probability is the predicted category.
[0078] To prevent overfitting, a Dropout layer is introduced after Conv2, Conv3, Conv4, and Conv5. This network takes a 60×200 digit display image as input and produces a 10×5 matrix as output, where each column corresponds to a reading and each row represents one of the ten digits 0-9. The digit with the highest probability is considered the recognition value. The recognition network uses the cross-entropy loss function, and the Adam optimizer is used to update the network weights during training. Its mathematical expression is:
[0079]
[0080] Where N represents the number of samples, M represents the number of categories, i represents the i-th sample, c represents the c-th category, and y ic It is a sign function; it takes the value 1 if the true class of sample i is c, and 0 otherwise. ic Let i be the predicted probability that observed sample i belongs to category c;
[0081] The digit recognition model was trained using a self-built dataset containing over 11,000 labeled JPG images of water meter digit regions. The trained model was then generated as a .h5 file. Specific information about the model is shown in Table 2.
[0082] Table 2 Information on Water Meter Reading Recognition Model
[0083]
[0084] By calling this digital recognition model and taking the cropped 60×200 image of the water meter's digital area as input, the water meter reading recognition result can be obtained.
[0085] Finally, by connecting the three parts of water meter digital area detection, correction, and water meter reading recognition, end-to-end recognition of the readings of the digit wheel water meter can be achieved.
[0086] Referring to Figures 6 and 7, Figure 6 shows an example of a test set image for water meter digital area detection, and Figure 7 shows an example of a test set image for water meter reading recognition. Through training with a large amount of data, we obtained a water meter digital area detection model and a water meter reading recognition model. We tested these two models on a test set, which contains original images of water meters. These images come from the actual meter reading process of water meters in a certain city. This test set is very close to the actual water meter images and has strong representativeness.
[0087] First, the water meter digital region detection model was called and tested on a test set containing 500 original images. The test results are shown in Table 3. During the test, FCN-8s (Fully Convolutional Network-8s) was used as a control group.
[0088] Table 3 Test results of the detection model
[0089]
[0090] The detection model based on UNet, combined with the correction algorithm, achieved a maximum accuracy of 98.20%. Of the 499 successfully detected target regions, 491 were accurately segmented. Ablation experiments and comparisons were conducted. Experiments without the proposed correction algorithm resulted in reduced segmentation accuracy, and many images could not be accurately segmented.
[0091] Referring to Figure 8, which is a diagram showing the effect of the correction algorithm, the experimental results prove that the correction algorithm proposed in this application is effective. The correction algorithm improves the accuracy of the detection method based on UNet by 2.4% and the detection method based on FCN-8s by 2.2%, which intuitively illustrates the effectiveness of the correction algorithm in correcting the tilt of the target area and removing irrelevant areas, thereby improving the recognition effect of the subsequent recognition model.
[0092] Compared to FCN-8s, UNet exhibits higher detection accuracy and consumes less memory under the same conditions, which is beneficial for deployment on embedded devices. After conducting extensive experiments, it was found that the average inference time of the two models is similar, and the training time of UNet and FCN-8s was also found to be almost the same under the same training set size and number of training epochs.
[0093] The water meter reading recognition model was tested on a test set containing 2000 images. These images were all 60×200 pixels representing the digital areas of water meters and included inverted images. VGG16 (Visual Geometry Group Network) was used as a control group. Considering practical applications, only correctly identifying the entire water meter reading sequence was considered a correct result. The test results of the recognition model are shown in Table 4.
[0094] Table 4 Test results of the recognition model
[0095]
[0096] Here, 1 error accuracy indicates the case where the last digit of a digit region is half a digit and is identified as another digit, while 0 error accuracy indicates the accuracy of being completely correct. As shown in Table 4, the WMRRM proposed in this invention achieves higher accuracy than VGG16 on this dataset and can recognize inverted images. In addition, WMRRM is more than 100 times smaller in size and has a shorter inference time than VGG16, which helps to deploy the recognition model on embedded devices. This provides a practical solution for the automatic meter reading of traditional wheel water meters.
[0097] Referring to Figure 9, which shows the overall model recognition effect, the three processes of detection, correction, and recognition are connected to complete the automatic reading recognition of the counter-type water meter.
[0098] In summary, to address the problems of cumbersome steps, difficulty in data verification, and low recognition accuracy in existing water meter reading detection and recognition methods, this invention proposes a deep learning-based method and device for recognizing readings of wheel-type water meters. The reading problem of wheel-type water meters is divided into two parts: water meter digit area detection and reading recognition. A digit area detection model is proposed based on a deep learning network, and a network model based on a correction segmentation algorithm is proposed to correct and segment the predicted digit area location image, thereby obtaining a cropped image of the target area, improving the recognition effect of the subsequent digit recognition model. A digit recognition model for water meter digit recognition is built based on a convolutional neural network, enabling reading recognition without character segmentation. Simultaneously, the digit recognition model is small in size, facilitating deployment on embedded devices to achieve intelligent operation of traditional water meters. It can be installed on mobile devices for meter readers or deployed in the cloud for data reading and verification, saving significant manpower and resources consumed in the meter reading process.
[0099] The present invention also provides a deep learning-based reading recognition device for a wheel-type water meter, the specific device comprising:
[0100] Digital region detection module: acquires an image of a digit-wheel water meter, preprocesses the image of the digit-wheel water meter, and obtains the location image of the digital region in the image of the digit-wheel water meter through a digital region detection model;
[0101] Digital region correction module: Input the digital region location image into a network model based on a correction and segmentation algorithm, correct and segment the digital region location image to obtain a cropped image of the target region;
[0102] Digital region reading recognition module: The cropped image of the target region is input into the digital recognition model after affine transformation. Image features are extracted through convolutional layers, and data classification is performed using the extracted image features through fully connected layers. A matrix of 10×Q columns and rows is generated by the softmax activation function as the output of the digital recognition model. The number with the highest probability in each row is considered as the recognition value, and Q readings are obtained as the result of the reading recognition of the digit wheel water meter.
[0103] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0104] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more flowchart illustrations and / or one or more block diagrams.
[0105] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0106] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0107] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for recognizing the readings of a wheel-type water meter based on deep learning, characterized in that, The steps include: acquiring an image of a digit-type water meter, preprocessing the image of the digit-type water meter, and obtaining the location image of the digital region in the image of the digit-type water meter through a digital region detection model; The digital region location image is input into a network model based on a correction segmentation algorithm. The digital region location image is then corrected and segmented to obtain a cropped image of the target region. This includes: performing edge detection on the digital region location image to obtain the edge points of the digital region location, and simultaneously obtaining the minimum bounding rectangle of the edge points and the coordinates of its four vertices; using a correction algorithm to correct the minimum bounding rectangle to obtain a new quadrilateral region; the mathematical expression of the correction algorithm is: , ,in, ( ) are the coordinates of the edge points of the digital region location image. Let the coordinates of the four vertices of the minimum bounding rectangle be given. It is the first The edge point to the first The distance between the vertices of the smallest bounding rectangle and It is the first The distance from each edge point to the top and bottom edges of the smallest bounding rectangle. and These are weighting coefficients. , , It is the first The edge point to the minimum bounding rectangle's th edge point The weighted distance between each vertex; the formula for calculating the vertex coordinates of the new quadrilateral region is as follows: ,in, It is the first The edge point to the minimum bounding rectangle's th edge point The weighted distance of each vertex, using ( ) replacement As one vertex of the corrected quadrilateral, until all four vertices are corrected, a new quadrilateral region is formed; the digital region position image is cropped and segmented according to the new quadrilateral region to obtain the cropped image of the target region; the cropped image of the target region is input into the digital recognition model after affine transformation, the image features are extracted through convolutional layers, the fully connected layers use the extracted image features to classify the data, and a column × row 10 × Q matrix is generated by the softmax activation function as the output of the digital recognition model. The digit with the highest probability in each row is considered as the recognition value, and Q readings are obtained as the result of the reading recognition of the digit wheel water meter.
2. The deep learning-based reading recognition method for wheel-type water meters according to claim 1, characterized in that, The digital region detection model is based on the UNet deep learning network and is used to extract digital regions displayed in images. Its training process uses a mean squared error loss function, the mathematical expression of which is: Where n is the number of output elements. It is the actual value of the i-th output element. It is the predicted value of the i-th output element.
3. The deep learning-based reading recognition method for wheel-type water meters according to claim 1, characterized in that... The digit recognition model is based on a convolutional neural network. The network consists of three blocks with the same structure. Each block includes two convolution operations using 3×3 convolution kernels and a max pooling operation. The number of convolution kernels increases incrementally.
4. The deep learning-based reading recognition method for wheel-type water meters according to claim 1, characterized in that, The digit recognition model uses the cross-entropy loss function during its training process, and its mathematical expression is: Where N represents the number of samples and M represents the number of categories. Indicates the first One sample, Indicates the first Categories It is a sign function, if the sample The true category is If the result is positive, then take 1; otherwise, take 0. For observation samples Category The predicted probability.
5. The deep learning-based reading recognition method for wheel-type water meters according to claim 1, characterized in that, The training process for both the digital region detection model and the digital recognition model uses the Adam optimizer to update the network weights.
6. The deep learning-based reading recognition method for wheel-type water meters according to claim 1, characterized in that, The fully connected layer of the digit recognition model uses the extracted feature information to classify data. The activation function used in the fully connected layer is softmax, and the mathematical equation of the softmax activation function is as follows: ,in, Indicates the number of outputs or categories. It is the output vector. yes The Middle The value of an output or category. This indicates the category that needs to be evaluated.
7. A deep learning-based reading recognition device for a water meter with a dial wheel, characterized in that, include: The digital region detection module acquires an image of a digit-wheel water meter, preprocesses the image, and obtains the location image of the digital region in the image through a digital region detection model. The digital region correction module inputs the digital region location image into a network model based on a correction segmentation algorithm, corrects and segments the digital region location image to obtain a cropped image of the target region, including: performing edge detection on the digital region location image to obtain the edge points of the digital region location, and simultaneously obtaining the minimum bounding rectangle of the edge points and the coordinates of its four vertices; using the correction algorithm to correct the minimum bounding rectangle to obtain a new quadrilateral region; the mathematical expression of the correction algorithm is: , ,in, ( ) are the coordinates of the edge points of the digital region location image. Let the coordinates of the four vertices of the minimum bounding rectangle be given. It is the first The edge point to the first The distance between the vertices of the smallest bounding rectangle and It is the first The distance from each edge point to the top and bottom edges of the smallest bounding rectangle. and These are weighting coefficients. , , It is the first The edge point to the minimum bounding rectangle's th edge point The weighted distance between each vertex; the formula for calculating the vertex coordinates of the new quadrilateral region is as follows: ,in, It is the first The edge point to the minimum bounding rectangle's th edge point The weighted distance of each vertex, using ( ) replacement As one vertex of the corrected quadrilateral, until all four vertices are corrected, a new quadrilateral region is formed; the digital region position image is cropped and segmented according to the new quadrilateral region to obtain the cropped image of the target region; the digital region reading recognition module inputs the cropped image of the target region into the digital recognition model after affine transformation, extracts image features through convolutional layers, classifies data using the extracted image features through fully connected layers, and generates a column × row 10 × Q matrix as the output of the digital recognition model through the softmax activation function. The digit with the highest probability in each row is considered as the recognition value, and Q readings are obtained as the result of the reading recognition of the digit wheel water meter.
Citation Information
Patent Citations
Official seal character recognition method, system and equipment based on deep learning and storage medium
CN113378821A
Omnidirectional and any-digit water meter reading detection and identification method
CN113902035A