Multistage water gauge reading method and device for improving yolov8 network and medium
By improving the yolov8 network, combining 3D cameras and ECA-Attention and Adown downsampling methods, the problems of low accuracy and poor robustness of multi-stage water ruler are solved, and higher reading accuracy and robustness are achieved, suitable for complex Application scenarios with limited environment and resources.
Patent Information
- Application Number
- CN202411235884.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-12-20
AI Technical Summary
In the prior art, the reading accuracy of multi-stage water rulers is low, and the robustness is poor when there is occlusion or the environment is complex. The shooting is performed on multi-stage water rulers, with a large number of frames and a large amount of data calculation.
By improving the yolov8 network, using 3D cameras to obtain target videos of multi-level water rulers, extract frames and mark them, use ECA-Attention and Adown downsampling methods to improve recognition accuracy, calculate water ruler readings and detect abnormal position information, simulate lighting and weather Conditions: GAN is used for data expansion to enhance the robustness and generalization capabilities of the model.
It improves the accuracy and accuracy of the reading of the water ruler, reduces the calculation amount, enhances the robustness and generalization capabilities of the model, meets real-time requirements, and is suitable for resource-constrained environments.
Smart Images

Figure CN119169505A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of water level measurement technology, and in particular to a multi-level water gauge reading method, device and medium with an improved yolov8 network. Background Art
[0002] As a tool for directly measuring the surface of water bodies, water gauges can monitor water level changes in real time and provide basic data for hydrological monitoring. By reading the scale on the water gauge, the water level of the water body can be accurately grasped, which has important application value in many fields such as hydrological monitoring, flood prevention and disaster reduction, water conservancy project construction, shipping and transportation, and scientific research.
[0003] In real life, the water gauge may be in a complex background environment, such as water surface fluctuations, light changes, shadows, etc. These factors may interfere with the detection results and affect the accuracy of the readings; there may be abnormal situations that have not been taken into account, such as numbers being blocked, blurred or damaged, etc. These situations may affect the accuracy of the readings; multi-level water gauges shoot many targets, and if the reading accuracy is to be improved, the amount of data calculation is large and the robustness is low.
[0004] Through the above analysis, the problems and defects of the prior art are as follows:
[0005] The multi-level water gauge in the prior art has low reading accuracy and poor robustness when there is occlusion or complex environment. When shooting the multi-level water gauge, the number of frames is large and the amount of data calculation is large. Summary of the invention
[0006] The embodiments of the present application provide a multi-level water gauge reading method, device and medium of an improved yolov8 network, which can solve the problems in the prior art of low accuracy of multi-level water gauge reading, poor robustness when there is occlusion or complex environment, large number of frames and large amount of data calculation when shooting multi-level water gauges.
[0007] In the first aspect, an embodiment of the present application provides a multi-level water gauge reading method of an improved yolov8 network, the method comprising: acquiring a target video of a multi-level water gauge through a 3D camera; extracting frames of the target video to obtain a target image, and determining whether the target image reaches a preset number; when the target image reaches a preset number, using X-Anylable to annotate the target image to obtain a target label; inputting the target label into the improved yolov8 network to obtain the location information of the target label and the confidence corresponding to the location information; calculating the location information and the confidence to obtain a water gauge reading.
[0008] In one implementation of the present application, the target label is input into the improved yolov8 network to obtain the position information of the target label and the confidence corresponding to the position information, specifically including: identifying the multi-level water gauge and the numbers contained in the multi-level water gauge to obtain the water gauge label and the digital label; classifying the water gauge label and the digital label into training set, test set and verification set; importing the training set into the improved yolov8 network for training; drawing a rectangular frame for the digital label to obtain a digital detection frame and confidence, the digital detection frame includes the top frame coordinates and the bottom frame coordinates; sorting the digital detection frame of each water gauge according to the bottom frame coordinates and the confidence to obtain a vertical position list and a confidence list.
[0009] In one implementation of the present application, the position information and confidence are calculated to obtain a water gauge reading, specifically including: determining whether there is abnormal position information in the vertical position list, the abnormal position information including digital detection frame overlap and digital detection frame absence, and the confidence is lower than a first preset threshold; in the absence of abnormal position information, calculating the bottom frame coordinate difference of the digital detection frame, and calculating the proportional relationship with the corresponding water gauge; finding the bottom frame coordinates of the digital detection frame closest to the water level line, and obtaining the first water gauge reading of the water level line based on the proportional relationship.
[0010] In one implementation of the present application, the method also includes: calculating the difference in bottom frame coordinates of the first two digital detection frames in the confidence list, and calculating the proportional relationship with the corresponding water scale; finding the bottom frame coordinates of the digital detection frame closest to the water level line, and obtaining a second water scale reading of the water level line based on the proportional relationship; if the difference between the first water scale reading and the second water scale reading exceeds a second preset threshold, selecting the second water scale reading as the final water scale reading.
[0011] In one implementation of the present application, after extracting frames from the target video to obtain the target image, the method also includes: setting a random Gamma interval value to simulate light intensity according to the random Gamma interval value; setting raindrop parameters through Randomrain, the raindrop parameters include quantity and speed; and rotating the target image through Rotate to simulate water gauge tilt.
[0012] In one implementation of the present application, before acquiring the target video of the multi-level water level through a 3D camera, the method also includes: introducing ECA-Attention to the tail end of the yolov8 network backbone network structure, replacing the 2nd, 3rd, and 4th C2f structures in the Backbone of the yolov8 network; adding downsampling Adown to obtain an improved yolov8 network.
[0013] In one implementation of the present application, the method also includes: installing a 3D camera, wherein the angle between the 3D camera and the top of the lowest water gauge is no more than 20 degrees, and the angle between the 3D camera and the straight line where the multi-level water gauge is located is no more than 30 degrees; and setting lens preset points for the multi-level water gauge according to the reference water level.
[0014] In one implementation of the present application, the method includes: when the target image does not reach a preset number, using a generative adversarial network to expand the data, the generative adversarial network includes a generator and a discriminator; the generator learns and imitates the distribution characteristics of the target image data in the training set to form new data; the discriminator determines whether the new data source comes from the training set.
[0015] In the second aspect, the embodiment of the present application also provides a multi-level water gauge reading device of an improved yolov8 network, the device comprising at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: obtain a target video of the multi-level water gauge through a 3D camera; extract frames of the target video to obtain a target image, and determine whether the target image reaches a preset number; when the target image reaches a preset number, use X-Anylable to annotate the target image to obtain a target label; input the target label into the improved yolov8 network to obtain the location information of the target label, and the confidence corresponding to the location information; calculate the location information and the confidence to obtain the water gauge reading.
[0016] In the third aspect, the embodiment of the present application also provides a non-volatile computer storage medium for multi-level water gauge readings of an improved yolov8 network, storing computer executable instructions, and the computer executable instructions are set to: obtain a target video of a multi-level water gauge through a 3D camera; extract frames of the target video to obtain a target image, and determine whether the target image reaches a preset number; when the target image reaches a preset number, use X-Anylable to annotate the target image to obtain a target label; input the target label into the improved yolov8 network to obtain the location information of the target label, and the confidence corresponding to the location information; calculate the location information and the confidence to obtain the water gauge reading.
[0017] The embodiment of the present application provides a multi-level water gauge reading method, device and medium with an improved YOLOv8 network. For multi-level water gauges, video is shot and frame extraction is performed to obtain a large number of images. By introducing ECA-Attention and Adown downsampling methods, the improved YOLOv8 network can more accurately identify and locate the water gauge and the numbers on it, thereby improving the accuracy of water gauge reading and reducing the amount of calculation. By calculating the first water gauge reading and the second water gauge reading and comparing their difference, a more reliable reading is selected when the difference exceeds a preset threshold, thereby further improving the accuracy of the reading. In the target image preprocessing stage, the model is enabled to adapt to different lighting conditions and weather conditions by simulating light intensity, adding raindrops and rotating images. The improved YOLOv8 network can adapt to changes in conditions and perspectives, thereby enhancing the robustness of the system. In the process of calculating position information and confidence, the detection and processing of abnormal position information are added, which effectively avoids erroneous readings caused by overlapping, missing or low confidence of digital detection frames. By replacing some structures in the YOLOv8 network and introducing the Adown downsampling method, the number of parameters and the amount of calculation of the model are reduced, making the model more lightweight and conducive to deployment and operation in resource-constrained environments. Due to the reduction in calculation amount and optimization of the model structure, the improved YOLOv8 network has improved inference speed and can meet application scenarios with high real-time requirements. GAN is used for data expansion to generate new training data, which improves the generalization ability and robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 A schematic flow chart of a multi-level water gauge reading method for improving the yolov8 network provided in an embodiment of the present application;
[0020] Figure 2 An overall logic diagram of a multi-level water gauge reading method for improving the yolov8 network provided in an embodiment of the present application;
[0021] Figure 3 A schematic diagram of the ECA-Attention structure of a multi-level water gauge reading method of an improved yolov8 network provided in an embodiment of the present application;
[0022] Figure 4 A schematic diagram of the ECA-C2F structure of a multi-level water gauge reading method for improving the yolov8 network provided in an embodiment of the present application;
[0023] Figure 5A schematic diagram of the structure of an improved yolov8 network for a multi-level water gauge reading method of an improved yolov8 network provided in an embodiment of the present application;
[0024] Figure 6 A schematic diagram of the Adown structure of a multi-level water gauge reading method for improving the yolov8 network provided in an embodiment of the present application;
[0025] Figure 7 A schematic diagram of the structure of a generative adversarial network for a multi-level water gauge reading method that improves the yolov8 network provided in an embodiment of the present application;
[0026] Figure 8 A schematic diagram of the water gauge reading results of a multi-level water gauge reading method of an improved yolov8 network provided in an embodiment of the present application;
[0027] Fig. 9 A schematic diagram of the internal structure of a multi-level water gauge reading device with an improved yolov8 network provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0029] The embodiments of the present application provide a multi-level water gauge reading method, device and medium for improving the yolov8 network, which solves the problems in the prior art of low accuracy of multi-level water gauge reading, poor robustness when there are occlusions or complex environments, and large number of frames and large amount of data calculation when shooting multi-level water gauges.
[0030] The technical solution proposed in the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0031] Figure 1 A flowchart of a multi-level water gauge reading method for improving the yolov8 network provided in the embodiment of the present application. Figure 1 As shown, the embodiment of the present application provides a multi-level water gauge reading method of improving the yolov8 network, which specifically includes the following steps:
[0032] Step 10: Obtain the target video of the multi-level water gauge through the 3D camera.
[0033] In this step, the target video is Figure 2The 3D camera can capture the depth information of the water ruler, that is, the position of each point in the three-dimensional space, and can more accurately identify the scale lines on the water ruler and reduce the errors caused by perspective distortion or occlusion in the two-dimensional image; shooting video can cover the required time period faster. Compared with taking pictures, shooting video can record the entire process at one time, which is especially important for scenes that need to analyze dynamic changes or capture fast-moving objects. Video allows more post-processing, which is easier to achieve for reviewing extreme situations.
[0034] Step 20: Extract frames from the target video to obtain target images, and determine whether the target images reach a preset number.
[0035] In this step, the video may be framed per second, and after the frame is extracted, a clear target image with a water scale is screened out.
[0036] Step 30: When the number of target images reaches a preset number, use X-Anylable to annotate the target images to obtain target labels.
[0037] In this step, the marking should fit the digital boundaries as closely as possible, not reveal too much background, and maintain consistency; for example, set 13 labels for marking, including ten digital labels from 0 to 9 and 3 water gauge labels.
[0038] Step 40: Input the target label into the improved yolov8 network to obtain the location information of the target label and the confidence level corresponding to the location information.
[0039] As an optional embodiment, the target tag is input into the improved yolov8 network to obtain the location information of the target tag and the confidence level corresponding to the location information, which may specifically include:
[0040] Step 401: Identify the multi-level water gauge and the numbers contained in the multi-level water gauge to obtain water gauge labels and digital labels; Step 402: Classify the water gauge labels and digital labels into training sets, test sets, and validation sets;
[0041] In this step, the labels after annotation can be converted into txt format, and the classification of training set, test set and validation set can be completed in the ratio of 7:2:1.
[0042] Step 403: Import the training set into the improved yolov8 network for training; Step 404: Draw a rectangular frame for the digital label to obtain a digital detection frame and confidence. The digital detection frame includes top frame coordinates and bottom frame coordinates; Step 40: Sort the digital detection frame of each water ruler according to the bottom frame coordinates and confidence to obtain a vertical position list and a confidence list.
[0043] In this step, multiple target images may appear at the same view angle and position, and thus multiple confidence levels may appear in the same detection frame.
[0044] Step 50: Calculate the position information and confidence level to obtain the water gauge reading.
[0045] As another optional embodiment, the position information and confidence are calculated to obtain a water gauge reading, which may specifically include: Step 501: determine whether there is abnormal position information in the vertical position list, the abnormal position information includes digital detection frame overlap and digital detection frame missing, and the confidence is lower than a first preset threshold; Step 502: in the absence of abnormal position information, calculate the bottom frame coordinate difference of the digital detection frame, and calculate the proportional relationship with the corresponding water gauge; Step 503: find the bottom frame coordinates of the digital detection frame closest to the water level line, and obtain the first water gauge reading of the water level line based on the proportional relationship.
[0046] In this step, when the vertical position list is continuous, the bottom frame difference is directly calculated, and then the proportional relationship is calculated according to the digital interval of the water ruler itself.
[0047] Furthermore, the method may also include: step 504: calculating the difference in bottom frame coordinates of the first two digital detection frames in the confidence list, and calculating the proportional relationship with the corresponding water level gauge; step 505: finding the bottom frame coordinates of the digital detection frame closest to the water level line, and obtaining the second water level gauge reading of the water level line based on the proportional relationship.
[0048] In this step, in order to ensure the accuracy of the reading, multiple results can be compared, such as selecting a digital detection box with high confidence as shown below.
[0049] Step 506: If the difference between the first water gauge reading and the second water gauge reading exceeds a second preset threshold, the second water gauge reading is selected as the final water gauge reading.
[0050] For example, if the difference between this water gauge reading and the reading in the previous step does not exceed 1, the first water gauge reading is used; if the difference exceeds 1, the second water gauge reading is used as the final water gauge reading of the current frame.
[0051] As another optional embodiment, after extracting frames from the target video to obtain the target image, the method may further include: Step 201: setting a random Gamma interval value, and simulating light intensity according to the random Gamma interval value.
[0052] In this step, for example, the lower limit of the Gamma value is set to 70 and the upper limit is set to 130, and a Gamma value between 70 and 130 is randomly generated. A smaller Gamma value will make the image darker, while a larger Gamma value will make the image brighter. By randomly adjusting the Gamma value, a series of images with different light intensities can be generated, so that the model can learn the ability to maintain reading accuracy under different lighting conditions during the training process.
[0053] Step 202: Setting raindrop parameters through Randomrain, wherein the raindrop parameters include quantity and speed.
[0054] In this step, the Randomrain technology is used to add raindrops to the target image. The position, size and shape of the raindrops are randomly generated and drawn onto the image. The number and speed of the raindrops can also be adjusted through parameters. By adding the raindrop effect, a series of water gauge images simulating rainy environments can be generated, which not only increases the diversity of the data, but also enables the model to learn the ability to accurately identify water gauge readings under complex conditions such as raindrop occlusion and light scattering.
[0055] Step 203: Rotate the target image to simulate the tilt of the water gauge.
[0056] In this step, by rotating the target image, a series of images simulating the tilt of the water gauge can be generated. These images enable the model to learn the ability to accurately identify the water gauge scale and readings at different tilt angles during the training process.
[0057] It can be understood that before acquiring the target video of the multi-level water gauge through the 3D camera, the method may further include: Step 01: introducing ECA-Attention to the tail end of the yolov8 network backbone network structure, replacing the 2nd, 3rd, and 4th C2f structures in the Backbone of the yolov8 network;
[0058] In this step, when obtaining the water gauge image, the proportion of pixels occupied by digits 0-9 is too small, and the water gauge carries a lot of red and blue information. Therefore, the embodiment of the present application introduces the convolutional attention module ECA-Attention into the deep neural network to improve the performance of the model, such as Figure 3As shown in the figure, the image or data is input (input), and then the input feature map is globally averaged (Global Average Pooling), and the average value of all elements in each channel is calculated to obtain a feature vector with lower dimension but important information. Global average pooling helps to reduce the amount of calculation while retaining spatial information. The convolution layer (Conv) is a key layer for extracting features in the neural network. The Sigmoid activation function is used to convert the output of the convolution layer (usually linear) into nonlinearity, which helps the network learn complex nonlinear mapping relationships. The multiplication layer (multiply) multiplies the elements at corresponding positions and finally outputs (output). The specific joining position is the tail end of the C2f structure (the backbone network structure in the YOLOv8 model), as shown in Figure 4 As shown in Figure 1, the bottleneck layer is used to reduce the computational complexity and parameter redundancy by reducing the number of parameters or feature dimensions while maintaining or increasing the model representation capability. The modified C2f structure replaces the 2nd, 3rd, and 4th C2f structures in the Backbone of the original network, as shown in Figure 1. Figure 5 shown.
[0059] Step 02: Add downsampling Adown to get the improved yolov8 network.
[0060] In this step, the latest downsampling method Adown is added, such as Figure 6 As shown in the figure, the data or image input (input) first passes through the average pooling layer (AvgPool2d), which reduces the spatial dimension of the data by calculating the average value in the input area, while keeping the depth (number of channels) of the data unchanged, which helps to reduce the amount of calculation while retaining important feature information; after the average pooling layer, the data is split (Split) into two parts, one part passes through the maximum pooling layer (MaxPool2d) again, which is a downsampling method different from average pooling. It reduces the spatial dimension by selecting the maximum value in the input area, and the other part passes through the convolution block (CBS). The two parts of data after different processing paths are connected (Concat), which can be achieved by splicing their depth (number of channels), so that the features of the two parts of data can be used simultaneously in subsequent processing; finally, the connected data is used as the output (output) of the entire process.
[0061] Add the latest downsampling method Adown and replace the backbone downsampling module, such as Figure 5As shown in the figure, the established data set can be trained and debugged using the Yolov8 instance segmentation network using the A10 graphics card to obtain a trained model. ADown can effectively reduce the spatial dimension of the data by using average pooling, maximum pooling, and convolution blocks, while retaining and extracting key feature information and reducing the number of parameters to reduce the complexity of the model, especially for a considerable number of frame images, which helps to improve the operating efficiency of the model, especially in resource-constrained environments, reducing the overall amount of calculation in an efficient way with little impact on performance; the Adown downsampling method retains more image details and feature information through a more sophisticated sampling strategy, which is particularly important for tasks such as water gauge readings that require high-precision positioning.
[0062] That is to say, Figure 5 As shown in the figure, the improved yolov8 network starts with a convolution layer Conv, which is used to extract the features of the image and perform multiple convolution operations. Then, the image passes through the ECA-C2f layer, which is a custom layer that combines the ECA mechanism and the C2f operation to enhance the expressiveness of the features; further, the image passes through the Concat layer, which is used to stitch together multiple feature maps with different details, slight differences in perspective and position to increase the diversity of features; the Upsample layer is used to increase the resolution of the image and make the feature map larger in the spatial dimension, which helps to retain more detail information; the ADown layer is used to reduce the size of the image to reduce the amount of calculation and extract higher-level features; then, a repeated structure is formed to gradually extract deeper features.
[0063] Furthermore, the method may also include: Step 03: installing a 3D camera, wherein the angle between the 3D camera and the top of the lowest water level gauge is no greater than 20 degrees, and the angle between the 3D camera and the straight line where the multi-level water level gauges are located is no greater than 30 degrees.
[0064] In this step, the 3D camera is installed facing the water level gauge. The camera is required to have a variable angle and focal length, and the camera should be able to cover and capture multiple levels of water level gauges.
[0065] Step 04: Set lens preset points for the multi-level water gauge based on the reference water level.
[0066] In this step, when starting to read, all preset points can be traversed to find the preset point of the lowest reference water level, and the lens can be fixed to this preset point. When the reading of this preset point disappears, it means that the water level has risen above this preset point, then the lens will be horizontally rotated to the preset point one level higher than the reference water level. If the water level reading of this preset point is always the current reference water level, then the lens will be moved to the preset point one level lower than the reference water level, so that the staff can have a general understanding of the current water level range at the first time when they see the corresponding water level. In specific implementation, video can be obtained in real time, or video can be obtained in a preset time period, and the obtained water level reading can be pushed to the front end. If the current water level rises or falls too fast, and exceeds the warning water level line, an early warning will be automatically triggered, and the speed and warning water level line can be determined according to actual conditions.
[0067] As another optional embodiment, the method may also include: when the target image does not reach a preset number, using a generative adversarial network to expand the data, the generative adversarial network includes a generator and a discriminator; the generator learns and imitates the distribution characteristics of the target image data in the training set to form new data; the discriminator determines whether the new data source comes from the training set.
[0068] In this step, when the camera installation time is short, the number of cameras is small, or the camera image quality is not clear enough, the image can be generated; Figure 7 As shown in the figure, both the generator and the discriminator are a kind of neural network model. The task of the generator network is to generate distribution based on a set of random noise data to form new data; the task of the discriminator network is to evaluate whether the newly generated data is real, that is, whether it comes from the real training set; the GAN (Generative Adversarial Networks) network can expand the data in large quantities, and the image clarity can also be enhanced. It has strong operability and can learn various data features without supervision.
[0069] Finally, the water gauge reading results are as follows Figure 8 shown.
[0070] The above is an embodiment of the method proposed in this application. Based on the same inventive concept, the embodiment of this application also provides a multi-level water gauge reading device with an improved yolov8 network, whose structure is as follows: Fig. 9 shown.
[0071] Fig. 9 A schematic diagram of the internal structure of a multi-level water gauge reading device with an improved yolov8 network provided in an embodiment of the present application. Fig. 9 As shown, the device includes:
[0072] at least one processor 901;
[0073] and, a memory 902 communicatively connected to at least one processor;
[0074] Among them, the memory 902 stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor 901 so that the at least one processor 901 can: obtain the target video of the multi-level water gauge through a 3D camera; extract frames of the target video to obtain the target image, and determine whether the target image reaches a preset number; when the target image reaches a preset number, use X-Anylable to mark the target image to obtain the target label; input the target label into the improved yolov8 network to obtain the location information of the target label and the confidence corresponding to the location information; calculate the location information and the confidence to obtain the water gauge reading.
[0075] Some embodiments of the present application provide corresponding Figure 1 A non-volatile computer storage medium for multi-level water gauge readings based on an improved yolov8 network is provided, wherein computer executable instructions are stored therein, and the computer executable instructions are set to: obtain a target video of a multi-level water gauge through a 3D camera; extract frames of the target video to obtain a target image, and determine whether the target image reaches a preset number; when the target image reaches a preset number, use X-Anylable to mark the target image to obtain a target label; input the target label into the improved yolov8 network to obtain the position information of the target label and the confidence corresponding to the position information; calculate the position information and the confidence to obtain the water gauge reading.
[0076] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the IoT device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0077] The system and medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the system and medium also have similar beneficial technical effects to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.
[0078] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0079] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0080] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0081] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0082] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0083] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0084] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0085] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0086] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A multi-level water gauge reading method based on an improved yolov8 network, characterized in that: The method comprises: Obtain target video of multi-level water gauge through 3D camera; Extract frames from the target video to obtain target images, and determine whether the target images reach a preset number; When the target images reach a preset number, use X-Anylable to annotate the target images to obtain target labels; Input the target tag into the improved yolov8 network to obtain the location information of the target tag and the confidence level corresponding to the location information; The position information and the confidence level are calculated to obtain a water gauge reading.
2. A multi-level water gauge reading method based on an improved yolov8 network according to claim 1, characterized in that: The target tag is input into the improved yolov8 network to obtain the location information of the target tag and the confidence level corresponding to the location information, specifically including: Identify the multi-level water gauge and the numbers contained in the multi-level water gauge to obtain a water gauge label and a digital label; Classify the water gauge labels and digital labels into training sets, test sets, and validation sets; Importing the training set into the improved yolov8 network for training; Draw a rectangular frame for the digital label to obtain a digital detection frame and a confidence level, wherein the digital detection frame includes top frame coordinates and bottom frame coordinates; The digital detection frame of each water gauge is sorted according to the bottom frame coordinates and the confidence level to obtain a vertical position list and a confidence level list.
3. A multi-level water gauge reading method based on an improved yolov8 network according to claim 2, characterized in that: The position information and the confidence level are calculated to obtain the water gauge reading, specifically including: Determine whether there is abnormal position information in the vertical position list, the abnormal position information including overlapping of digital detection frames and missing of digital detection frames, and a confidence level lower than a first preset threshold; In the absence of abnormal position information, the bottom frame coordinate difference of the digital detection frame is calculated, and the proportional relationship with the corresponding water ruler is calculated; The bottom frame coordinates of the digital detection frame closest to the water level line are found, and the first water gauge reading of the water level line is obtained according to the proportional relationship.
4. A multi-level water gauge reading method based on an improved yolov8 network according to claim 3, characterized in that: The method further comprises: Calculate the difference in bottom frame coordinates of the first two digits of the confidence list, and calculate the proportional relationship with the corresponding water ruler; Find the bottom frame coordinates of the digital detection frame closest to the water level line, and obtain the second water gauge reading of the water level line according to the proportional relationship; If the difference between the first water gauge reading and the second water gauge reading exceeds a second preset threshold, the second water gauge reading is selected as the final water gauge reading.
5. A multi-level water gauge reading method based on an improved yolov8 network according to claim 2, characterized in that: After extracting frames from the target video to obtain the target image, the method further includes: Set the random Gamma interval value, and simulate the light intensity according to the random Gamma interval value; Setting raindrop parameters through Randomrain, the raindrop parameters include quantity and speed; The target image is rotated by Rotate to simulate the tilt of the water gauge.
6. A multi-level water gauge reading method based on an improved yolov8 network according to claim 1, characterized in that: Before acquiring the target video of the multi-level water gauge through the 3D camera, the method further includes: Introduce ECA-Attention to the tail end of the yolov8 network backbone network structure, replacing the 2nd, 3rd, and 4th C2f structures in the Backbone of the yolov8 network; Add downsampling Adown to obtain the improved yolov8 network.
7. A multi-level water gauge reading method based on an improved yolov8 network according to claim 6, characterized in that: The method further comprises: Install a 3D camera, wherein the angle between the 3D camera and the top of the lowest water gauge is no greater than 20 degrees, and the angle between the 3D camera and the straight line where the multi-level water gauge is located is no greater than 30 degrees; According to the reference water level, set lens preset points for the multi-level water gauge.
8. A multi-level water gauge reading method based on an improved yolov8 network according to claim 1, characterized in that: The method further comprises: When the target images do not reach a preset number, a generative adversarial network is used for data expansion, wherein the generative adversarial network includes a generator and a discriminator; The generator learns and imitates the distribution characteristics of the target image data in the training set to form new data; The discriminator determines whether the new data source comes from the training set.
9. A multi-level water gauge reading device based on an improved yolov8 network, characterized in that: The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: Obtain target video of multi-level water gauge through 3D camera; Extract frames from the target video to obtain target images, and determine whether the target images reach a preset number; When the number of target images reaches a preset number, the target images are labeled using X-Anylable to obtain target labels; Input the target tag into the improved yolov8 network to obtain the location information of the target tag and the confidence level corresponding to the location information; The position information and the confidence level are calculated to obtain a water gauge reading.
10. A non-volatile computer storage medium for multi-level water gauge readings of an improved yolov8 network, storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Obtain target video of multi-level water gauge through 3D camera; Extract frames from the target video to obtain target images, and determine whether the target images reach a preset number; When the number of target images reaches a preset number, the target images are labeled using X-Anylable to obtain target labels; Input the target tag into the improved yolov8 network to obtain the location information of the target tag and the confidence level corresponding to the location information; The position information and the confidence level are calculated to obtain a water gauge reading.
Citation Information
Patent Citations
Method and device for improving water gauge water level detection accuracy and storage medium
CN116740536A
Method and device for improving water gauge water level identification response speed and storage medium
CN116883808A
Water gauge reading identification method, system and device based on holder dome camera and medium
CN118053103A
Text detection method based on rotating frame
CN118314563A
