Water Level Measurement Approach Using Monocular Vision with Piecewise Linear Fitting Algorithm
Abstract
1. Introduction
- (1)
- The improved MCUnet model enables accurate segmentation of water level lines, overcomes the poor real-time performance inherent in conventional water level measurement techniques, and improves measurement precision. This method effectively minimizes casualties and property losses, furnishing dependable technical support for practical engineering applications.
- (2)
- The proposed piecewise linear fitting algorithm for water level computation overcomes the limitations of traditional water level measurement such as strict hardware demands, high deployment and maintenance expenditure, and cumbersome data processing.
- (3)
- In contrast to existing segmentation approaches, the proposed method retains satisfactory accuracy with no specialized hardware for data collection, marking a core contribution of this work.
2. Data Acquisition and Model Enhancement
2.1. Data Acquisition
2.2. Segmented Linear Fitting for Water Level Calibration
2.3. Principle of Piecewise Linear Fitting for Water Level Measurement
2.4. Introduction of MobileNet V2
2.5. Introduction of Coordinate Attention Mechanism
2.6. Introduction of MCUnet
2.7. Experimental Environment and Configuration
2.8. Evaluation Metrics
3. Experimental Results and Analysis
3.1. Comparative Visualization of Segmentation Results
3.2. Analysis of Ablation Experiment Results
3.3. Comparative Analysis of Different Models
3.4. Comparative Analysis of Water Level Measurement Results
3.5. Model Performance Under Varying Water Levels
3.6. Experimental Results of Comparison on Model Lightweight and Inference Efficiency
4. Discussions
4.1. Performance Differences from Comparative Methods
4.2. Analysis of Limitations in Practical Engineering Applications
4.3. Discussion on Transferability and Generalization of the Proposed Framework
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Zakharova, E.A.; Krylenko, I.N.; Sazonov, A.A.; Semenova, N.K.; Lisina, A.A. Water level regime of Arctic rivers according to modeling and satellite measurements. Russ. Meteorol. Hydrol. 2023, 48, 1076–1083. [Google Scholar] [CrossRef]
- Mohindru, P. Development of liquid level measurement technology: A review. Flow Meas. Instrum. 2023, 89, 102295. [Google Scholar]
- Chetpattananondh, K.; Tapoanoi, T.; Phukpattaranont, P.; Jindapetch, N. A self-calibration water level measurement using an interdigital capacitive sensor. Sens. Actuators A Phys. 2014, 209, 175–182. [Google Scholar] [CrossRef]
- Lee, Y.T.; Kwon, I.H. Development of capacitive water level sensor system for boiler. J. Semicond. Disp. Technol. 2021, 20, 103–107. [Google Scholar]
- Wei, Q.; Kim, M.J.; Lee, J.H. Development of capacitive sensor for automatically measuring tumbler water level with FEA simulation. Technol. Health Care 2018, 26, S491–S500. [Google Scholar] [CrossRef]
- Loizou, K.; Koutroulis, E. Water level sensing: State of the art review and performance evaluation of a low-cost measurement system. Measurement 2016, 89, 204–214. [Google Scholar] [CrossRef]
- Areekath, L.; Lodha, G.; Sahana, S.K.; George, B.; Philip, L.; Mukhopadhyay, S.C. Feasibility of a planar coil-based inductive-capacitive water level sensor with a quality-detection feature: An experimental study. Sensors 2022, 22, 5508. [Google Scholar] [CrossRef] [PubMed]
- Hong, S.T.; Shin, G.W. Mathematical Model Expression of Portable Calibration System for Float Type Water Level Meters. J. Korea Inst. Inf. Commun. Eng. 2017, 21, 1964–1972. [Google Scholar]
- Majdalani, S.; Chazarin, J.P.; Moussa, R. A new water level measurement method combining infrared sensors and floats for applications on laboratory scale channel under unsteady flow regime. Sensors 2019, 19, 1511. [Google Scholar] [CrossRef] [PubMed]
- Kim, D.S.; Han, J.M.; Park, G.S. Optimal design of dual magnetic float type level gauge to detect a specific level. J. Sens. Sci. Technol. 2008, 17, 308–316. [Google Scholar] [CrossRef]
- Wang, M.; Chen, W.Z.; Fan, G.M. Investigation on Transient Characteristics of High Pressure Vessel Water Level Measurement. Front. Energy Res. 2021, 9, 609320. [Google Scholar] [CrossRef]
- Gribovszki, Z.; Kalicz, P.; Szilágyi, J. Does the accuracy of fine-scale water level measurements by vented pressure transducers permit for diurnal evapotranspiration estimation? J. Hydrol. 2013, 488, 166–169. [Google Scholar] [CrossRef]
- Sengupta, D.; Shankar, M.S.; Reddy, P.S.; Prasad, R.S.; Srimannarayana, K. An FBG based hydrostatic pressure sensor for liquid level measurements. In Microstructured and Specialty Optical Fibres; Society of Photo-Optical Instrumentation Engineers: Bellingham, WA, USA, 2012; pp. 80–84. [Google Scholar]
- Maria de Fátima, F.D.; de Brito Paixão, T.; Mesquita, E.F.T.; Alberto, N.; Frias, A.R.; Ferreira, R.A.; Varum, H.; da Costa Antunes, P.F.; de Brito Andre, P.S. Liquid hydrostatic pressure optical sensor based on micro-cavity produced by the catastrophic fuse effect. IEEE Sens. J. 2015, 15, 5654–5658. [Google Scholar] [CrossRef]
- Terzic, E.; Nagarajah, R.; Alamgir, M. A neural network approach to fluid quantity measurement in dynamic environments. Mechatronics 2011, 21, 145–155. [Google Scholar] [CrossRef]
- de Almeida, G.G.; Barreto, R.C.; Seidel, K.F.; Kamikawachi, R.C. A fiber Bragg grating water level sensor based on the force of buoyancy. IEEE Sens. J. 2019, 20, 3608–3613. [Google Scholar]
- Schenato, L.; Aguilar-Lopez, J.P.; Galtarossa, A.; Pasuto, A.; Bogaard, T.; Palmieri, L. A rugged FBG-based pressure sensor for water level monitoring in dikes. IEEE Sens. J. 2021, 21, 13263–13271. [Google Scholar] [CrossRef]
- Pereira, T.S.R.; de Carvalho, T.P.; Mendes, T.A.; Formiga, K.T.M. Evaluation of water level in flowing channels using ultrasonic sensors. Sustainability 2022, 14, 5512. [Google Scholar] [CrossRef]
- Guan, S.; Bridge, J.A.; Davis, J.R.; Li, C.Z. Compact continuous wave radar for water level monitoring. J. Atmos. Ocean. Technol. 2022, 39, 1245–1257. [Google Scholar] [CrossRef]
- Ansari, I.; Jeong, Y.; Lee, Y.; Shim, J. Water level tracking system based on morphology and template matching. J. Korea Multimed. Soc. 2018, 21, 1431–1438. [Google Scholar]
- Dou, G.; Chen, R.S.; Han, C.T.; Liu, Z.W.; Liu, J.F. Research on water-level recognition method based on image processing and convolutional neural networks. Water 2022, 14, 1890. [Google Scholar] [CrossRef]
- Lee, J.H.; Jung, J.K. Development of image-based water level sensor with high-resolution and low-cost using image processing algorithm: Application to outgassing measurements from gas-enriched polymer. Sensors 2024, 24, 7699. [Google Scholar] [PubMed]
- Liu, M.T.; Yue, S.; Li, S.; Du, Y.Y.; Li, B. Research on intelligent detection of concrete aggregate level based on monocular imaging. Measurement 2022, 194, 111036. [Google Scholar] [CrossRef]
- Liu, Y.J.; Yue, S.; Wang, X.C.; Zhang, J.H.; Wang, G.H.; Liu, M.T.; Shangguan, L.J. Mapping of sand and gravel aggregate level height and volume measurement based on contour mapping generation. Signal Image Video Process. 2024, 18, 2865–2878. [Google Scholar] [CrossRef]
- Liu, Y.J.; Yue, S.; Li, B.; Wang, G.H.; Liu, M.T.; Zhang, J.H.; Shangguan, L.J. Fast and intelligent measurement of concrete aggregate volume based on monocular vision mapping. J. Real-Time Image Process. 2023, 20, 101. [Google Scholar] [CrossRef]
- Akkaya, I.; Arslan, O.; Rolland, J.P. Automated and highly precise surface wetting contact angle measurement with optical coherence tomography based on deep learning model. Measurement 2025, 253, 117788. [Google Scholar] [CrossRef]
- Zhang, M.Y.; Yu, S.; Hu, Z.L.; Xia, K.Y.; Wang, J.X.; Zhu, H.N. Sound source localization with sparse Bayesian-based feature matching via deep transfer learning in shallow sea. Measurement 2025, 253, 117873. [Google Scholar] [CrossRef]
- Meng, J.J.; Yuan, X.L.; Wang, G.; Li, X.K.; Zhao, E.P.; Li, J.R.; Fang, H.M.; Li, B.; Li, C.; Zhao, D.J.; et al. Automatic surface roughness recognition system under different manufacturing processes based on deep learning. Measurement 2025, 253, 117473. [Google Scholar] [CrossRef]
- Chen, J.H.; Huang, Z.W.; Hu, B.; Ke, H.B.; Lin, M.; Wang, Q.W. Visualization and monitoring dynamic water levels of steam generators based on deep learning. Prog. Nucl. Energy 2024, 169, 105052. [Google Scholar] [CrossRef]
- Li, J.L.; Tong, C.Y.; Yuan, H.X.; Huang, W.N. A Complex Environmental Water-Level Detection Method Based on Improved YOLOv5m. Sensors 2024, 24, 5235. [Google Scholar] [CrossRef] [PubMed]
- Chen, C.; Fu, R.F.; Ai, X.J.; Huang, C.B.; Cong, L.; Li, X.H.; Jiang, J.G.; Pei, Q.Q. An integrated method for river water level recognition from surveillance images using convolution neural networks. Remote Sens. 2022, 14, 6023. [Google Scholar] [CrossRef]
- Liang, L.; Huang, W.; Awan, M.L.; Parveen, A.; Li, R.P.; Bi, F.G.; Shao, J.H.; Liang, X.Y.; Wu, C.H.; Liu, Z.Q. Study and application of image water level recognition calculation method based on mask R-CNN and raster R-CNN. Appl. Ecol. Environ. Res. 2023, 21, 5039–5053. [Google Scholar] [CrossRef]
- Zhang, P.; Yan, Y.M.; Ai, Y.G.; Wang, B.H.; Shen, H.M.; Peng, Z.H. Unet-based image segmentation and binarization for water level detection. Vis. Comput. 2025, 41, 7367–7377. [Google Scholar]
- Liu, M.T.; Wang, C.C.; Huang, W.; Wang, X.C.; Li, S.H.; Lu, P.; Liu, X.M.; Jiang, E.H. Research on water level measurement technology based on the residual length ratio of image characters. Signal Image Video Process. 2024, 18, 57–70. [Google Scholar] [CrossRef]
- Muhadi, N.A.; Abdullah, A.F.; Bejo, S.K.; Mahadi, M.R.; Mijic, A. Deep learning semantic segmentation for water level estimation using surveillance camera. Appl. Sci. 2021, 11, 9691. [Google Scholar] [CrossRef]
- Hou, Q.B.; Zhou, D.Q.; Feng, J.S. Coordinate attention for efficient mobile network design. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE Computer Society: Los Alamitos, CA, USA, 2021; pp. 13713–13722. [Google Scholar]
- Wang, Q.L.; Wu, B.G.; Zhu, P.F.; Li, P.H.; Zuo, W.M.; Hu, Q.H. ECA-Net: Efficient channel attention for deep convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE Computer Society: Los Alamitos, CA, USA, 2020; pp. 11534–11542. [Google Scholar]
- Zhang, Y.H.; Wei, X.X.; Wang, Y.S. MDAB-UNet: A lightweight and efficient improved UNet architecture for remote sensing image segmentation. J. Real-Time Image Process. 2026, 23, 103. [Google Scholar] [CrossRef]
- Fang, W.; Fu, Y.X.; Sheng, V.S. FPS-U2Net: Combining U2Net and multi-level aggregation architecture for fire point segmentation in remote sensing images. Comput. Geosci. 2024, 189, 105628. [Google Scholar] [CrossRef]
- Zheng, L.; Liu, L.; Lu, J.; Tian, J.; Cheng, Y.; Yin, W. Research on distance measurement of vehicles in front of campus patrol vehicles based on monocular vision. Pattern Anal. Appl. 2024, 27, 146. [Google Scholar] [CrossRef]







| Laboratory Equipment | Specification |
|---|---|
| Operating System | Windows 11 |
| Development Environment | CUDA 12.0 |
| GPU | NVIDIA GeForce RTX 4060 |
| CPU | 12th Gen Intel(R) Core(TM) i7-12650H |
| Epoch | 500 |
| Batch_size | 4 |
| Model | FPS | P | R | F1-Score | AUC |
|---|---|---|---|---|---|
| MCUnet | 45 | 88.12 | 78.09 | 82.80 | 91.42 |
| Unet | 34 | 82.35 | 70.51 | 75.97 | 84.07 |
| C-Unet | 34 | 83.58 | 71.89 | 77.35 | 85.03 |
| M-Unet | 42 | 84.12 | 72.35 | 77.85 | 85.21 |
| Model | P | R | F1-Score | AUC |
|---|---|---|---|---|
| DeepLab | 83.65 | 71.12 | 76.87 | 85.12 |
| U2net | 85.31 | 71.68 | 77.90 | 86.34 |
| Unet | 82.35 | 70.51 | 75.97 | 84.07 |
| M-ECA-Unet | 85.93 | 75.47 | 80.35 | 88.93 |
| MCUnet | 88.12 | 78.09 | 82.80 | 91.42 |
| Error Type | MCUnet Error | Unet Error | U2net Error | Deeplab Error |
|---|---|---|---|---|
| Mean absolute error (cm) | 1.69 | 5.11 | 3.78 | 4.53 |
| Maximum absolute error (cm) | 2.20 | 6.20 | 4.90 | 5.60 |
| Root mean square error (cm) | 1.73 | 5.18 | 3.88 | 4.59 |
| Model | Water Level Group | F1-Score | MAE (cm) | RMSE | MaxAE |
|---|---|---|---|---|---|
| MCUnet | Low Water Level | 85.1 | 2.1 | 2.3 | 3.5 |
| Normal Water Level | 89.5 | 1.5 | 1.7 | 2.8 | |
| High Water Level | 87.3 | 1.8 | 2 | 3.1 | |
| Unet | Low Water Level | 70.3 | 6.5 | 6.8 | 9.2 |
| Normal Water Level | 83.1 | 4.8 | 5.1 | 7.5 | |
| High Water Level | 76.2 | 5.9 | 6.2 | 8.8 | |
| U2net | Low Water Level | 75.6 | 4.8 | 5 | 7.1 |
| Normal Water Level | 85.7 | 3.5 | 3.8 | 5.9 | |
| High Water Level | 79.1 | 4.2 | 4.5 | 6.5 | |
| Deeplab | Low Water Level | 72.8 | 5.7 | 6 | 8.4 |
| Normal Water Level | 84.3 | 4.2 | 4.5 | 6.7 | |
| High Water Level | 77.5 | 5.1 | 5.4 | 7.9 |
| Model | Parameter Quantity (M) | GFLOPs | Model File Size (MB) | Memory Usage (MB) | End-to-End Latency (ms) | FPS |
|---|---|---|---|---|---|---|
| MCUnet | 4.2 | 8.2 | 16.8 | 1024 | 22 | 45 |
| Unet | 17.3 | 55.6 | 69.2 | 1450 | 29 | 34 |
| U2net | 44.5 | 218.3 | 178 | 2100 | 33 | 30 |
| Deeplab | 39.7 | 145.4 | 158.8 | 1950 | 30 | 33 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Zhou, D.; Wang, X.; Si, K.; Liu, M.; Ge, M.; Li, Z.; Shao, J. Water Level Measurement Approach Using Monocular Vision with Piecewise Linear Fitting Algorithm. Water 2026, 18, 1557. https://doi.org/10.3390/w18131557
Zhou D, Wang X, Si K, Liu M, Ge M, Li Z, Shao J. Water Level Measurement Approach Using Monocular Vision with Piecewise Linear Fitting Algorithm. Water. 2026; 18(13):1557. https://doi.org/10.3390/w18131557
Chicago/Turabian StyleZhou, Dong, Xiaochen Wang, Kai Si, Mingtang Liu, Mengmeng Ge, Zhixin Li, and Jinggan Shao. 2026. "Water Level Measurement Approach Using Monocular Vision with Piecewise Linear Fitting Algorithm" Water 18, no. 13: 1557. https://doi.org/10.3390/w18131557
APA StyleZhou, D., Wang, X., Si, K., Liu, M., Ge, M., Li, Z., & Shao, J. (2026). Water Level Measurement Approach Using Monocular Vision with Piecewise Linear Fitting Algorithm. Water, 18(13), 1557. https://doi.org/10.3390/w18131557

