A method and system for high-precision identification of water level gauge data based on artificial intelligence
Through convolutional neural network and image clustering analysis technology, the problems of low accuracy and high labor cost in water level recognition are solved, and high-precision and automated water level recognition are realized, which is suitable for water level data acquisition in different scenarios. The error is controlled within 1cm.
Patent Information
- Application Number
- CN202210220358.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-08
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2042-03-08
AI Technical Summary
The prior art has problems in water level identification with low accuracy, complex data set acquisition and high labor costs. Especially when identifying water scales with inclined, incomplete or background color similar to the environmental color, the recognition ability is poor and it is difficult to achieve high quality. Continuous monitoring of accuracy.
A convolutional neural network is used for one training, combined with image clustering analysis, denoising and correction technology, the water ruler numbers and scales are automatically recognized to achieve high-precision recognition in different scenarios, including water rulers with similar tilts and background colors.
It realizes high-precision, automation, and no manual intervention identification of water ruler data. The error can be controlled within 1cm, saving labor costs and time, and has strong adaptability. It is suitable for continuous recognition of water ruler of different colors.
Smart Images

Figure CN114627461B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of artificial intelligence, image recognition and environmental protection, and specifically provides a method and system for high-precision recognition of water gauge data based on artificial intelligence, which solves the problem of identifying water gauge water level data without human supervision. Background Art
[0002] Water level is an important indicator reflecting changes in water bodies and water flows. Water level observation can be directly used in hydrological intelligence forecasts to provide water information for flood control and drought relief, shipping, and the construction, use and management of water conservancy projects. Continuous water level data is an important basis for the construction planning of water conservancy, hydropower, waterways, water environment, etc.
[0003] At present, automatic water level observation equipment includes self-recording water level gauge, water pressure water level gauge, ultrasonic water level gauge, radar water level gauge, etc. These equipments have high purchase and maintenance costs and their accuracy is greatly affected by the environment; the traditional water gauge is the most direct water level observation equipment, with low installation cost, high accuracy and easy verification, but it requires manual monitoring and is difficult to achieve long-term continuous monitoring; the traditional image recognition technology is mainly based on grayscale images, extracts feature points to calculate water gauge readings, and is greatly affected by the environment and image quality. The application of artificial intelligence technology provides a good solution for the recognition of water gauge water level. The patent with publication number CN 109508630A discloses an artificial intelligence water gauge recognition method, which includes two training models, a water gauge object detection model and a water gauge scale recognition model. The water gauge image is input into the pre-trained water gauge object detection model to detect the water gauge position and cut out the water gauge image in the original image, and then the water gauge image is input into the water gauge scale recognition model trained by deep learning to output the statistical data of numbers and scales in the water gauge image. The patent with publication number CN 111680606 B discloses a low-power water level telemetry system based on artificial intelligence to identify water gauges. The system includes a telemetry station, a central station server, a cloud server, etc., wherein the cloud server uses an intelligent algorithm to realize water gauge data recognition.
[0004] At present, traditional non-artificial intelligence image detection is mainly based on image grayscale and feature extraction to achieve specific scene recognition, and has poor adaptability. The existing artificial intelligence water level recognition method requires training two sets of models and organizing two sets of data sets, which is a huge workload. In addition, the recognition ability and accuracy of tilted water levels, water levels with incomplete character "E", and water levels with background colors similar to the ambient colors are poor, or even impossible to recognize. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a method and system for high-precision identification of water gauge data based on artificial intelligence, which only requires one convolutional neural network training, combined with image clustering analysis, denoising and correction, to achieve high-precision, intelligent and automatic continuous identification of water gauges in different scenes such as inclined water gauges and water gauges with similar background colors, thereby solving the problem of high-precision continuous identification of water gauge data in different scenes.
[0006] The technical solution adopted by the present invention is as follows:
[0007] A method for high-precision recognition of water gauge data based on artificial intelligence, comprising the following steps:
[0008] The first step is to obtain water level gauge images: obtain field water level gauge images through a high-definition camera and transmit them to an indoor computer;
[0009] The second step is to identify the numbers and their positions on the water gauge: through the convolutional neural network, supervised training and learning of images with labeled numbers, obtain the weight of digital features, use the trained model to identify the images of water gauges in the wild, obtain the numbers and their position information, and determine the bottom number of the water gauge;
[0010] The third step is cluster analysis of water gauge images: based on the digital position information, the image of the lowest digital and the character "E" of the water gauge is intercepted, and image cluster analysis is performed through unsupervised learning. The color of the character "E" is compared and the intercepted image is binarized.
[0011] Step 4: Identify the missing “E” scale on the water ruler: perform neighborhood noise reduction and correction on the binarized image, read the image data from the bottom of the image, identify the RGB value that is the same as the character “E”, determine the pixel coordinates of the missing character “E”, and calculate the reading of the missing character “E” on the water ruler;
[0012] Step 5. Calculation of water gauge reading: Calculate the water gauge reading based on the lowest number on the water gauge determined in step 2 and the reading of the incomplete "E" determined in step 4.
[0013] Furthermore, the first step comprises the following steps:
[0014] A high-definition camera is set up in front of a water gauge to take an image at a certain interval and transfer it to a specified folder on the computer.
[0015] Further, the second step includes the following steps:
[0016] Step 2.1, image annotation: collect water gauge images or digital images, perform digital annotation, and obtain the data set required for artificial intelligence training, verification and testing;
[0017] Step 2.2, image deep training and learning: Use the convolutional neural network to perform supervised deep training and learning on the labeled training set, validation set, and test set to obtain a convolutional neural network model;
[0018] Step 2.3, water gauge digital information recognition: Use the convolutional neural network model after deep learning to detect the field water gauge image, extract the water gauge numbers and digital position information, the digital position information includes the digital center coordinates and the digital image width and height pixel information, and determine the bottom number of the water gauge based on the digital vertical pixel coordinates.
[0019] Further, the third step includes the following steps:
[0020] Step 3.1, image cropping: based on the digital position information in step 2.3, crop the image of the lowest digital number and the character "E" at the bottom of the water gauge;
[0021] Step 3.2, image clustering analysis: convert the captured image information into two-dimensional data, perform clustering analysis using unsupervised learning, and binarize the captured image by setting a threshold and comparing the color of the character "E".
[0022] Further, the fourth step includes the following steps:
[0023] Step 4.1, image noise reduction and correction: Use computer image analysis technology to perform neighborhood noise reduction and angle correction processing to obtain an image without noise and without tilt of the character "E";
[0024] Step 4.2, calculation of the incomplete "E" scale of the water ruler: read the image after noise reduction correction, traverse from the bottom of the image upward, obtain the pixel coordinates with the same RGB value as the character "E", and use the largest vertical pixel coordinate of the incomplete character "E" to convert the reading of the incomplete "E".
[0025] A system for high-precision recognition of water gauge data based on artificial intelligence, comprising:
[0026] A water gauge image acquisition module is used to capture water gauge images and transmit the captured field water gauge images to a computer; the water gauge image acquisition module may use a high-definition camera;
[0027] The water gauge number and number position recognition module is used to obtain the digital feature weights through supervised training and learning of images with labeled numbers through convolutional neural networks, and use the trained model to recognize field water gauge images, obtain numbers and digital position information, and determine the lowest number of the water gauge;
[0028] The water gauge image cluster analysis module is used to intercept the image of the lowest number and the character "E" of the water gauge according to the digital position information, perform image cluster analysis through unsupervised learning, compare the color of the character "E", and binarize the intercepted image;
[0029] The water ruler incomplete "E" scale recognition module is used to perform neighborhood noise reduction and correction on the binarized image, read the image data from the bottom of the image, identify the RGB value that is the same as the character "E", determine the pixel coordinates of the incomplete character "E", and calculate the reading of the incomplete character "E" on the water ruler;
[0030] The water gauge reading calculation module is used to calculate the water gauge reading according to the lowest digit of the water gauge determined by the digital information recognition module and the reading of the incomplete "E" determined by the incomplete "E" scale recognition module of the water gauge.
[0031] The method and system for high-precision identification of water gauge data by artificial intelligence provided by the present invention, based on technologies such as convolutional neural network, image clustering analysis, image noise reduction correction, etc., provides an automated, high-precision method and system for water gauge water level identification without human intervention, and has the following beneficial effects:
[0032] (1) The present invention provides a method and system for high-precision identification of water gauge data based on artificial intelligence. The main purpose is to solve the problems of low water gauge data collection accuracy, complex data set collection, and high labor costs. The technical method of the present invention can automatically and high-precision identify water gauge water level readings by annotating a small amount of data sets and performing supervised and unsupervised model learning;
[0033] (2) The present invention is based on artificial intelligence technologies such as convolutional neural networks and cluster analysis, and trains and learns a large amount of labeled data. The trained artificial intelligence model is used to identify the water gauge numbers and digital position information in the image, and the image including the numbers and the character "E" at the bottom is intercepted according to the digital position. The water gauge water level reading is identified through image processing technologies such as cluster analysis, noise reduction, and correction;
[0034] (3) The method provided by the present invention only needs to establish a digital artificial intelligence recognition model. Compared with the water gauge and scale recognition model, the digital artificial intelligence recognition model data set is easier to collect and annotate, which greatly saves labor and time costs. At the same time, due to the obvious digital features, the recognition accuracy of the model is greatly improved;
[0035] (4) The method provided by the present invention uses cluster analysis, noise reduction, correction and other image processing technologies to extract digital information based on the artificial intelligence model, improve image recognition, reduce image noise, and greatly improve the recognition accuracy of the incomplete character "E". The water gauge data recognition method provided by the present invention can achieve zero error in theory, and the error can be controlled within 1 cm in practical applications;
[0036] (5) The method provided by the present invention can be written into a program without human intervention. For water gauges of different colors (automatically distinguishing red, blue or other colors), the water level data of the water gauge in different scenes can be continuously identified according to the set time interval. After actual verification, the program system written based on the present invention has high recognition accuracy, good adaptability, fast speed and strong portability, providing technical support for the recognition of water gauge water level data. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a flow chart of the method for high-precision recognition of water gauge data based on artificial intelligence of the present invention;
[0038] Figure 2 This is a flow chart of a calculation example of a method for high-precision identification of water gauge data based on artificial intelligence of the present invention;
[0039] Figure 3 It is a schematic diagram of calculating the incomplete "E" in the present invention;
[0040] Figure 4 This is a diagram showing the calculation results of the high-precision water gauge data recognition system based on artificial intelligence of the present invention;
[0041] Figure 5 This is a comparison chart of the results of the actual verification of the method for high-precision identification of water gauge data based on artificial intelligence of the present invention. DETAILED DESCRIPTION
[0042] In order to make the technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention and the accompanying drawings. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0043] The technical solution of the present invention is further described in detail below in conjunction with specific embodiments and drawings.
[0044] See also Figure 1 The embodiment of the present invention provides a method for high-precision recognition of water gauge data based on artificial intelligence. First, a field water gauge image is obtained through a high-definition camera, and then the water gauge numbers and digital position information in the image are recognized using an artificial intelligence model, and the image including numbers and the character "E" at the bottom is intercepted. The intercepted image is binarized by a cluster analysis method, and after image denoising and correction, the pixel coordinates of the same RGB as the character "E" are traversed from the bottom of the image upwards, and the length represented by the incomplete character "E" is converted. Combined with the identification of the numbers at the bottom of the water gauge, the water gauge reading is calculated. The method specifically includes the following steps:
[0045] Step 1: Obtain water level image
[0046] (1) Image capture: A high-definition camera is set up in front of a water gauge, and an image is captured at a certain interval and transferred to a specified folder on the computer;
[0047] Step 2: Identify the water gauge numbers and their positions
[0048] (1) Image annotation: Collect 1,000 pictures containing numbers and use LabelImg to annotate them.
[0049] (2) Image depth training and learning: The annotated images and corresponding annotation files are divided into training set, validation set and test set in a ratio of 8:1:1. The convolutional neural network model is used to train and learn the data set to obtain the convolutional neural network model;
[0050] (3) Water gauge digital information recognition: Using the deep learning convolutional neural network model, read the last field water gauge image passed to the computer and recognize the water gauge numbers in the image (such as Figure 2 , the numbers recognized in this example are 5, 4, 3, 2, 1) and the corresponding digital center coordinates and digital image width and height pixel information. According to the digital vertical pixel coordinates, the lowest number of the water ruler (such as Figure 2 , this example is “1”).
[0051] Step 3: Cluster analysis of water gauge images
[0052] (1) Image cropping: Based on the center coordinates of the number "1" in the original image and the pixel information of the width and height of the digital image, the pixel coordinates of the upper left corner of the number "1" (168, 560) are calculated. To ensure that the captured image includes all the information of the incomplete character "E", based on the pixel coordinates of the upper left corner of the number "1", the image is expanded downward by 3 characters of the length of "E" and rightward by 2 characters of the width of "E" to capture the image (e.g. Figure 2 );
[0053] (2) Image cluster analysis: Convert the captured image into RGB two-dimensional data, set the cluster center to 4 (the cluster center should be at least 2), and use unsupervised learning to perform color cluster analysis. Compare the red or blue RGB values to determine the cluster center color of the water gauge numbers and the character "E" (RGB is 176, 53, 54). Set the threshold to 3000, set the numbers and the character "E" in the captured image to black, and the others to white.
[0054] Step 4: Identify the incomplete "E" reading of the water gauge
[0055] (1) Image denoising correction: According to the neighborhood denoising algorithm, the threshold of the binarized image is set to 3 for image denoising; by detecting the boundary of the character "E", the tilt angle is calculated (the tilt angle in this example is 0.095 degrees), and the image rotation correction is performed (such as Figure 2 );
[0056] (2) Calculation of the missing “E” scale of the water ruler: For the image after noise reduction correction, traverse from the bottom of the image upwards (such as Figure 3 ), obtain the coordinates of the pixel with the same RGB value as the character "E", calculate the pixel height of the incomplete character "E" respectively, take the maximum value, combine it with the pixel height of the single character "E" (66.25), and convert the length of the incomplete character "E" (the reading is 0.66, the unit is dm, 1dm = 10cm);
[0057] (3) Calculation of water level gauge reading: The bottom digit is “1”, and the reading of the incomplete character “E” is 0.66dm, so the water level gauge reading is 0.34dm.
[0058] The embodiment of the present invention further provides a system for high-precision recognition of water gauge data based on artificial intelligence, comprising:
[0059] A water gauge image acquisition module is used to capture water gauge images and transmit the captured field water gauge images to a computer; the water gauge image acquisition module may use a high-definition camera;
[0060] The water gauge number and number position recognition module is used to obtain the digital feature weights through supervised training and learning of images with labeled numbers through convolutional neural networks, and use the trained model to recognize field water gauge images, obtain numbers and digital position information, and determine the lowest number of the water gauge;
[0061] The water gauge image cluster analysis module is used to intercept the image of the lowest number and the character "E" of the water gauge according to the digital position information, perform image cluster analysis through unsupervised learning, compare the color of the character "E", and binarize the intercepted image;
[0062] The water ruler incomplete "E" scale recognition module is used to perform neighborhood noise reduction and correction on the binarized image, read the image data from the bottom of the image, identify the RGB value that is the same as the character "E", determine the pixel coordinates of the incomplete character "E", and calculate the reading of the incomplete character "E" on the water ruler;
[0063] The water gauge reading calculation module is used to calculate the water gauge reading according to the lowest digit of the water gauge determined by the digital information recognition module and the reading of the incomplete "E" determined by the incomplete "E" scale recognition module of the water gauge.
[0064] According to the above calculation ideas provided by the present invention, the system program (such as Figure 4), this program can realize water level recognition without manual supervision or operation. Here, in order to facilitate the demonstration of the system program written based on the present invention ( Figure 4 ), the following will introduce the system usage in detail. The system includes two modes: automatic recognition and manual recognition, including the following steps:
[0065] (1) Basic data preparation: Collect pictures containing numbers and annotate them using annotation software.
[0066] (2) Operation steps: ① Use convolutional neural network to conduct supervised deep training and learning on the labeled training set, validation set and test set to obtain the digital feature model; ② Run the artificial intelligence water gauge recognition system and open the main interface of the program ( Figure 4 ), the upper part of the interface is the image display area, the middle is the parameter setting area, and the lower part is the result table display area and operation area; ③ Automatic recognition mode: click the "Automatic recognition" button to execute the functions of the water gauge number and number position recognition module, the water gauge image clustering analysis module, the water gauge incomplete "E" scale recognition module, and the water gauge reading calculation module. At this time, the button becomes unavailable, and the system detects the number of pictures in the preset folder once every 1 second. When the pictures increase or decrease, the artificial intelligence water gauge recognition program is activated to perform water gauge data recognition for the last water gauge picture passed in, and display the result image and data on the system main interface, and automatically save the data to the specified file. Click the "Stop recognition" button to pause the recognition. At this time, the "Automatic recognition" button is available, and the "Stop recognition" button is unavailable; ④ Manual recognition mode: click the "Manual recognition" button to perform a water gauge image recognition on the last picture passed in the folder; ⑤ Click the "Save data as" button to save the data in the table on the main interface in a custom folder.
[0067] Note on parameter settings: The system defaults the "number of cluster centers" to 4 and the "color difference threshold" to 3000. The default parameters are optimized values, which can basically meet the requirements of water gauge data recognition. At the same time, the parameters can also be adjusted as needed to suit different scenarios.
[0068] Compared with the traditional water level monitoring and water gauge recognition methods, the water gauge water level recognition technology provided by the present invention can perform water gauge recognition in real time, automatically and unattended with high precision, and the relevant technology has developed a program for actual verification. By recognizing 30 groups of water gauge images, 17 groups of errors are almost 0, and 13 groups of errors are within 1 cm (such as Figure 5 ).
[0069] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for high-precision identification of water gauge data based on artificial intelligence, characterized in that: The steps include: The first step is to obtain water level gauge images: obtain field water level gauge images through a high-definition camera and transmit them to an indoor computer; The second step is to identify the numbers and their positions on the water gauge: through the convolutional neural network, supervised training and learning of images with labeled numbers, obtain the weight of digital features, use the trained model to identify the images of water gauges in the wild, obtain the numbers and their position information, and determine the bottom number of the water gauge; The third step is cluster analysis of water gauge images: based on the digital position information, the image of the lowest digital and character "E" of the water gauge is intercepted, and image cluster analysis is performed through unsupervised learning. The color of the character "E" is compared and the intercepted image is binarized. Step 4: Identify the missing "E" scale on the water ruler: perform neighborhood noise reduction and correction on the binarized image, read the image data from the bottom of the image, identify the RGB value that is the same as the character "E", determine the pixel coordinates of the missing character "E", and calculate the reading of the missing character "E" on the water ruler; Step 5. Calculation of water gauge reading: Calculate the water gauge reading based on the lowest number on the water gauge determined in step 2 and the reading of the incomplete "E" determined in step 4.
2. A method for high-precision identification of water gauge data based on artificial intelligence as claimed in claim 1, characterized in that: The first step comprises the following steps: A high-definition camera is set up in front of a water gauge to take an image at a certain interval and transfer it to a specified folder on the computer.
3. A method for high-precision identification of water gauge data based on artificial intelligence as claimed in claim 2, characterized in that: The second step comprises the following steps: Step 2.1, image annotation: collect water gauge images or digital images, perform digital annotation, and obtain the data set required for artificial intelligence training, verification and testing; Step 2.2, image deep training and learning: Use the convolutional neural network to perform supervised deep training and learning on the labeled training set, validation set, and test set to obtain a convolutional neural network model; Step 2.3, water gauge digital information recognition: Use the convolutional neural network model after deep learning to detect the field water gauge image, extract the water gauge numbers and digital position information, the digital position information includes the digital center coordinates and the digital image width and height pixel information, and determine the bottom number of the water gauge based on the digital vertical pixel coordinates.
4. A method for high-precision identification of water gauge data based on artificial intelligence as claimed in claim 3, characterized in that: The third step comprises the following steps: Step 3.1, image cropping: based on the digital position information in step 2.3, crop the image of the lowest digital number and the character "E" at the bottom of the water gauge; Step 3.2, image cluster analysis: convert the captured image information into two-dimensional data, perform cluster analysis using unsupervised learning, and binarize the captured image by setting a threshold and comparing the color of the character "E".
5. A method for high-precision identification of water gauge data based on artificial intelligence as claimed in claim 4, characterized in that: The fourth step comprises the following steps: Step 4.1, image noise reduction and correction: Use computer image analysis technology to perform neighborhood noise reduction and angle correction processing to obtain an image without noise and without tilt of the character "E"; Step 4.2, calculation of the incomplete "E" scale of the water ruler: read the image after noise reduction correction, traverse from the bottom of the image upward, obtain the pixel coordinates with the same RGB value as the character "E", and use the largest vertical pixel coordinate of the incomplete character "E" to convert the reading of the incomplete "E".
6. A system for high-precision recognition of water gauge data based on artificial intelligence, characterized in that: include: A water gauge image acquisition module is used to capture water gauge images and transmit the captured field water gauge images to a computer; the water gauge image acquisition module may use a high-definition camera; The water gauge number and number position recognition module is used to obtain the digital feature weights through supervised training and learning of images with labeled numbers through convolutional neural networks, and use the trained model to recognize field water gauge images, obtain numbers and digital position information, and determine the lowest number of the water gauge; The water gauge image clustering analysis module is used to intercept the image of the lowest number and the character "E" of the water gauge according to the digital position information, perform image clustering analysis through unsupervised learning, compare the color of the character "E", and binarize the intercepted image; The water ruler missing "E" scale recognition module is used to perform neighborhood noise reduction and correction on the binarized image, read the image data from the bottom of the image, identify the RGB value that is the same as the character "E", determine the pixel coordinates of the missing character "E", and calculate the reading of the missing character "E" on the water ruler; The water gauge reading calculation module is used to calculate the water gauge reading according to the bottom digit of the water gauge determined by the digital information recognition module and the reading of the incomplete "E" determined by the incomplete "E" scale recognition module of the water gauge.
