Dynamic Multi-Parameter Sensing Technology for Ecological Flows Based on the Improved DSC-YOLOv8n Model
Abstract
1. Introduction
2. Real-Time Water Level Detection Using Image Recognition Technology
2.1. Image Affine Transformation Rotation Correction
- (1)
- When extracting the area in which the staff gauge is located from the image, the minimum border box of the labeling tool is used to label and extract the staff gauge to reduce interference from the external environment.
- (2)
- As the image of the staff gauge in the extraction area is a color (RGB) image, it must be converted into a grayscale image for further analysis. The Canny method is used to automatically select the threshold for binarization and obtain a binary staff gauge image [17].
- (3)
- Edge detection is used to identify the image edges, followed by the Hough transform for line detection, after which the inclination of the extracted binary image is calibrated. After converting all of the data in the experimental dataset, the average value of the extracted inclination angles is calculated as the inclination angle of the staff gauge in the image [18].
- (4)
- For the extracted minimum bounding box staff gauge image, the coordinates of the upper-left corner of the bounding box are set as (, ), with a height of and width of (Figure 1a). Based on these parameters, the coordinates of the rotation center can be determined as (, ). To obtain the corrected staff gauge image, an affine transformation function is applied to rotate the original image around the calculated rotation center by , the value of which is the averaged tilt angle obtained in the previous step, thereby aligning the staff gauge perpendicular to the water surface (Figure 1b). The rotational transformation principle is described as follows:

2.2. Grayscale Imaging
2.3. Image Binarization
2.4. Water Level Determination
- (1)
- A training set containing the actual water level gauge height and the corresponding water level values in the images is created. Potential adverse effects caused by individual sample data are eliminated by normalizing the data to a range of 0–1.
- (2)
- A linear regression model is established.
- (3)
- The model is trained and tested to obtain the optimal model, and the weight, , and deviation, b, of the model are obtained.
3. Real-Time Velocity Detection Based on Spatio-Temporal and Spectral Deep Learning Analysis
3.1. Spatio-Temporal Image Generation
3.2. Texture Angle Recognition Method
4. Real-Time Water Level and Flow Rate Detection Method
4.1. Hydrological Data Preprocessing
4.2. Staff Gauge Detection Evaluation Indices
4.3. Design of Flow Rate Detection Experiments and Evaluation Indices
5. Comparison of Test Results and Performance Analysis
5.1. Staff Gauge Detection Experiment
- (1)
- Fusion experiment
- (2)
- Comparison between the basic YOLOv8n model and DSC-YOLOv8n-seg
- (3)
- Comparison between DSC-YOLOv8n-seg and other models
5.2. Flow Rate Detection Experiment
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Liu, S.; Zhang, Q.; Xie, Y.; Xu, P.; Du, H. Evaluation of Minimum and Suitable Ecological Flows of an Inland Basin in China Considering Hydrological Variation. Water 2023, 15, 649. [Google Scholar] [CrossRef]
- Mo, C.; Wang, H.; Lai, S.; Huang, Y.; Gao, W.; Tang, L.; Zhong, S. Early Warning Forecasting of River Ecological Flow in a Typical Karst Basin, Southwest China: Leveraging Baseflow Segmentation and Interpretable Machine Learning. J. Hydrol. Reg. Stud. 2025, 59, 102433. [Google Scholar] [CrossRef]
- Zhang, Q.; Zhang, Z.; Shi, P.; Singh, V.P.; Gu, X. Evaluation of Ecological Instream Flow Considering Hydrological Alterations in the Yellow River Basin, China. Glob. Planet. Change 2017, 160, 61–74. [Google Scholar] [CrossRef]
- Ni, X.; Dong, Z.; Xie, W.; Wu, S.; Chen, M.; Yao, H.; Jia, W. A Practical Approach for Environmental Flow Calculation to Support Ecosystem Management in Wujiang River, China. Int. J. Environ. Res. Public Health 2022, 19, 11615. [Google Scholar] [CrossRef]
- Wynants, M.; Hallberg, L.; Prischl, L.A.; Livsey, J.; Bieroza, M. Trends and Purposes of European River Monitoring and Restoration. Environ. Sci. Policy 2025, 170, 104130. [Google Scholar] [CrossRef]
- Sahoo, D.P.; Sahoo, B.; Tiwari, M.K.; Behera, G.K. Integrated Remote Sensing and Machine Learning Tools for Estimating Ecological Flow Regimes in Tropical River Reaches. J. Environ. Manag. 2022, 322, 116121. [Google Scholar] [CrossRef]
- Fang, C.; Yuan, G.; Zheng, Z.; Zhong, Q.; Duan, K. Technical Note: Monitoring Discharge of Mountain Streams by Retrieving Image Features with Deep Learning. Hydrol. Earth Syst. Sci. 2024, 28, 4085–4098. [Google Scholar] [CrossRef]
- Porras, A.A.; Jin, Y.H.; Peacock, E.; Avila, Y.; Chu, A.N.; Mahaseth, H.; Santiago, A.L.; Siegmund, J.G. Expanding an Urban Stream Ecological Monitoring System with Functional Data and Deep Learning. Freshw. Sci. 2024, 43, 189–205. [Google Scholar] [CrossRef]
- Li, M.; Zhao, C.; Huang, Q.; Pan, T.; Yesou, H.; Nerry, F.; Li, Z.L. Combining Landsat 5 TM and UAV Images to Estimate River Discharge with Limited Ground-Based Flow Velocity and Water Level Observations. Remote Sens. Environ. 2025, 318, 114610. [Google Scholar] [CrossRef]
- Campos Filho, L.C.P.; Figueiredo, N.M.d.; Blanco, C.J.C.; Tobias, M.S.G.; Afonso, P. Machine Learning for the Sustainable Management of Depth Prediction and Load Optimization in River Convoys: An Amazon Basin Case Study. Sustainability 2024, 16, 8517. [Google Scholar] [CrossRef]
- Fu, B.; Liu, Y.; Li, Y.; Wang, C.; Li, C.; Jiang, W.; Hua, T.; Zhao, W. The Research Priorities of Resources and Environmental Sciences. Geogr. Sustain. 2021, 1, 87–94. [Google Scholar] [CrossRef]
- Wang, X.; Li, Z.; Zhang, Y.; An, G. Water Level Recognition Based on Deep Learning and Character Interpolation Strategy for Stained Water Gauge. River 2023, 2, 506–517. [Google Scholar] [CrossRef]
- Manfreda, S.; Miglino, D.; Saddi, K.C.; Jomaa, S.; Eltner, A.; Perks, M.; Peña-Haro, S.; Bogaard, T.; van Emmerik, T.H.; Mariani, S.; et al. Advancing River Monitoring Using Image-Based Techniques: Challenges and Opportunities. Hydrol. Sci. J. 2024, 69, 657–677. [Google Scholar] [CrossRef]
- Ding, Z.; Zheng, K.; Zhao, R.; Mei, J.; Hou, L. Design and Implementation of an IoT System for Monitoring Ecological Environment. IEEE Access 2024, 12, 141324–141334. [Google Scholar] [CrossRef]
- Huang, Y.; Chen, H.; Liu, B.; Huang, K.; Wu, Z.; Yan, K. Radar Technology for River Flow Monitoring: Assessment of the Current Status and Future Challenges. Water 2023, 15, 1904. [Google Scholar] [CrossRef]
- Kim, J.D.; Han, Y.J.; Hahn, H.S. Image-Based Water Level Measurement Method under Stained Ruler. J. Meas. Sci. Instrum. 2010, 1, 28–31. [Google Scholar]
- Tawfeeq, N.; Harbi, J. Using the Canny Method with Deep Learning for Detect and Predict River Water Level. J. Al-Qadisiyah Comput. Sci. Math. 2024, 16, 135–150. [Google Scholar] [CrossRef]
- Zhao, K.; Han, Q.; Zhang, C.-B.; Xu, J.; Cheng, M.-M. Deep Hough Transform for Semantic Line Detection. IEEE Trans. Pattern Anal. Mach. Intell. 2022, 44, 4793–4806. [Google Scholar] [CrossRef] [PubMed]
- Zhang, W.; Jin, S.; Zhuang, P.; Liang, Z.; Li, C. Underwater Image Enhancement via Piecewise Color Correction and Dual Prior Optimized Contrast Enhancement. IEEE Signal Process. Lett. 2023, 30, 229–233. [Google Scholar] [CrossRef]
- Li, Z.; Yin, C.; Zhang, X. Crack Segmentation Extraction and Parameter Calculation of Asphalt Pavement Based on Image Processing. Sensors 2023, 23, 9161. [Google Scholar] [CrossRef]
- Jiang, X.; Tong, Z.; Yu, Z.; Jiang, P.; Xu, L.; Wu, L.; Chen, M.; Zhang, Y.; Zhang, J.; Yang, X. Fourier Single-Pixel Imaging Based on Online Modulation Pattern Binarization. Photonics 2023, 10, 963. [Google Scholar] [CrossRef]
- Rezanezhad, V.; Baierer, K.; Neudecker, C. A Hybrid CNN-Transformer Model for Historical Document Image Binarization. In Proceedings of the 7th International Workshop on Historical Document Imaging and Processing, New York, NY, USA, 25–26 August 2023. [Google Scholar]
- Michalak, H.; Krupiński, R.; Lech, P.; Okarma, K. Preprocessing of Document Images Based on the GGD and GMM for Binarization of Degraded Ancient Papyri Images. In Progress in Image Processing, Pattern Recognition and Communication Systems; Springer: Cham, Switzerland, 2022. [Google Scholar]
- Kang, K.U.S. Complex Image Processing with Less Data—Document Image Binarization by Integrating Multiple Pre-Trained U-Net Modules. Pattern Recognit. 2021, 109, 107577. [Google Scholar] [CrossRef]
- Song, Y.; Li, C.; Xiao, S.; Zhou, Q.; Xiao, H. A Parallel Canny Edge Detection Algorithm Based on OpenCL Acceleration. PLoS ONE 2024, 19, 31. [Google Scholar] [CrossRef] [PubMed]
- Jin, X.C.; Ong, S.H.; Jayasooriah, J. A Domain Operator for Binary Morphological Processing. IEEE Trans. Image Process. 1995, 4, 1042–1046. [Google Scholar] [CrossRef] [PubMed]
- Li, J.; Tong, C.; Yuan, H.; Huang, W. A Complex Environmental Water-Level Detection Method Based on Improved YOLOv5m. Sensors 2024, 24, 5235. [Google Scholar] [CrossRef]
- Zhao, H.; Chen, H.; Liu, B.; Liu, W.; Xu, C.-Y.; Guo, S.; Wang, J. An Improvement of the Space-Time Image Velocimetry Combined with a New Denoising Method for Estimating River Discharge. Flow Meas. Instrum. 2021, 77, 101864. [Google Scholar] [CrossRef]
- Perks, M.T.; Sasso, D.; Hauet, A.; Coz, J.L.; Manfreda, S. Towards Harmonization of Image Velocimetry Techniques for River Surface Velocity Observations. Earth Syst. Sci. Data 2020, 12, 1545–1559. [Google Scholar] [CrossRef]
- Chen, M.; Chen, H.; Wu, Z.; Huang, Y.; Zhou, N.; Xu, C.Y. A Review on the Video-Based River Discharge Measurement Technique. Sensors 2024, 24, 4655. [Google Scholar] [CrossRef]
- Zhang, S.J.; Zhu, K.; Sun, X.Y.; Li, D.S. The role of matching pursuit algorithm and multi-scale daily rainfall data obtained from decomposition in runoff prediction. J. Hydrol. 2024, 53, 101836. [Google Scholar] [CrossRef]
- Lv, X.; Guo, H.; Tian, Y.; Meng, X.; Bao, A.; De Maeyer, P. Evaluation of GSMaP Version 8 Precipitation Products on an Hourly Timescale over Mainland China. Remote Sens. 2024, 16, 210. [Google Scholar] [CrossRef]
- Yang, Y.; Xu, L.; Luo, M.; Wang, X.; Cao, M. Detection Algorithm of Laboratory Personnel Irregularities Based on Improved YOLOv7. Comput. Mater. Contin. 2024, 78, 2741–2765. [Google Scholar] [CrossRef]









| Model | Optimizer | Loss Function | Batch Size | Epoch | Learning Rate |
|---|---|---|---|---|---|
| ResNet18 | SGD | cross entropy | 32 | 300 | 0.001 |
| SSD | SGD | cross entropy | 32 | 300 | 0.001 |
| YOLOv5m | Adam | cross entropy | 32 | 300 | 0.001 |
| DSC-YOLOv8n | SGD | cross entropy | 32 | 300 | 0.01 |
| Conv-1 | Conv-2 | Conv-3 | Conv-4 | Conv-5 | mAP50 | mAP50:95 |
|---|---|---|---|---|---|---|
| 88.9 | 87.7 | |||||
| √ | 89.5 | 88.1 | ||||
| √ | 90.0 | 88.8 | ||||
| √ | 90.5 | 89.5 | ||||
| √ | 89.0 | 87.4 | ||||
| √ | 90.2 | 86.7 ↓ | ||||
| √ | √ | 91.2 | 86.0 | |||
| √ | √ | 90.7 | 85.3 | |||
| √ | √ | 91.7 | 84.7 | |||
| √ | √ | 91.5 | 85.3 | |||
| √ | √ | 91.0 | 85.9 | |||
| √ | √ | 90.5 | 86.5 | |||
| √ | √ | 89.5 | 87.0 | |||
| √ | √ | 90.0 | 87.6 | |||
| √ | √ | 89.5 | 88.2 | |||
| √ | √ | 89.0 | 88.7 | |||
| √ | √ | √ | 88.5 | 89.2 | ||
| √ | √ | √ | 88.0 | 89.7 | ||
| √ | √ | √ | 87.5 ↓ | 90.2 | ||
| √ | √ | √ | 88.3 | 90.6 | ||
| √ | √ | √ | 89.1 | 91.1 | ||
| √ | √ | √ | 90.2 | 91.8 | ||
| √ | √ | √ | 90.7 | 92.6 | ||
| √ | √ | √ | 91.2 | 92.4 | ||
| √ | √ | √ | 91.7 | 91.6 | ||
| √ | √ | √ | 92.6 | 92.1 | ||
| √ | √ | √ | √ | 93.1 ↑ | 93.9 ↑ | |
| √ | √ | √ | √ | 92.1 | 93.1 | |
| √ | √ | √ | √ | 91.5 | 92.8 | |
| √ | √ | √ | √ | 90.5 | 91.9 | |
| √ | √ | √ | √ | 89.6 | 91.3 | |
| √ | √ | √ | √ | √ | 88.8 | 89.9 |
| Model | mAP50 (%) | mAP50:95 (%) |
|---|---|---|
| YOLOv8n | 0.889 | 0.877 |
| DSC-YOLOv8n-seg | 0.931 | 0.939 |
| Model | Error ≤ 1 cm | 1 cm < Error < 3 cm | Error > 3 cm | Average Error (cm) |
|---|---|---|---|---|
| Deep convolutional networks | 14% | 49% | 37% | 2.6 |
| YOLOv5m | 21% | 57% | 22% | 2.2 |
| YOLOv8n | 21% | 51% | 28% | 2.3 |
| YOLOv8n-seg | 25% | 56% | 19% | 1.9 |
| DSC-YOLOv8n | 46% | 37% | 17% | 1.7 |
| DSC-YOLOv8n-seg | 56% | 33% | 11% | 1.2 |
| Model | Accuracy (%) | Recall (%) | mAP50 (%) | mAP50:95 (%) |
|---|---|---|---|---|
| Deep convolutional networks | 85.1 | 86.7 | 84.9 | 85.3 |
| YOLOv5m | 87.8 | 87.9 | 87.5 | 88.2 |
| YOLOv8n | 88.2 | 93.7 | 88.9 | 87.7 |
| YOLOv8n-seg | 89.4 | 90.5 | 91.3 | 90.6 |
| DSC-YOLOv8n | 91.2 | 92.3 | 91.6 | 92.7 |
| DSC-YOLOv8n-seg | 93.1 | 94.5 | 93.1 | 93.9 |
| Scene | Error ≤ 1 cm | 1 cm < Error < 3 cm | Error ≥ 3 cm | Average Error (cm) |
|---|---|---|---|---|
| Daylight | 88% | 11% | 1% | 0.8 |
| Low light | 40% | 28% | 32% | 1.9 |
| Night | 58% | 42% | 0% | 0.9 |
| Speedometer Line | Relative Error | ||||
|---|---|---|---|---|---|
| 1 | 72 | 0.428 | |||
| 2 | 72 | 0.431 | |||
| 3 | 72 | 0.436 | |||
| 4 | 71 | 0.422 | 0.433 | 0.429 | 0.4% |
| 5 | 71 | 0.429 | |||
| 6 | 72 | 0.443 | |||
| 7 | 71 | 0.439 | |||
| 8 | 73 | 0.437 |
| Speedometer Line | Relative Error | ||||
|---|---|---|---|---|---|
| 1 | 83 | 0.186 | |||
| 2 | 82 | 0.197 | |||
| 3 | 84 | 0.174 | |||
| 4 | 81 | 0.173 | 0.185 | 0.190 | 0.5% |
| 5 | 83 | 0.194 | |||
| 6 | 83 | 0.183 | |||
| 7 | 82 | 0.182 | |||
| 8 | 83 | 0.191 |
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
Yu, J.; Li, Y.; Wang, T.; Zhang, P.; Jiang, W.; Xing, L. Dynamic Multi-Parameter Sensing Technology for Ecological Flows Based on the Improved DSC-YOLOv8n Model. Water 2026, 18, 146. https://doi.org/10.3390/w18020146
Yu J, Li Y, Wang T, Zhang P, Jiang W, Xing L. Dynamic Multi-Parameter Sensing Technology for Ecological Flows Based on the Improved DSC-YOLOv8n Model. Water. 2026; 18(2):146. https://doi.org/10.3390/w18020146
Chicago/Turabian StyleYu, Jun, Yongsheng Li, Ting Wang, Peipei Zhang, Wenlong Jiang, and Lei Xing. 2026. "Dynamic Multi-Parameter Sensing Technology for Ecological Flows Based on the Improved DSC-YOLOv8n Model" Water 18, no. 2: 146. https://doi.org/10.3390/w18020146
APA StyleYu, J., Li, Y., Wang, T., Zhang, P., Jiang, W., & Xing, L. (2026). Dynamic Multi-Parameter Sensing Technology for Ecological Flows Based on the Improved DSC-YOLOv8n Model. Water, 18(2), 146. https://doi.org/10.3390/w18020146
