Character wheel type water meter reading identification method and system using Meter-YOLO model
Through the Meter-YOLO model, the multi-scale hole attention mechanism, Slim-Neck structure and GIoU loss function are used to solve the problem of insufficient accuracy and robustness in word wheel water meter reading recognition, achieving more efficient recognition effects and Lower computational complexity, suitable for diversified water meter image recognition.
Patent Information
- Application Number
- CN202410709722.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has problems of insufficient accuracy, speed and robustness in the recognition of wheel-type water meter readings, especially in the face of dust, tilt and other interferences. The deep learning model has poor detection accuracy and computational complexity. There is also room for improvement.
The Meter-YOLO model is used, which is based on the improvement of the YOLOv8 model. It uses the multi-scale hole attention mechanism, Slim-Neck structure and GIoU loss function to improve the accuracy of feature extraction and bounding box regression, and adapts to different angles, brightness and models. Water meter image recognition.
It improves the accuracy, speed and robustness of word wheel water meter reading recognition, reduces the computational complexity of the model, is suitable for practical application scenarios with limited resources, reduces false detections and missed detections, and provides a more comprehensive Similarity measurement method.
Smart Images

Figure CN118629047A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of character wheel type water meter reading recognition, and in particular to a character wheel type water meter reading recognition method and system using a Meter-YOLO model. Background Art
[0002] Water meters are one of the main instruments for measuring water supply in various industries, including residential, hotel, restaurant and other civil industries as well as a wide range of industrial fields. Among them, mechanical water meters are roughly divided into two types: one is a pointer-type water meter with multiple dials, which requires reading the pointer readings in multiple dials and multiplying the range of each dial to obtain the reading result; the other is a wheel-type water meter (also known as a wheel-type mechanical water meter) with a digital display in the form of a wheel, and the current reading of the water meter is obtained by reading the numbers in the wheel area.
[0003] In recent years, many image-based automatic meter reading (AMR) methods have been proposed for the recognition of the readings of wheel-type water meters. Although traditional methods can achieve certain results in the detection and recognition of the readings of wheel-type water meters with images as input data, they have limitations in terms of accuracy, speed and robustness. In actual application scenarios, interference such as dust and tilt will have a great impact on the recognition results, and therefore cannot achieve the expected effect.
[0004] In addition, with the development of computer computing power, deep learning technology has gradually been applied to the reading recognition of wheel-type water meters, including deep network models such as ResNet and YOLO. Deep learning technology uses complex network structures to learn the features in water meter images and use these features to recognize water meter character readings. However, the existing deep learning models used for wheel-type water meter reading recognition still have a lot of room for improvement in detection accuracy, model false detection, missed detection, and computational complexity. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] In view of the deficiencies in the prior art, the present invention provides a method and system for recognizing readings of a wheel-type water meter using a Meter-YOLO model, which can solve the above technical problems.
[0007] (II) Technical solution
[0008] In order to solve the above technical problems, the present invention provides the following technical solution: a method for recognizing the readings of a wheel-type water meter using a Meter-YOLO model, comprising the following steps:
[0009] S1: Collect multiple different wheel-type water meter images;
[0010] S2: Use multiple wheel-type water meter images to create a wheel-type water meter dataset;
[0011] S3: labeling each wheel-type water meter image in the wheel-type water meter dataset;
[0012] S4: The Meter-YOLO model is further trained using the wheel-type water meter dataset to realize the reading recognition of the wheel-type water meter image, wherein the Meter-YOLO model is an improvement based on the YOLOv8 model.
[0013] Preferably, the wheel-type water meter data set includes wheel-type water meter images with different shooting angles, different brightness and different models.
[0014] Preferably, the Meter-YOLO model includes a backbone network, a feature fusion structure and a detection head. A multi-scale hole attention mechanism is embedded at the end of the backbone network of the Meter-YOLO model. The Meter-YOLO model uses the backbone network to extract image features of the wheel-type water meter image to output multiple different feature maps.
[0015] Preferably, the feature fusion structure of the Meter-YOLO model adopts a Slim-Neck structure, and the Meter-YOLO model uses the feature fusion structure to fuse features of multiple different feature maps.
[0016] Preferably, the Meter-YOLO model uses the detection head to perform bounding box regression and character prediction classification on the feature map after feature fusion to realize water meter reading recognition, and the detection head uses GIoU loss for bounding box regression.
[0017] In order to solve the above technical problems, the present invention provides another technical solution as follows: a wheel-type water meter reading recognition system using a Meter-YOLO model, comprising:
[0018] An image acquisition module, used for acquiring a plurality of different wheel-type water meter images;
[0019] A data set making module, used for making a data set of a water meter using a plurality of water meter images;
[0020] An image annotation module, used to annotate each image of a wheel-type water meter in a wheel-type water meter dataset;
[0021] The model training module is used to further train the Meter-YOLO model using the wheel-type water meter dataset to realize the reading recognition of the wheel-type water meter image, wherein the Meter-YOLO model is an improvement based on the YOLOv8 model.
[0022] Preferably, the image acquisition module is installed on a wheel-type water meter in an actual production environment.
[0023] Preferably, the image acquisition module includes a camera module and an upload module, the camera module is used to capture and acquire the image of the wheel-type water meter, and the upload module is used to upload the image of the wheel-type water meter to the data set production module.
[0024] Preferably, the image annotation module is Labelme annotation software.
[0025] Preferably, the Meter-YOLO model includes a backbone network, a feature fusion structure and a detection head.
[0026] (III) Beneficial effects
[0027] Compared with the prior art, the present invention provides a method and system for identifying readings of a wheel-type water meter using a Meter-YOLO model, which has the following beneficial effects: the present invention uses the Meter-YOLO model to identify readings of a wheel-type water meter, and the Meter-YOLO model is an improvement based on the YOLOv8 model. Compared with the prior art, the present invention can improve the accuracy, speed, and robustness of identifying readings of a wheel-type water meter, and better adapt to various practical application scenarios of the wheel-type water meter. The recognition of the readings of the wheel-type water meter can be performed more effectively. While ensuring high precision, it is also suitable for practical application scenarios with limited resources, and provides an effective solution for improving the accuracy of reading recognition, effectively improving detection accuracy and effectively reducing model false detection, missed detection, and other phenomena. The Meter-YOLO model of the present invention can enhance the information flow of the feature extraction network while ensuring the overall lightweight of the network, effectively reducing the computational complexity of the model, and providing a more comprehensive similarity measurement method for the application scenario of the wheel-type water meter reading recognition that requires positioning accuracy, thereby improving the model missed detection and wrong detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a flowchart of the steps of the method for recognizing the readings of a wheel-type water meter using the Meter-YOLO model of the present invention;
[0029] Figure 2 It is a structural diagram of the Meter-YOLO model of the present invention;
[0030] Figure 3 It is a structural diagram of the MSDA module of the Meter-YOLO model of the present invention;
[0031] Figure 4 It is a Slim-Neck structure diagram of the Meter-YOLO model of the present invention;
[0032] Figure 5It is a structural diagram of the GSConv module of the Meter-YOLO model of the present invention;
[0033] Figure 6 It is a structural diagram of the GS bottleneck module of the Meter-YOLO model of the present invention;
[0034] Figure 7 It is a structural diagram of the VoV-GSCSP module of the Meter-YOLO model of the present invention;
[0035] Figure 8 It is a curve change diagram of various indicators in the model training process of the present invention;
[0036] Fig. 9 This is a prototype of a digital wheel water meter and a picture of its actual installation environment;
[0037] Fig.10 A part of the wheel-type water meter images in the wheel-type water meter data set of the present invention;
[0038] Fig.11 It is a neural network structure diagram;
[0039] Fig.12 The figure is a functional block diagram of the character wheel type water meter reading recognition system using the Meter-YOLO model of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] The present invention provides a method for recognizing readings of a wheel-type water meter using a Meter-YOLO model, comprising the following steps:
[0042] S1: Collect multiple different wheel-type water meter images.
[0043] The digit wheel type water meter is a digit wheel type mechanical water meter. The digit wheel type water meter adopts a digit wheel type digital display. The reading of the digit wheel type water meter is obtained by identifying the reading of each digit wheel.
[0044] S2: Use multiple wheel-type water meter images to create a wheel-type water meter dataset.
[0045] S3: Label each wheel-type water meter image in the wheel-type water meter dataset.
[0046] Preferably, a camera module and an upload module can be installed at the meter end of the wheel-type water meter in the actual production environment to shoot and compress the uploaded wheel-type water meter image to prepare a data set, and the wheel-type water meter image can be annotated with a wheel boundary box and a wheel reading through Labelme annotation software.
[0047] Specifically, we selected 16,488 water meter images of more than 20 types and annotated them to facilitate full testing and evaluation of the model. In addition, we took into account the continuity of water meter readings during the acquisition process to avoid repeatedly taking images of water meters with the same readings, and randomly selected water meter images of different dates and time periods. Fig. 9 The figure shows the prototype of the digital wheel water meter and its installation environment. Fig.10 Shown are some images of the digit-wheel water meter in the digit-wheel water meter dataset.
[0048] Preferably, the wheel-type water meter images in the wheel-type water meter dataset of the present invention not only cover wheel-type water meters of various specifications and styles, but also have the following challenges and data diversity:
[0049] (1) Interference of water meter working environment on identification
[0050] The digit wheel type water meter is usually installed in a relatively concealed, insufficiently lit and high humidity environment, such as underground pipes, under manhole covers or in wall corners. The dim light or reflection caused by these conditions, dew or blur caused by humidity and other phenomena will introduce additional interference factors during shooting, bringing considerable challenges to the recognition task, so that the present invention can be better applied to the digit wheel type water meter reading recognition in actual environments.
[0051] (2) Challenges of “half-character” recognition
[0052] In the daily operation of the wheel-type mechanical water meter, the water meter wheel may stay between two numbers, which leads to the so-called "half-character" situation. By adding half-characters and other incompletely displayed characters to the wheel-type water meter data set, the present invention can more correctly interpret the values displayed by the half-characters.
[0053] (3) Diversity of shooting angles and wheel styles
[0054] The shooting angle of the word wheel water meter may vary depending on the installation location, resulting in the angle tilt or perspective distortion of the characters in the image; in addition, there are also word wheel water meter images with different brightness. In addition, water meters of different manufacturers and different models also have differences in word wheel styles, such as font size, shape, color, quantity configuration of the word wheel, etc. The word wheel water meter dataset of the present invention includes the diversity of the above different water meters to ensure that the Meter-YOLO model can learn and adapt to recognition in various practical situations.
[0055] (4) External obstruction and impurities
[0056] The image of the wheel-type water meter may contain external obstructions caused by the installation environment or operation, such as dust, rust and other impurities on the water meter glass.
[0057] The wheel-type water meter dataset of the present invention includes wheel-type water meter images with the above-mentioned challenging factors, which can make the training and testing process of the Meter-YOLO model of the present invention closer to the actual application scenario, so as to improve the generalization ability and robustness of the model; constructing a diverse wheel-type water meter dataset is to ensure that the wheel-type mechanical water meter reading recognition model constructed by the present invention has high accuracy and practicality, and shows excellent recognition performance in actual industrial environments.
[0058] In addition, for the preparation of the word wheel water meter data set, 67% of the images in the word wheel water meter data set can be randomly selected to train the Meter-YOLO model, and the other 33% are used for model verification and testing. The structure of the word wheel water meter data set can be specifically shown in Table 1 below:
[0059] Table 1 Structure of the wheel water meter dataset
[0060]
[0061] S4: The Meter-YOLO model is further trained using the wheel-type water meter dataset to realize the reading recognition of the wheel-type water meter image, wherein the Meter-YOLO model is an improvement based on the YOLOv8 model.
[0062] Neural Network is a deep learning architecture inspired by biological neural systems and designed for processing data with grid-like topology (such as images). This neural network forms a complex network structure by stacking linear and nonlinear transformation operations layer by layer, and the operation of each layer is regarded as a hierarchical operation in the network. Traditional neural networks generally include an input layer for receiving data to be processed; a hidden layer for learning and extracting representative features from the input data; and an output layer for mapping these features into specific inference results to complete the overall inference task (LeCun et al., 1998). The structure of a neural network is as follows: Fig.11 shown.
[0063] With the rapid development of neural network technology, convolutional neural network (CNN) has gradually emerged and is widely used in the field of image recognition. CNN consists of multiple different layers, including input layer, convolution layer and pooling layer, as well as a fully connected layer at the end of the network. The core operations of CNN when processing data include local receptive field, pooling and weight sharing mechanisms, which significantly reduce the number of model parameters and help prevent overfitting.
[0064] The convolution layer plays a vital role in CNN. Its main function is to calculate the convolution of the local area of the input with the convolution kernel. Unlike other neural networks that use weight matrices, CNN uses the weights of the convolution kernel to slide on the image to extract features. This can generate feature maps that highlight the characteristics of the input data. The convolution operation includes two filling methods, "VALID" and "SAME". "VALID" does not fill the edges of the image, resulting in a reduction in the size of the final feature map, while "SAME" keeps the size of the output feature map unchanged by properly filling the edges of the image. Immediately following the convolution layer is the pooling layer, which reduces the spatial resolution of the feature map by applying a filter window to it. Average pooling and maximum pooling are two widely used pooling techniques, which take the average or maximum value of the convolution area as the output, respectively, in order to achieve the purpose of feature dimensionality reduction and displacement invariance (Sermanet et al., 2013).
[0065] At the end of the CNN, the fully connected layer is similar to the layers in the traditional multi-layer perceptron. It receives all the activations of the previous layer as input, and performs nonlinear mapping by weighted summing them, combined with the activation function, to complete classification or other complex reasoning tasks. The activation function (Hao et al., 2020) can give the network nonlinear expression capabilities, improve the mapping ability of the neural network between input and response variables, enable it to better fit the results and thus improve accuracy.
[0066] YOLO (You Only Look Once) is a series of groundbreaking object detection networks, whose advantage is that it can achieve real-time object detection while maintaining high accuracy. YOLO transforms the problem of object detection into a regression problem, directly predicting bounding boxes and category probabilities in a single neural network. Compared with traditional object detection methods, YOLO does not require a separate region extraction step. It divides the image into grids, and each grid cell is responsible for predicting the object whose center falls within the cell. Each version of YOLO has tried to balance the accuracy and speed of detection, including continuous optimization and improvement of the bounding box prediction mechanism, network architecture, and training strategy. In 2015, YOLOv1 first proposed to convert the object detection task directly into a regression problem, predicting bounding boxes and classifications in one step. In 2016, YOLOv2 (also known as YOLO9000) added batch normalization to YOLOv1, used anchors to improve accuracy, and supported the detection of images of different sizes. In 2018, YOLOv3 further added multi-scale detection and a deeper network structure, which further improved the detection accuracy and speed. In 2020, YOLOv4 and YOLOv5 (Zhu et al., 2021) continued to optimize speed and accuracy, introduced new training techniques and a new network architecture called CSPNet to improve previous versions, and provided more powerful feature extraction capabilities and detection effects.
[0067] The YOLOv8 model on which the present invention is based was launched in 2023 (Reis et al., 2023), which represents the latest progress in the YOLO series; compared with the traditional visual detection method, the YOLO model, a target detection algorithm based on deep learning, can predict and classify different wheel images detected in the water meter, that is, recognize the wheel readings, and can also provide position information such as the wheel bounding box at the same time, which is a function that traditional visual detection cannot achieve. The YOLOv8 model is mainly composed of three parts: a backbone network (Backbone) for extracting image features, a connection part (Neck) for fusing multi-layer features, i.e., a feature fusion structure, and a head (Head) for outputting classification and positioning predictions, i.e., a detection head. Considering the multi-scale characteristics of objects, three scale detection heads are used to adapt to targets of different scales.
[0068] The Meter-YOLO model of the present invention is based on YOLOv8 as the basic model, and improves and optimizes the YOLOv8 model from three perspectives: attention mechanism, feature fusion and loss function. That is, the Meter-YOLO model also includes a backbone network, a feature fusion structure and a detection head. For the small-size feature map of the wheel-type water meter image, the Meter-YOLO model of the present invention embeds a multi-scale hole attention mechanism at the end of the backbone network to optimize the feature extraction performance of the backbone network, and splices the output feature maps of three different scales into a Slim-Neck module for feature fusion. Finally, the GIoU loss function is used in the multi-scale detection head to optimize the similarity calculation of the bounding box (i.e., the border, i.e., the wheel-type bounding box) regression. The structure of the Meter-YOLO model is as follows: Figure 2 As shown:
[0069] (1) The present invention embeds a multi-scale void attention mechanism (module) into the backbone network CSPDarknet53 of the YOLOv8 model. This attention mechanism can enhance the information flow of the feature extraction network while ensuring the overall lightweight of the network.
[0070] (2) In order to maintain model accuracy and reduce latency and computing resource consumption, and optimize the computational cost of the reading recognition model, the Meter-YOLO model of the present invention uses a Slim-Neck structure in the feature fusion structure to replace the PAN-FPN structure in the YOLOv8 model. The Slim-Neck structure fuses the three different levels of feature representations B3-B5 extracted from the backbone network and reuses the feature information, effectively reducing the computational complexity of the model.
[0071] (3) In the two independent branches of the detection head, the present invention adopts the GIoU loss function for the bounding box prediction regression task of the wheel-type water meter to perform calculations, providing a more comprehensive similarity measurement method for the wheel-type water meter reading recognition application scenario that requires positioning accuracy, thereby improving the model's missed detection and false detection situations.
[0072] The following further describes the Meter-YOLO model of the present invention in detail from the aspects of attention mechanism, feature fusion and loss function.
[0073] 1. Attention Mechanism:
[0074] In the specific application scenario of wheel-type mechanical water meter reading recognition, the main challenge lies in identifying and detecting wheel-type digital characters from complex backgrounds. As a convolutional neural network (CNN) model, YOLOv8 is famous for its powerful feature extraction and fast detection capabilities, but it is essentially local processing and cannot obtain the relationship between global features. This is especially true when dealing with a lot of complex and irrelevant character information on the water meter dial. CNN may not be able to effectively distinguish the subtle differences between numbers and backgrounds on a global scale. Compared with the traditional CNN model, the Transformer-based model can use its attention mechanism to capture the dependencies between any pixels on a global scale, thereby effectively improving recognition accuracy.
[0075] The working principle of the attention mechanism is as follows: First, by encoding the input data sequence, we get [x1, x2, x3, ..., x T Then, through the linear transformation matrix W Q , W K , W V We obtain three matrices of query Q, key K, and value V. We calculate the dot product between the query Q and the corresponding key, normalize it, and finally multiply it with the matrix V to get the weighted sum. Prevent the gradient of the result from disappearing, where represents the dimension of the matrix K. The attention formula is shown in the following formula (1):
[0076]
[0077] However, there is a key problem with the traditional attention mechanism, which is that it will bring high computational complexity and large memory consumption. The introduction of such a mechanism may seriously occupy hardware resources and affect the inference speed of the model. In order to alleviate this resource burden, some researchers have proposed the concept of sparsity (Child et al., 2019), that is, to reduce the consumption of the attention mechanism by reducing the number of key-value pairs calculated. Based on these considerations, a series of sparsity-based attention variants have been developed, such as local attention (Luong et al., 2015), deformable attention (Zhu et al., 2020) and hollow attention (Yang et al., 2022). Although these methods provide improvements in computation and memory usage, they are usually based on artificially set static modes and cannot dynamically adjust sparsity according to changes in content. To solve these problems, the present invention introduces the multi-scale hollow attention (MSDA) mechanism (Jiao et al., 2023). The core idea of MSDA is to apply self-attention at different scales, which can not only capture local features, but also capture long-range dependencies through a larger hollow receptive field. Compared with other attention mechanisms, the advantages of MSDA are:
[0078] (1) Multi-scale design: MSDA sets different dilation coefficients in different heads, allowing the network to adaptively focus on different scales when learning specific character features, and to perform more refined division and focused processing of key features.
[0079] (2) Computational efficiency: MSDA uses a dilated attention operation, which is similar to a dilated convolution. It can increase the receptive field without reducing the resolution of the feature map. At the same time, due to its sparsity, it can reduce unnecessary global calculations and improve computational efficiency.
[0080] (3) Dynamic sparsity: MSDA dynamically performs self-attention calculations on key patches in the surrounding area through a sliding window hole attention (SWDA) operation. Compared with some local attention models, MSDA can adapt to image content more flexibly instead of being simply restricted to a fixed-size neighborhood.
[0081] The structure of MSDA is as follows Figure 3 As shown, MSDA first receives an input feature Figure X , through linear projection transformation, we get the corresponding query, key and value matrices. Then, we divide the number of channels of the feature map into n heads, each head processes a subset of the feature map, and perform multi-scale sliding window dilated attention (SWDA) operations on different heads with different dilated coefficients r.
[0082] SWDA performs sparse sampling to select keys and values in a sliding window centered at each position (i, j) in the query matrix Q. The size of the sliding window is set to w×w. The degree of coefficient of selecting keys and values in the window is controlled by defining the hole coefficient r. As the hole coefficient increases, the selected keys and values will be more dispersed in space, allowing a larger receptive field to be covered. Self-attention calculations are then performed on these keys and values. The output X of SWDA has the value x at position (i, j) ij for:
[0083]
[0084] Among them, H and W represent the height and width of the feature map respectively, and K r and V r Represents the value sampled from K and V. For a given position (i, j), self-attention calculation is performed, and the key and value are selected from the position (i′, j′):
[0085]
[0086] For queries located at the edge of the feature map, a zero-filling strategy is used when performing self-attention calculations to maintain the size of the feature map. Through this query-centric sparse selection of keys and values, SWDA can meet locality and sparsity, effectively model long-distance dependencies, and reduce the amount of computation.
[0087] MSDA can be expressed as:
[0088] h i =SWDA(Q i , K i , V i , r i ), 1≤i≤n
[0089] X=Linear(Concat[h1,...,h n ]) (4)
[0090] Among them, r i is the hole coefficient of the ith head, Q i , K i and V i It represents the slice of the feature map input to the i-th head, and Concat represents the output results h of different heads. i For splicing, Linear means sending it to the linear layer for feature fusion.
[0091] By setting different hole coefficients for different heads, MSDA can effectively aggregate semantic information at various scales within the attention receptive field, and effectively reduce the redundancy of the self-attention mechanism without increasing complex operations and additional computational costs.
[0092] MSDA provides a method for the reading recognition of wheel-type mechanical water meters that can not only capture local fine features but also understand the relationship between characters in a wider field. It combines the global attention range of Transformer and the computational efficiency of CNN, effectively making up for the shortcomings of traditional CNN and global attention models.
[0093] The present invention embeds MSDA into the backbone network of the Meter-YOLO model, so that the Meter-YOLO model can more effectively identify the readings of the wheel-type mechanical water meter. While ensuring high precision, it is also suitable for practical application scenarios with limited resources, providing an effective solution for improving the accuracy of reading recognition.
[0094] 2. Feature Fusion:
[0095] In the application of wheel-type mechanical water meter reading recognition, an accurate and efficient detection model is crucial for deployment and use in practical application scenarios. The YOLO series of target detectors have been widely used in the industrial field due to their efficient detection effects, and the latest YOLOv8 architecture provides extremely high accuracy in applications, but its computational cost still has room for optimization on edge computing devices. In order to reduce latency and computing resource consumption while maintaining accuracy, the present invention introduces a new Slim-Neck structure (Li et al., 2022), which replaces the feature fusion part in the original YOLOv8 model network, thereby optimizing the network's performance in feature fusion.
[0096] The main goal of the Slim-Neck structure design is to reduce the computational complexity and inference time of the detector while maintaining accuracy. Its structure mainly consists of three modules: GSConv, GS bottleneck and VoV-GSCSP. The structure of Slim-Neck is as follows Figure 4 shown.
[0097] In order to speed up the prediction, the image input to CNN always undergoes a similar conversion process, that is, the spatial information is gradually transferred to the channel. However, each spatial (width and height) compression and channel expansion of the feature map will result in the loss of some semantic information. The standard convolution operation (SC) maximizes the retention of the hidden connections between each channel, while the depthwise separable convolution (DSC) completely cuts off this part of the connection. This defect causes the feature extraction and fusion capabilities of the depthwise separable convolution to be much lower than that of ordinary convolution. Therefore, many lightweight networks such as Xception (Chollet et al., 2017), MobileNets (Howard et al., 2017) and ShuffleNets (Zhang et al., 2018), although they greatly improve the speed of the detector through the depthwise separable convolution operation, have led to a decrease in accuracy. Compared with other convolution methods (SC, DSC and ShuffleNet methods), the Slim-Neck structure GSConv can retain the hidden connections between each channel as much as possible at a lower computational cost (close to 50% of the standard convolution), especially when the channel of the feature map is wide, it provides significant computational efficiency improvement. The basic structure of the GSConv module is as follows: Figure 5 shown.
[0098] The GSConv module performs a depth-separable convolution operation on the input feature map after ordinary convolution, and then splices the results of the two convolutions. The spliced feature map is then subjected to a random permutation operation on the feature channels, which rearranges the feature channels and improves the information flow between features, making the final output result closer to the accuracy of ordinary convolution while reducing its computational complexity and improving operating efficiency.
[0099] Based on GSConv, the Slim-Neck structure introduces the GS bottleneck module to further refine and compress the feature map (the GS bottleneck module is located at Figure 4 Between the "GSConv module" and "splicing", Figure 4 The GS bottleneck module is not shown in the figure to reduce the complexity of the computational task, and then the VoV-GSCSP (Cross Stage Partial Network with One-Shot Aggregation) module is used to expand the information flow channel and reuse information with efficient use of resources; this design enables features to propagate quickly within the network while avoiding repeated calculations. The structures of the GS bottleneck module and the VoV-GSCSP module are shown in Figure 1. Figure 6 , Figure 7 shown.
[0100] like Figure 6 As shown in Figure 2, the GS bottleneck module improves the learning ability of the model by superimposing the GS Conv module and enhances the feature processing performance of the network. Figure 7 As shown in the figure, the VoV-GSCSP module further integrates the information of ordinary convolution on the basis of the GS bottleneck module, reuses the information, and improves the efficiency of feature utilization and network performance.
[0101] 3. Loss function:
[0102] In the task of recognizing the readings of a wheel-type mechanical water meter, the main task of the model is to identify the position of the wheel on the water meter dial and its readings. This requires the model to accurately locate and recognize numbers. At the same time, the shapes, sizes, and spacing of numbers on water meters of different specifications and styles may vary. Therefore, using a reasonably designed loss function can effectively improve the detection performance of the model.
[0103] The YOLOv8 model uses the distribution focus loss (DFL) (Lin et al., 2017) and the completeness intersection over union (CIoU) (Zheng et al., 2020) to calculate the bounding box regression loss, but CIoU has the following limitations in the specific scenario of wheel-type mechanical water meter reading recognition:
[0104] (1) First, CIoU does not explicitly consider the balance between sample difficulty. In the task of recognizing water meter readings with a wheel, the water meter wheel may become difficult to recognize due to factors such as lighting, reflection, or water stains. CIoU does not make special treatments on the distribution of difficult and easy samples, which will reduce the model's ability to recognize wheel numbers under these conditions.
[0105] (2) Secondly, CIoU uses the aspect ratio of the bounding box as part of the loss function. However, in the water meter reading scenario, even if the aspect ratio of the true box and the predicted box is the same, if the absolute sizes of their width and height do not match, it will still have a great impact on digital recognition, and the penalty term of CIoU may not accurately reflect the difference in the absolute sizes of width and height.
[0106] (3) Finally, the CIoU loss calculation includes inverse trigonometric function operations, which are more time-consuming and increase the computing power consumption of the model. The CIoU calculation formula is as follows (5):
[0107]
[0108] In the above formula (5), the intersection over union (IoU) represents the intersection ratio between the predicted box and the true box; ρ 2 (b,b gt ) represents the Euclidean distance between the center point of the real box and the predicted box; h and w represent the height and width of the predicted box respectively; h gt and w gt Represents the height and width of the real box respectively; c g and c w Represents the height and width of the smallest enclosing box formed by the predicted box and the true box.
[0109] The GIoU loss (Rezatofighi et al., 2019) adopted by the detection head of the Meter-YOLO model of the present invention is an improved method for calculating the similarity of bounding boxes in target detection. It is proposed to solve the limitations of the traditional intersection-over-union (IoU) loss indicator. In some cases, even if the predicted box does not overlap or only partially overlaps the real box, the traditional IoU cannot effectively reflect the degree of this offset. The introduction of GIoU aims to provide a more comprehensive similarity measurement method. GIoU loss measures the similarity between the predicted box and the real box by introducing a minimum closed box to include the two boxes involved in the comparison. Compared with simple IoU, GIoU can still provide gradient updates when the predicted box and the real box do not overlap. This feature is particularly beneficial for applications that require positioning accuracy. The calculation formula of GIoU loss is shown in the following formula (6):
[0110]
[0111] Among them, IoU represents the intersection over union of the predicted box and the true box, C represents the area of the minimum bounding box; A∪B represents the union area of the predicted box and the true box; C\(A∪B) represents the difference between the minimum bounding box and the union of the predicted box and the true box, that is, the area of the part of C that does not belong to A∪B; |X| represents the area measurement of set X.
[0112] The value of GIoU will never exceed the value of IoU, and the value range is [-1, 1]. When the predicted box overlaps with the real box, it takes the maximum value of 1, and GIoU is equal to IoU. As the non-overlapping area between the predicted box and the real box increases, the value of GIoU will decrease, and when there is no intersection and the two are infinitely far apart, the minimum value of -1 is taken, which can better show the degree of separation between the boxes.
[0113] The present invention can achieve the following beneficial effects by introducing GIoU into the target bounding box regression loss: on the one hand, GIoU provides a more stable gradient update, and through the concept of the minimum bounding box, it can provide the model with continuous and effective gradient feedback even when the predicted box does not overlap with the true box. In the digital detection task of the wheel-type mechanical water meter, when encountering a large number of non-overlapping prediction boxes, it can bring performance improvement; on the other hand, unlike the CIoU loss involving complex geometric calculations such as inverse trigonometric functions, the GIoU loss does not integrate additional complex penalty terms of aspect ratio and center point distance, and is simpler and more intuitive in form, easy to implement and has high computational efficiency. This simplification reduces the difficulty of optimization, especially in tasks such as water meter reading recognition, where the accuracy of digital position often outperforms the perfect matching of aspect ratio, and the simplicity of GIoU can well meet this demand.
[0114] The following is an experimental analysis of the relevant models to verify the performance of the Meter-YOLO model of the present invention for the recognition of the readings of the wheel-type water meter.
[0115] 1. Experimental environment and training strategy
[0116] The hardware platform and environment parameters used in the experimental training phase are shown in Table 2.
[0117] Table 2 Training environment and hardware platform parameters
[0118]
[0119] In order to facilitate flexible deployment on hardware devices in various application scenarios, the YOLOv8 model generates five different scaling models by adjusting the width and depth parameters. These models are called YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l and YOLOv8x. The number of parameters and resource consumption of these five models increases successively, and the detection performance is getting better and better. The channel width, depth and maximum number of channels corresponding to these five models are shown in Table 3.
[0120] Table 3 Parameters corresponding to YOLOv8 of different sizes
[0121]
[0122] In order to better study and improve the model, the present invention selects YOLOv8s as the baseline model. Some key parameter settings in the model training process are shown in Table 4. In order to accelerate model convergence, Mosaic data enhancement is turned off in the last 10 stages of the training process.
[0123] Table 4 Key parameters set during model training
[0124]
[0125] 2. Evaluation indicators
[0126] In order to comprehensively evaluate the performance of the improved target detection model proposed in the present invention, namely the Meter-YOLO model, the present invention uses the performance of accuracy (Precision), recall rate (Recall), mean average precision (mAP) under different intersection over Union (IoU) thresholds, and the indicator of model computational complexity GFLOPs (billion floating point operations) to measure the performance of different aspects of the model.
[0127] Precision is one of the key indicators for judging the prediction accuracy of the model, reflecting the proportion of samples classified as positive that are actually positive. The accuracy is directly related to the frequency of false positives generated by the model in practical applications. Its calculation formula is shown in the following formula (7):
[0128]
[0129] Among them, TP (True Positives) represents the number of positive samples detected correctly, and FP (False Positives) represents the number of negative samples mistakenly judged as positive samples.
[0130] Recall is the ratio of the number of positive samples detected by the model to the total number of positive samples. It is an important indicator for evaluating the level of missed detection of the model. Its calculation formula is shown in the following formula (8):
[0131]
[0132] Among them, FN (False Negatives) refers to the number of positive samples that are mistakenly classified as negative samples.
[0133] The mean average precision (mAP) is a widely used indicator to evaluate the performance of object detection models. It provides a performance measure by aggregating the average accuracy (AP) of the model on all categories, which comprehensively reflects the detection ability of the model for all categories. For a single category, AP is the area under the accuracy and recall curve of the category, that is, the integral of precision and recall. Its calculation formula is shown in the following formula (9):
[0134]
[0135] The calculation of mAP involves the area under the precision and recall curves at different IoU thresholds. The calculation formula is shown in the following formula (10):
[0136]
[0137] Where N is the total number of categories, AP i is the average precision of the i-th category. mAP0.5 represents the mAP value when the IoU threshold is 0.5, and mAP0.5:0.95 represents the average mAP value under the IoU threshold from 0.5 to 0.95 with a step size of 0.05. mAP0.5 emphasizes the accurate detection and positioning of the target, while mAP@0.5:0.95 provides a more comprehensive evaluation, reflecting the consistency and robustness of the model under multiple IoU thresholds from loose to strict.
[0138] GFLOPs (Giga Floating-Point Operations) is an indicator to measure the computational complexity of the model in the inference stage. It indicates the number of floating-point operations (in billions) required for the model to perform a forward propagation. This indicator is closely related to the efficiency and practicality of the model, especially in resource-constrained deployment environments. Models with lower GFLOPs values can achieve faster inference speeds and lower energy consumption while maintaining performance, which is a key consideration for edge computing and real-time application scenarios.
[0139] 3. Loss function comparison experiment
[0140] In this section, we verify the superiority of introducing GIoU as a loss function to improve the performance of the YOLOv8s model. In order to ensure the fairness and comparability of the experiment, all other training conditions remain the same except for the use of different loss functions.
[0141] The experimental results are shown in Table 5 below, which shows the performance comparison of the YOLOv8s model on the word wheel water meter dataset when using different loss functions such as SIoU (Gevorgyan, 2022), EIoU (Zhang et al., 2022), and MPDIoU (Siliang et al., 2023).
[0142] Table 5 Comparison of detection results of YOLOv8s with different loss functions
[0143]
[0144] From the experimental results in Table 5, it can be seen that when GIoU is used as the bounding box regression loss function of the model for training, the model achieves the best detection performance, and the results are better than those using other loss functions. When GIoU loss is used, the mAP0.5 and mAP0.5:0.95 indicators of the model are improved by 0.2% compared with the CIoU loss used in the original model, the accuracy is improved by 0.6% and the recall is improved by 1.0%. Therefore, the experiment proves the effectiveness of introducing the GIoU loss function on the model's performance in predicting water meter readings.
[0145] 4. Comparative experiment
[0146] In order to illustrate the superiority and effectiveness of the improved model proposed in the present invention, the present invention compares the proposed model Meter-YOLO model with other YOLO series models widely used in the reading detection of digital wheel mechanical water meters. The models compared in the present invention include:
[0147] YOLOv3 first introduced the concept of multi-scale detection, significantly improving the model's ability to detect targets of different sizes; YOLOv4 introduced the concept of CSPNet structure, using the CSPDarknet53 backbone network to achieve lightweight while maintaining high detection accuracy and reducing model complexity; YOLOv5 optimizes performance by using Mosaic data enhancement and Focus structure. Mosaic data enhancement can improve model training speed and multi-scale detection effects, while the Focus structure reduces the amount of calculation and the number of parameters without losing detection performance. YOLOv7 uses the efficient network architecture ELAN to further optimize the performance of the model. The results of the comparative experiment are shown in Table 6 below.
[0148] Table 6 Comparative experimental results of some YOLO series models and the model proposed in this invention
[0149]
[0150] Table 6 above shows the performance comparison of various YOLO series algorithms in terms of computational complexity, detection accuracy, etc. In the application scenario of automatically reading the readings of a wheel-type mechanical water meter, the operating efficiency and accuracy of the model are particularly important. According to the experimental results in Table 6, the earlier YOLO series algorithm, YOLOv3-Tiny, achieved lightweight models, but lost a large part of the detection accuracy. Compared with other YOLO versions, YOLOv5s and YOLOv8s have smaller model sizes, lower computational complexity, and better detection performance. Compared with YOLOv8s, the improved model (Meter-YOLO model) proposed in the present invention has reduced the computational complexity by 2.6GLOPS, while achieving a higher average detection accuracy and overall detection performance of 98.2% on the wheel-type water meter dataset.
[0151] Figure 8 The changing trends of key performance indicators of the Meter-YOLO model proposed in this invention during the training process are shown. The changes in these indicators reflect the process of model learning efficiency and performance improvement.
[0152] 5. Ablation experiment
[0153] In order to verify the effectiveness of the various improvement strategies proposed in the present invention, an ablation experiment is performed on the baseline model using the wheel-type water meter dataset. The experimental results are shown in Table 7. In Table 7, GIoU, Slim-Neck and MSDA represent the corresponding improvement strategies, and √ indicates that this improvement strategy is used. The present invention uses the above YOLOv8s as the baseline model.
[0154] Table 7 Detection results after introducing different improvement strategies
[0155]
[0156] The experimental results in Table 7 above show that when applied to the baseline model, each improvement strategy of the present invention improves the detection performance to varying degrees. GIoU is introduced in the prediction box regression loss. GIoU can provide better gradient information and effectively handle the situation of non-overlapping bounding boxes, which improves mAP by 0.2% and recall by 1%. Slim-Neck replaces the Neck part in the original model, reducing the computational cost and improving the learning ability of the model, reducing the computational complexity by 3.5 GFLOPS. Finally, the Multi-Scale Dilated Attention (MSDA) mechanism (module) is introduced into the backbone network to effectively capture multi-scale semantic information and reduce the redundancy of the self-attention mechanism, requiring only a very small computational cost, so that mAP and accuracy are improved. Finally, the improved model has been effectively improved in most detection metrics, especially in detection accuracy, with mAP reaching 98.2%, and the model computational complexity is also reduced by 2.6 GFLOPS compared with the baseline model, and it is also better than the baseline model in other indicators.
[0157] In addition, the present invention also provides a wheel-type water meter reading recognition system using a Meter-YOLO model, comprising:
[0158] The image acquisition module 11 is used to acquire a plurality of different wheel-type water meter images.
[0159] The data set making module 12 is used to make a data set of a water meter using a plurality of water meter images.
[0160] The image annotation module 13 is used to annotate each image of the wheel-type water meter in the wheel-type water meter data set.
[0161] The model training module 14 is used to further train the Meter-YOLO model using the wheel-type water meter data set to realize the reading recognition of the wheel-type water meter image, wherein the Meter-YOLO model is an improvement based on the YOLOv8 model.
[0162] For details about the character wheel type water meter reading recognition system using the Meter-YOLO model, please refer to the relevant content of the character wheel type water meter reading recognition method using the Meter-YOLO model mentioned above, which will not be elaborated here.
[0163] It can be understood that the present invention proposes an improved model Meter-YOLO for the task of character wheel water meter reading recognition based on the YOLOv8 model architecture. First, the Meter-YOLO model integrates the GIoU loss function to more effectively handle the non-overlapping bounding box problem and provide better quality gradient information, thereby enhancing the overall detection performance of the model. Secondly, the present invention adopts a lighter and more efficient Slim-Neck structure to replace the Neck layer in the original architecture, significantly reducing the computational complexity of the model by 2.6GFLOPS. Finally, the performance of the Meter-YOLO model is significantly improved by embedding the MSDA module into the backbone network. After the above improvements, the present invention has achieved 98.2% detection accuracy in the above-mentioned character wheel water meter data set, and the accuracy and recall rate have increased by 1.1% and 0.6% respectively compared with the YOLOv8s baseline model, effectively reducing the model's false detection and missed detection phenomena. In multiple key indicators, the present invention has shown superior performance than other YOLO series models.
[0164] With the development of computer vision and deep learning technology, these technologies play a very important role in many fields. At present, there are still many challenges in the reading of mechanical water meters. In the natural use environment, the image collection conditions of the water meter are difficult to control, so there are image quality problems caused by uneven brightness, dust accumulation, angle offset, fog blur and different shooting angles. The present invention studies in detail the actual difficulties of mechanical water meter reading recognition. For the digital wheel water meter, the deep learning technology is used to design and optimize the corresponding reading algorithm. Combined with computer technology, a water meter automatic reading system is built for application. Specifically, the present invention has the following beneficial effects:
[0165] (1) In view of the problem that there are few publicly available data sets in the current research on mechanical water meter reading recognition, the present invention constructs a large-scale and diverse wheel-type water meter data set, which covers 16,488 wheel-type mechanical water meter images, all of which are from actual working environments and include a variety of wheel-type mechanical water meter styles. More importantly, in order to more comprehensively simulate the actual usage scenario, the above-mentioned wheel-type water meter data set specifically includes images taken under different brightness conditions and various shooting angles, ensuring the diversity and comprehensiveness of the data. Through this data set, the Meter-YOLO model of the present invention can more effectively learn the complex changes of wheel-type water meter images in the natural environment, thereby establishing a more robust and accurate recognition algorithm.
[0166] (2) In order to solve the problem of automatic reading of wheel-type mechanical water meters, the present invention proposes a wheel-type water meter reading algorithm Meter-YOLO based on improved YOLOv8, and solves the problem of reading wheel-type water meters through an end-to-end target detection method. First, the present invention introduces a multi-scale hole attention (MSDA) mechanism in the feature extraction layer, which takes into account the global perception ability of Transformer and the local feature learning efficiency of CNN, so that it can capture the subtle features in the image more deeply, which is especially important for the small gaps and occlusions that may appear between the wheels. At the same time, MSDA enhances the network's sensitivity to scale changes by using hole convolutions of different sizes in different layers. In addition, in terms of feature fusion, the present invention uses a lightweight Slim-Neck structure to replace the feature fusion module in the original YOLOv8 network structure. The Slim-Neck structure reduces the computational overhead of the network by simplifying the feature path and reducing the number of parameters, while improving the efficiency of feature fusion, so that the model improves detection accuracy while maintaining real-time performance. Finally, the present invention introduces a GIoU loss function that is more suitable for the application scenario of wheel-type water meter reading to calculate the bounding box loss. The GIoU loss optimizes the accuracy of the network's wheel positioning by more effectively evaluating the geometric quality of the bounding box, making the final generated reading more accurate. The present invention verifies the specific contribution of each improvement measure to the performance improvement of the model through a series of ablation experiments and comparative experiments, and demonstrates the excellent performance of the Meter-YOLO model in the wheel-type mechanical water meter reading recognition task.
[0167] It should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0168] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for recognizing readings of a water meter using a meter-YOLO model, characterized in that: The following steps are involved: S1: Collect multiple different wheel-type water meter images; S2: using a plurality of the wheel-type water meter images to prepare a wheel-type water meter data set; S3: labeling each of the wheel-type water meter images in the wheel-type water meter dataset; S4: Further use the word wheel type water meter data set to train the Meter-YOLO model to realize the reading recognition of the word wheel type water meter image, wherein the Meter-YOLO model is an improvement based on the YOLOv8 model.
2. The method for recognizing readings of a digital wheel type water meter using the Meter-YOLO model according to claim 1 is characterized in that: The wheel-type water meter data set includes images of the wheel-type water meter at different shooting angles, different brightness, and different models.
3. The method for recognizing readings of a digital wheel type water meter using the Meter-YOLO model according to claim 1, characterized in that: The Meter-YOLO model includes a backbone network, a feature fusion structure and a detection head. A multi-scale hole attention mechanism is embedded at the end of the backbone network of the Meter-YOLO model. The Meter-YOLO model uses the backbone network to extract image features of the wheel-type water meter image to output multiple different feature maps.
4. The method for recognizing readings of a digital wheel type water meter using the Meter-YOLO model according to claim 3 is characterized in that: The feature fusion structure of the Meter-YOLO model adopts a Sl im-Neck structure, and the Meter-YOLO model uses the feature fusion structure to fuse features of multiple different feature maps.
5. The method for recognizing readings of a digital wheel type water meter using the Meter-YOLO model according to claim 4 is characterized in that: The Meter-YOLO model uses the detection head to perform border regression and character prediction classification on the feature map after feature fusion to realize water meter reading recognition. The detection head uses GIoU loss to perform border regression.
6. The character wheel type water meter reading recognition system using the Meter-YOLO model is characterized by: include: An image acquisition module, used for acquiring a plurality of different wheel-type water meter images; A data set making module, used for making a data set of a wheel-type water meter using a plurality of the wheel-type water meter images; An image annotation module, used for annotating each of the images of the wheel-type water meter in the wheel-type water meter data set; A model training module is used to further train the Meter-YOLO model using the word wheel water meter data set to realize reading recognition of the word wheel water meter image, wherein the Meter-YOLO model is an improvement based on the YOLOv8 model.
7. The water meter reading recognition system using the Meter-YOLO model according to claim 6 is characterized in that: The image acquisition module is installed on a wheel-type water meter in an actual production environment.
8. The water meter reading recognition system using the Meter-YOLO model according to claim 7 is characterized in that: The image acquisition module includes a camera module and an upload module. The camera module is used to capture the image of the wheel-type water meter, and the upload module is used to upload the image of the wheel-type water meter to the data set production module.
9. The water meter reading recognition system using the Meter-YOLO model according to claim 6, characterized in that: The image annotation module is Labelme annotation software.
10. The water meter reading recognition system using the Meter-YOLO model according to claim 6, characterized in that: The Meter-YOLO model includes a backbone network, a feature fusion structure and a detection head.
Citation Information
Patent Citations
Method for identifying digital old water meter based on deep learning
CN116844172A
Cited By
Character wheel type mechanical water meter reading identification method based on Meter-YOLO model
CN118587722A
Multi-source data integration system applied to intelligent recognition and detection of underwater defects of hydropower station dam
CN119880929A
Light character wheel type camera water meter picture recognition method and system
CN120356199A
Lightweight image recognition method and system for character-wheel camera‑based water meter
WO2026214606A1
