Ecological flow early warning method and system for barren area based on video perception
Patent Information
- Application Number
- CN202610763537.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-09-25
AI Technical Summary
[0003]现有技术主要依赖水文站网监测或物理模型推演,但二者均不适用于乏资料地区:缺乏站网覆盖的偏远山区无法直接测量流量,而物理模型参数率定需要长序列水文数据支撑,资料缺失时模型不确定性极大、难以有效构建;此外,现有预警多为事后报警或确定性阈值比较,缺乏提前预见能力且未量化预测不确定性,导致管理者面对高误差风险的预警信息难以科学分级响应,降低了流域生态流量保障的主动性与可控性
(1)通过选取水文相似的参证流域构建图结构信息,利用时空依赖图神经网络进行预训练并将模型参数迁移至目标乏资料流域,有效克服了目标流域实测数据匮乏导致传统水文模型难以建立的缺陷,结合多源环境数据融合与迁移学习微调策略,提升了流量预测精度,同时,基于预测置信区间计算生态流量短缺概率并对预警等级进行概率化分级修正,相较于传统确定性阈值预警,能够量化预测不确定性,降低误报与漏报风险,有效提升了流域生态流量保障的主动性与可控性。
Smart Images

Figure CN122821722A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ecological flow monitoring technology, and in particular to a method and system for early warning of ecological flow in data-scarce areas based on video perception. Background Technology
[0002] Ensuring river ecological flow is a crucial measure for promoting the recovery of river and lake ecosystems and maintaining their healthy life. Currently, the monitoring of river and lake ecological flow focuses on the post-event evaluation of past ecological flow assurance, and its pre-event early warning capabilities remain relatively weak. Existing technologies mainly rely on two types of solutions: one is to install radar level gauges, pressure level gauges, or contact flow meters at ecological flow control sections for direct monitoring and to build an Internet of Things (IoT) architecture to achieve real-time alarms; the other is to extrapolate downstream flow processes based on traditional hydrological or hydrodynamic models, combined with measured data from upstream hydrological stations, and to perform real-time model correction through data assimilation methods. The above methods are relatively mature in conventional watersheds, but their core is based on relatively complete data.
[0003] Existing technologies mainly rely on hydrological station network monitoring or physical model extrapolation, but neither is suitable for areas with scarce data: remote mountainous areas lacking station network coverage cannot directly measure flow, while physical model parameter calibration requires long-term hydrological data support, and the model uncertainty is extremely high and difficult to construct effectively when data is missing; in addition, existing early warnings are mostly post-event alerts or deterministic threshold comparisons, lacking the ability to predict in advance and failing to quantify the uncertainty of predictions, making it difficult for managers to scientifically classify and respond to early warning information with high error risks, thus reducing the initiative and controllability of watershed ecological flow protection. Summary of the Invention
[0004] In view of this, the present invention proposes an ecological flow early warning method and system for data-scarce areas based on video perception. It obtains reliable upstream monitoring data through video flow measurement calibration and fusion of multi-source environmental data, and uses a similar watershed map structure pre-training and spatiotemporal dependent graph neural network transfer learning strategy. Based on confidence intervals, it calculates the shortage probability to realize probabilistic hierarchical early warning and reliability assessment, which effectively improves the initiative and controllability of watershed ecological flow protection.
[0005] The technical solution of this invention is implemented as follows: In a first aspect, this invention provides a method for early warning of ecological flow in data-scarce areas based on video perception, comprising the following sub-steps: S1. Install monitoring equipment at the upstream river section in areas with scarce data, calibrate the equipment through supplementary field measurements, and monitor and generate flow data of the upstream monitoring section in real time. S2, collect multi-source environmental data, and integrate it with upstream monitoring section flow data and perform data preprocessing to construct a feature dataset. The multi-source environmental data includes interval rainfall, interval water intake, auxiliary geographical features and environmental enhancement features. S3. Select a watershed with similar hydrology to the target watershed as a reference watershed. Construct graph structure information based on the river network topology of the reference watershed, and construct a flow prediction model based on a spatiotemporal dependent graph neural network. Input the graph structure information of the reference watershed into the flow prediction model for pre-training. Transfer the pre-trained model parameters to the target watershed and fine-tune them using the feature dataset of the target watershed to obtain the trained flow prediction model, which is used to output the flow prediction value and confidence interval of the downstream section of the target watershed at future times. S4 calculates the probability of ecological flow shortage based on the predicted downstream cross-sectional flow and its confidence interval, and combines the predicted mean and the shortage probability to classify and correct the warning level, outputting probabilistic graded warning information.
[0006] Based on the above technical solutions, preferably, step S1 includes the following sub-steps: S11, Select a monitoring section in the upstream river channel and install video flow monitoring equipment at the monitoring section, so that the optical axis of the video flow monitoring equipment is perpendicular to the direction of water flow; S12, perform cross-sectional measurements on the monitoring section, obtain the distance from the starting point and elevation data of the section, establish a cross-sectional geometric model, bury a temporary water gauge at the monitoring section, establish a water level benchmark, obtain the corresponding flow velocity and flow rate benchmark values at different water level levels, synchronously compare the water level observed by the temporary water gauge with the water level identified by the video flow measurement equipment, synchronously compare the measured flow velocity and flow rate benchmark values with the flow velocity and flow rate output by the video flow measurement monitoring equipment, and calibrate the water level, flow velocity and flow rate measurement parameters of the video flow measurement equipment; S13. After calibration, video images are acquired through video flow monitoring equipment to identify water level and surface velocity. Based on the cross-sectional geometric model and the identified water level, the cross-sectional area of the water passage is calculated. The surface velocity is multiplied by a preset velocity coefficient to obtain the average velocity of the cross-section. The cross-sectional area of the water passage is multiplied by the average velocity of the cross-section to calculate the instantaneous flow rate and generate the flow data of the upstream monitoring section.
[0007] Based on the above technical solutions, preferably, step S2 includes the following sub-steps: S21. Collect measured data from ground meteorological observation stations. For areas lacking stations, obtain the average rainfall across the interval and extract rainfall intensity, rainfall duration, and rainfall pattern characteristics to obtain interval rainfall data. S22, by collecting regional water resources bulletins, water abstraction permit ledgers and agricultural irrigation water statistics, we obtain inter-regional water abstraction data; S23, extract auxiliary geographic feature data, which includes catchment area, watershed shape coefficient, river network density, main channel length, average channel gradient, and channel curvature; S24, calculate environmental enhancement feature data, which includes previous impact rainfall, potential evapotranspiration and temperature, wherein the previous impact rainfall for the next period is equal to the daily soil moisture decline coefficient multiplied by the sum of the previous impact rainfall and the average rainfall over the period, and the previous impact rainfall does not exceed the maximum water storage capacity of the watershed. S25 standardizes and imputes missing values in upstream cross-sectional flow data, interval rainfall data, interval water intake data, auxiliary geographic feature data, and enhanced feature data to construct the input feature dataset.
[0008] Based on the above technical solutions, preferably, step S3 involves selecting a watershed with similar hydrology to the target watershed as a reference watershed, and constructing a graph structure information based on the river network topology of the reference watershed, including: A set of candidate watersheds is obtained. The data for each candidate watershed includes watershed area, average annual rainfall, average annual temperature, vegetation cover, soil type distribution, river gradient, and watershed shape coefficient. Based on the data of the candidate watersheds and the corresponding indicators of the target watershed, the similarity between each candidate watershed and the target watershed is calculated using weighted cosine similarity. The coefficient of variation method is then used to assign weights to each indicator, and the reference watershed with the highest similarity is selected. A directed graph is constructed based on the river network topology of the reference watershed, where nodes include upstream monitoring section nodes, inter-regional virtual confluence nodes, and downstream control section nodes. Edges are established according to the direction of water flow to form an adjacency matrix. The upstream section flow, inter-regional average rainfall, and inter-regional water consumption corresponding to each node in the reference watershed are used as the dynamic features of the nodes. The static features and dynamic features are concatenated to form the input feature vector of each node in the reference watershed.
[0009] Based on the above technical solutions, preferably, step S3, which involves constructing a flow prediction model based on a spatiotemporally dependent graph neural network, includes inputting the graph structure information of the reference watershed into the flow prediction model for pre-training, and includes: Based on the directed graph and the input feature vector of each node, a sliding window method is used to construct training samples. A fixed-length time window is set, and the input feature vectors of each node at multiple consecutive historical moments within the time window are arranged in chronological order to form an input feature sequence. The downstream cross-sectional flow value at a future set time after the end of the time window is used as the output target. Each input feature sequence and the corresponding output target form a training sample. A traffic prediction model is constructed using a spatiotemporal dependent graph neural network, which includes an input layer, a spatiotemporal dependent encoder, and an output decoder connected in sequence. The input layer is used to receive the adjacency matrix of the directed graph and the input feature vector of each node; The spatiotemporal dependency coding comprises multiple sequentially stacked spatiotemporal coding layers. Each spatiotemporal coding layer includes a spatial graph convolution module, a temporal convolution module, residual connections, and a layer normalization module. The output of the spatial graph convolution module is connected to the input of the temporal convolution module. The output of the temporal convolution module is connected to the first input of the residual connection and the input of the layer normalization module. The second input of the residual connection is connected to the original input signal of the spatiotemporal coding layer. The output of the layer normalization module is connected to the input of the next spatiotemporal coding layer. The spatial graph convolution module adopts a diffusion graph convolution structure. The temporal convolution module adopts a gated temporal convolutional network, which includes two parallel dilated causal convolutional layers. The first dilated causal convolutional layer is followed by a Sigmoid activation function to output a gate signal, and the second dilated causal convolutional layer is followed by a Tanh activation function to output candidate features. The gate signal and the candidate features are then multiplied element-wise and output. The output decoder includes at least one fully connected layer, whose input is connected to the feature vector of the corresponding downstream control section node in the output of the last spatiotemporal coding layer, and whose output output is the predicted flow value of the downstream section at a future time. During model training, a comprehensive loss function is constructed, and the Adam optimizer is used for gradient descent optimization and iterative training until the model converges, thus obtaining a pre-trained traffic prediction model. The comprehensive loss function equals the mean squared error loss plus the water balance constraint term multiplied by the first regularization coefficient, plus the flow process smoothness constraint term multiplied by the second regularization coefficient. The mean squared error loss is used to measure the deviation between the predicted value and the actual value. The water balance constraint term is used to ensure that the downstream flow and the upstream inflow plus the production flow minus the water use are basically balanced. The flow process smoothness constraint term is used to ensure that the predicted value changes smoothly between adjacent time steps. The first regularization coefficient and the second regularization coefficient are determined by optimization through the validation set.
[0010] Based on the above technical solutions, preferably, step S3 involves transferring the pre-trained model parameters to the target watershed, fine-tuning them using the feature dataset of the target watershed, and obtaining a trained flow prediction model to output the predicted flow values and confidence intervals of the downstream section of the target watershed at future times, including: A hierarchical transfer learning strategy is employed to transfer the parameters of the pre-trained traffic prediction model to the target watershed. The weight parameters of the first few layers in the spatial graph convolutional module are frozen, while the weight parameters of the temporal convolutional module and the output decoder are fine-tuned. Using the feature dataset of the target watershed, fine-tuning training is performed at one-tenth to one-hundredth of the pre-training learning rate. During the prediction phase, the Monte Carlo Dropout method is used. MultipleThe system performs a second random forward propagation to calculate the mean and standard deviation of the predicted values, and outputs the predicted flow values and their confidence intervals for the downstream sections of the target watershed at future times.
[0011] Based on the above technical solutions, preferably, step S4 involves calculating the probability of ecological flow shortage based on the predicted downstream cross-sectional flow value and its confidence interval, and then combining the predicted mean and the probability of shortage to classify and correct the early warning level, including: When using ecological flow target values for assessment, the probability of ecological flow shortage is calculated based on the standard normal cumulative distribution function, the ecological flow target value, the mean of flow forecast, and the standard deviation of flow forecast. The ecological flow guarantee rate is defined as the mean of flow forecast divided by the ecological flow target value. The deterministic warning level is determined according to the numerical range of the ecological flow guarantee rate: a blue warning is given when the guarantee rate is in the first relatively high range, a yellow warning is given when the guarantee rate is in the second relatively high range, and a red warning is given when the guarantee rate is lower than the target value. When using the cumulative ecological water volume target value for assessment, the probability of ecological water shortage is calculated based on the standard normal cumulative distribution function, the cumulative ecological water volume target value for the time period, the predicted mean of the cumulative water volume for the time period, and the predicted standard deviation of the cumulative water volume for the time period. The cumulative water volume guarantee rate is defined as the predicted mean of the cumulative water volume for the time period divided by the cumulative ecological water volume target value for the time period. The deterministic warning level is determined according to the numerical range of the cumulative water volume guarantee rate: a blue warning is given when the guarantee rate is in the first low range, a yellow warning is given when the guarantee rate is in the second low range, and a red warning is given when the guarantee rate is lower than the target value. The warning level is graded and corrected based on the deterministic warning level and the probability of shortage at the mean of the downstream cross-section flow forecast. When the deterministic warning level is blue and the probability of shortage exceeds the first probability threshold, it is upgraded to a yellow warning. When the deterministic warning level is yellow and the probability of shortage exceeds the second probability threshold, it is upgraded to a red warning. When the probability of shortage exceeds the third probability threshold, a red warning is directly triggered. The first probability threshold is less than the second probability threshold, and the second probability threshold is less than the third probability threshold.
[0012] Based on the above technical solutions, preferably, step S4 further includes classifying the early warning reliability level according to the shortage probability. When the shortage probability is lower than the first low threshold or higher than the first high threshold, it is judged as high reliability; When the shortage probability is between the first low threshold and the second low threshold, or when the shortage probability is between the first high threshold and the second high threshold, it is judged as medium reliability. When the shortage probability is between the second lowest threshold and the second highest threshold, it is judged as low reliability; Wherein, the first low value threshold is less than the second low value threshold, the second low value threshold is less than the second high value threshold, and the second high value threshold is less than the first high value threshold; and the first low value threshold corresponds to the lower limit of the extremely high confidence level, and the first high value threshold corresponds to the upper limit of the extremely high confidence level.
[0013] Secondly, the present invention also provides an ecological flow early warning system for data-scarce areas based on video perception, implemented using a video perception-based ecological flow early warning method for data-scarce areas, comprising: The first data acquisition module is used to deploy monitoring equipment at the upstream river section in areas with scarce data, calibrate the equipment through supplementary field measurements, and monitor and generate flow data of the upstream monitoring section in real time. The second acquisition module is used to collect multi-source environmental data, integrate it with upstream monitoring section flow data and perform data preprocessing to construct a feature dataset. The multi-source environmental data includes interval rainfall, interval water intake, auxiliary geographical features and environmental enhancement features. The prediction module is used to select watersheds with similar hydrology to the target watershed as reference watersheds, construct graph structure information based on the river network topology of the reference watersheds, and construct a flow prediction model based on spatiotemporal dependent graph neural network. The graph structure information of the reference watersheds is input into the flow prediction model for pre-training. The pre-trained model parameters are transferred to the target watershed and fine-tuned using the feature dataset of the target watershed to obtain the trained flow prediction model, which is used to output the flow prediction value and confidence interval of the downstream section of the target watershed at future times. The output early warning module is used to calculate the probability of ecological flow shortage based on the predicted flow value and its confidence interval at the downstream section, and to classify and correct the early warning level by combining the predicted mean and the shortage probability, and output probabilistic graded early warning information.
[0014] Thirdly, the present invention also provides a computer-readable storage medium storing a video-perception-based method program for early warning of ecological flow in data-scarce areas, wherein the video-perception-based method program for early warning of ecological flow in data-scarce areas, when executed, implements the video-perception-based method for early warning of ecological flow in data-scarce areas.
[0015] The video-sensing-based ecological flow early warning method and system for data-scarce areas of the present invention has the following advantages over existing technologies: (1) By selecting reference watersheds with similar hydrology to construct graph structure information, using spatiotemporal dependent graph neural networks for pre-training and transferring model parameters to target watersheds with scarce data, the shortcomings of traditional hydrological models that are difficult to establish due to the scarcity of measured data in the target watershed are effectively overcome. Combined with multi-source environmental data fusion and transfer learning fine-tuning strategies, the accuracy of flow prediction is improved. At the same time, based on the prediction confidence interval, the probability of ecological flow shortage is calculated and the warning level is probabilistically graded and corrected. Compared with traditional deterministic threshold warning, the uncertainty of prediction can be quantified, the risk of false alarms and missed alarms can be reduced, and the initiative and controllability of watershed ecological flow protection can be effectively improved.
[0016] (2) By deploying video flow measurement equipment at the upstream section and making the optical axis perpendicular to the water flow direction, and by establishing a water level benchmark by combining the cross-sectional geometric model and the temporary water gauge, the water level, flow velocity and flow rate of the equipment are compared and calibrated simultaneously with multiple parameters. This effectively eliminates the systematic deviation of video flow measurement at different water level levels, ensures the accuracy and continuity of upstream flow data in areas with scarce data, and provides reliable basic data for subsequent model training. (3) By integrating the average rainfall, water intake, auxiliary geographical features, and environmental enhancement features such as rainfall and potential evapotranspiration in the interval, and after standardization and missing value imputation, the hydrological response clues in the limited information available in the data-scarce areas were fully explored, which effectively made up for the lack of measured hydrological data in the target watershed and enriched the information content and representation ability of the model input features. (4) By using a diffusion graph convolutional structure to capture the diffusion and confluence relationships between nodes in the spatial dimension, and using a gated temporal convolutional network to effectively capture the time dependence of long sequences and avoid information leakage, residual connections and layer normalization are introduced to improve the training stability of deep networks. Water balance constraints and flow process smoothness constraints are added to the comprehensive loss function so that the model prediction results can simultaneously meet the requirements of hydrological physical laws and process continuity, thereby improving prediction accuracy and physical consistency. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of the video-sensing-based ecological flow early warning method for data-scarce areas according to the present invention. Detailed Implementation
[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0020] This embodiment takes a river in a mountainous area in southwestern China as an example. The lower reaches of this river are home to special protected fish species. To meet the needs of these fish, an ecological flow target has been proposed. However, this area is remote and lacks hydrological monitoring facilities, making it a data-scarce region where hydrological data is difficult to obtain. The present invention provides an ecological flow early warning method and system for data-scarce regions based on video perception, which enables non-intrusive monitoring and early warning of ecological flow in this region.
[0021] like Figure 1 As shown, in a first aspect, the present invention provides a method for early warning of ecological flow in data-scarce areas based on video perception, comprising the following sub-steps: S1. Monitoring equipment is deployed at the upstream river section in areas with scarce data. The equipment is calibrated through supplementary field measurements, and the flow data of the upstream monitoring section is monitored and generated in real time.
[0022] Step S1 includes the following sub-steps: S11, Select a monitoring section in the upstream river channel and install video flow monitoring equipment at the monitoring section, so that the optical axis of the video flow monitoring equipment is perpendicular to the direction of water flow; S12, perform cross-sectional measurements on the monitoring section, obtain the distance from the starting point and elevation data of the section, establish a cross-sectional geometric model, bury a temporary water gauge at the monitoring section, establish a water level benchmark, obtain the corresponding flow velocity and flow rate benchmark values at different water level levels, synchronously compare the water level observed by the temporary water gauge with the water level identified by the video flow measurement equipment, synchronously compare the measured flow velocity and flow rate benchmark values with the flow velocity and flow rate output by the video flow measurement monitoring equipment, and calibrate the water level, flow velocity and flow rate measurement parameters of the video flow measurement equipment; S13. After calibration, video images are acquired through video flow monitoring equipment to identify water level and surface velocity. Based on the cross-sectional geometric model and the identified water level, the cross-sectional area of the water passage is calculated. The surface velocity is multiplied by a preset velocity coefficient to obtain the average velocity of the cross-section. The cross-sectional area of the water passage is multiplied by the average velocity of the cross-section to calculate the instantaneous flow rate and generate the flow data of the upstream monitoring section.
[0023] It should be noted that when selecting video flow measurement sections in the upstream river channel, the site selection must consider multiple factors such as environmental conditions, monitoring targets, safety, reliability, and subsequent operation and maintenance. The site selection should follow these principles: the flow measurement section should be as far away as possible from the area or section where the ecological protection target is located, so as to extend the early warning period as much as possible; priority should be given to straight, stable river sections, downstream of tributary confluences, and other representative river sections; locations that are easily affected by floods, siltation, or frequent human activities should be avoided as much as possible; ensure a wide field of view with no obstructions affecting the camera's field of view; and select areas with stable and reliable power supply and data transmission conditions as much as possible.
[0024] Regarding the selection of high-definition flow measurement equipment, based on current market research on cutting-edge non-contact flow measurement technologies and products, we selected video flow measurement products with high accuracy and commercial applications, such as the AiFlow video flow measurement product developed by Wuhan University, as a monitoring device for areas with scarce data. This product is based on intelligent video image recognition and deep fusion technology of hydraulic models. It has a water level range of 0-100m, a water level resolution of ≤5mm, a flow velocity measurement range of ≥0.1m / s, and a measurement error within the allowable range. It can realize all-weather real-time online monitoring of water level, flow velocity, and flow rate data.
[0025] The suitability of the flow measurement section and the high-definition flow measurement equipment should be matched. After selecting the flow measurement section, the hydrological characteristics of the measured river channel, such as flow rate, velocity, and water level, should be preliminarily judged based on the existing data. For river sections lacking data, at least two on-site measurements or estimates of water level, velocity, cross-section, and flow rate should be carried out during the dry season. The suitability of the equipment should be judged by comparing the measurement accuracy and range of the selected video flow measurement product.
[0026] For the installation and commissioning of high-definition video flow measurement equipment, a fixed installation type should be selected. Foundations should be poured and poles erected near the centerline of a straight section of the river. Cameras and power / communication modules should be installed, ensuring the installation height exceeds the historical highest flood level. The camera's optical axis should be perpendicular to the main flow direction. In areas lacking data, temporary water gauges and current meters should be installed in conjunction to improve monitoring accuracy. Camera resolution and frame rate should be configured, and exposure, white balance, and wide dynamic range parameters adjusted according to lighting conditions to eliminate the influence of water surface reflection. The geometric parameters of the monitoring section should be input into the system software, velocity lines drawn, and the mapping relationship between image pixel coordinates and water level values established. For areas lacking data, the geometric parameters of the section need to be measured on-site. The stability of the video stream transmission and the rationality of the preliminary water level and flow velocity outputs should be checked. After commissioning, the system can output preliminary flow measurement results.
[0027] Due to the lack of historical data, it is necessary to obtain benchmark data through supplementary on-site measurements to calibrate the equipment.
[0028] First, taking into account the applicability and measurement accuracy of the method by combining factors such as river width, water depth, and flow velocity, an economical and feasible method is selected to conduct fine measurements of the monitoring section, obtain the distance from the starting point and elevation data of the section, and establish a geometric model of the section. Optional methods include sounding rods, depth sounders, single-beam depth sounders, multi-beam sounding systems, mobile ADCP, and UAVs equipped with LiDAR or optical cameras. The actual measurement accuracy is determined according to the river width, and at least 20 measurement points are obtained, with a focus on depicting the turning points of riverbed changes.
[0029] Then, a temporary water gauge is buried near the monitoring section, and the zero point of the water gauge is associated with the national elevation datum or assumed datum using a level instrument. The water level data of at least one complete rise and fall process is continuously observed manually and compared synchronously with the water level identification results of the video system to calibrate the water level measurement parameters of the video flow measurement system.
[0030] Next, different water level conditions were selected, covering at least three water level levels: low, medium, and high. Based on the characteristics of the measurement section, methods such as the mobile ADCP, rotor flow meter, and buoy method were selected to obtain the reference values of flow velocity and flow rate. These values were then compared synchronously with the flow rate and flow velocity measurement results of the video system to calibrate the flow rate and flow velocity measurement parameters of the video flow measurement system.
[0031] Finally, after the system is officially put into use, continuous calibration and verification should be carried out. In areas with scarce data, the hydrological characteristics during the dry season and the wet season should be calibrated and verified separately. When the water level fluctuation exceeds the set fluctuation threshold of 10% or the riverbed undergoes significant deformation, the cross-sectional topographic measurement should be carried out again and this calibration procedure should be performed.
[0032] Based on the installed, debugged and calibrated video flow measurement product, automatic collection and processing of river flow information is carried out. The product has integrated core functional modules such as automatic water level identification, surface velocity analysis and flow calculation. After the system is started, the video acquisition is first initialized and configured. The video acquisition parameters of the monitoring section are set through the supporting client software: resolution 1920×1080, acquisition frame rate not less than 25fps, encoding format H.265 or H.264, and sampling frequency is usually set to 5 minutes / time according to hydrological management needs. After the configuration is completed, the system starts to continuously acquire high-definition video streams.
[0033] The product utilizes its built-in intelligent image recognition automatic water level monitoring function to acquire real-time water level data. Operators define the water level recognition area in the video image, and the system automatically completes the recognition process: using a temporary water gauge set at the monitoring section, it identifies the water gauge scale and water surface line through a deep learning model, establishing a mapping relationship between pixel coordinates and water level; combined with pre-calibrated elevation conversion parameters, it calculates the water level value and outputs water level data that meets accuracy requirements.
[0034] The product utilizes built-in spatiotemporal image video velocity analysis technology to acquire the surface velocity of the monitoring section. Operators draw several velocity measurement lines along the section direction in the video image; the number and location are determined based on the velocity distribution characteristics of the section. The system automatically executes the analysis process: extracting grayscale time-series signals from the video sequence along each velocity measurement line to generate a spatiotemporal image (STI). The surface velocity of the water flow is calculated by analyzing the slope of the texture stripes in the STI. The system incorporates a multi-algorithm fusion engine, including the spatiotemporal image method (STIV), particle image velocimetry (PIV), and particle tracking velocimetry (PTV), which can automatically select the optimal algorithm based on the water surface texture conditions, outputting the surface velocity of each velocity measurement line and the average surface velocity of the section.
[0035] The system combines the identified water level data with pre-entered cross-sectional geometric parameters to calculate the cross-sectional area corresponding to the current water level. Then, it uses the velocity area method to calculate the cross-sectional flow rate: the average surface velocity of the cross-section is multiplied by a preset surface velocity coefficient to estimate the average velocity of the cross-section; then, the cross-sectional area is multiplied by the average velocity of the cross-section to obtain the instantaneous cross-sectional flow rate. For areas without data, the system supports preliminary flow rate estimation using the Manning formula and outputs flow rate data with an uncertainty interval.
[0036] The system has a built-in data quality control module that performs real-time diagnostics on the output water level, flow velocity, and flow rate data. When abnormal values are detected due to image blurring, water surface reflection, or obstruction by floating objects, the system automatically marks them and uses a filtering algorithm for smoothing. All raw videos, intermediate processing results, and final flow rate results are automatically stored on local and remote servers and support real-time reporting. The final output results include: real-time water level, average surface velocity of the cross section, instantaneous cross section flow rate, and associated raw flow measurement videos, which can be used by management personnel for retrospective verification.
[0037] In this embodiment, step S1 involves deploying non-contact high-definition video flow measurement equipment in the upstream river channel of areas lacking data, and combining this with targeted calibration using supplementary on-site measurements. This enables the acquisition of water level, velocity, and flow data at upstream monitoring sections with high precision, regardless of historical hydrological data. This overcomes the limitations of traditional contact flow measurement equipment, such as difficulties in installation and maintenance in remote mountainous areas, susceptibility to flood damage, and reliance on hydrological station networks. Simultaneously, this step utilizes intelligent video image recognition technology to automatically process water level and surface velocity, and calculates instantaneous flow using a cross-sectional geometric model established on-site. This reduces the cost of manual surveys and provides reliable and real-time upstream boundary conditions for subsequent downstream ecological flow prediction, thus laying the data foundation for ecological flow early warning in areas lacking data.
[0038] S2, collect multi-source environmental data, and integrate it with upstream monitoring section flow data and perform data preprocessing to construct a feature dataset. The multi-source environmental data includes interval rainfall, interval water intake, auxiliary geographical features and environmental enhancement features. Step S2 includes the following sub-steps: S21. Collect measured data from ground meteorological observation stations. For areas lacking stations, obtain the average rainfall across the interval and extract rainfall intensity, rainfall duration, and rainfall pattern characteristics to obtain interval rainfall data. It should be noted that when collecting rainfall data within the target watershed area, priority should be given to using measured data from ground meteorological observation stations. For areas lacking meteorological stations, multi-source fusion satellite precipitation products should be used to obtain the average rainfall across the area, such as MSWEP V3 or GPM IMERG. These products use machine learning algorithms to fuse satellite, rain gauge, and reanalysis data, providing near real-time rainfall information.
[0039] Rainfall intensity, duration, and pattern characteristics are extracted from the rainfall data. Rainfall intensity includes the hourly maximum rainfall intensity and average rainfall intensity within a given period. Rainfall duration includes the duration of continuous rainfall events. The pattern characteristics are defined by dividing the rainfall process into different patterns based on the proportion of peak locations, using a coded form as the input feature. For watersheds with limited data, regional corrections can be performed by integrating the meteorological bureau's CLDAS precipitation products to improve the spatial resolution of the precipitation data.
[0040] S22, by collecting regional water resources bulletins, water abstraction permit ledgers and agricultural irrigation water statistics, we obtain inter-regional water abstraction data; It should be noted that the inter-regional water withdrawal data reflects the consumption of river flow by human activities and is an important constraint variable for downstream ecological flow prediction. The inter-regional water withdrawal data is obtained by collecting the following data: regional water resources bulletins, water withdrawal permit ledgers, agricultural irrigation water statistics, regional water use planning and water use facility survey data, and scheduling and operation records of existing water conservancy projects.
[0041] S23, extract auxiliary geographic feature data, which includes catchment area, watershed shape coefficient, river network density, main channel length, average channel gradient, and channel curvature; It should be noted that auxiliary geographic features are used to characterize the inherent runoff generation and collection capacity of the watershed, serving as static input features for the model. All features are extracted from the Digital Elevation Model (DEM). DEM data can be obtained from free data sources such as SRTM or ASTER GDEM. Features such as catchment area, watershed shape coefficient, river network density, main channel length, average channel gradient, and channel tortuosity are extracted. The catchment area is the area of the upstream catchment area; the watershed shape coefficient reflects the influence of the watershed shape on the runoff process; the river network density is the total length of the river within a unit area; the main channel length is the length of the river from the watershed outlet to the farthest watershed; the average channel gradient is the ratio of the elevation difference between the upstream and downstream sections of the main channel to the channel length; and the channel tortuosity is the ratio of the actual channel length to the straight-line distance. These features remain unchanged during model training and prediction, serving as static attributes of each node.
[0042] S24, calculate environmental enhancement feature data, which includes previous impact rainfall, potential evapotranspiration and temperature, wherein the previous impact rainfall for the next period is equal to the daily soil moisture decline coefficient multiplied by the sum of the previous impact rainfall and the average rainfall over the period, and the previous impact rainfall does not exceed the maximum water storage capacity of the watershed. It should be noted that the environmental enhancement features include anterior impact rainfall, potential evapotranspiration and temperature, which can improve the model's ability to predict runoff generation mechanisms and dry season flow.
[0043] Anterior runoff impact rainfall reflects the soil moisture content of the watershed and is a key parameter determining the runoff generation ratio. It is particularly important for areas with fully developed runoff generation mechanisms. A recursive formula is used to calculate it: the anterior runoff impact rainfall for the next period equals the daily soil moisture receding coefficient multiplied by the sum of the anterior runoff impact rainfall of the previous period and the average rainfall over that period. The expression is as follows: ; In the formula, P a,t The amount of rainfall that affected the previous period. P t Let t be the average rainfall over the watershed area. K The daily decline coefficient of soil moisture content ranges from 0.8 to 0.95 and needs to be constrained during calculation. P a, t ≤ W m , W m This represents the maximum water storage capacity of the basin in areas where no data is available. K and W m Determined through analogy with neighboring watersheds or regional empirical values. For areas without data, the initial... P a The value can be 0 (after a prolonged drought) or an empirical value of 0.2. W m Based on recursive calculations using 3-5 consecutive rainfall events, P a The convergence is brought to a reasonable range, eliminating the influence of initial errors.
[0044] Potential evapotranspiration (PET), which characterizes atmospheric evaporation demand, makes a significant contribution to low flow forecasting during the dry season. For areas with available data, ground meteorological station monitoring data should be prioritized. For areas without data, reanalysis data such as ERA5-Land can be obtained, and the Penman-Monteith formula can be used for estimation. When data is scarce, the Thornthwaite method or the Hargreaves formula can be used for simple estimation.
[0045] The Thornthwaite method expression is: ; In the formula, T mean The average monthly temperature H The annual calorie index, A It is a constant.
[0046] The Hargreaves method expression is: ; In the formula, T mean , T max , T min These are the average, highest, and lowest temperatures, respectively. R a It is zenith radiation, which can be calculated using latitude.
[0047] Temperature data are primarily obtained from ground meteorological stations. For areas without available data, hourly temperature data are obtained using reanalysis data such as ERA5-Land, and features such as daily average temperature, daily maximum temperature, and daily minimum temperature are extracted.
[0048] S25 standardizes and imputes missing values in upstream cross-sectional flow data, interval rainfall data, interval water intake data, auxiliary geographic feature data, and enhanced feature data to construct the input feature dataset.
[0049] It should be noted that for each feature index, the Z-score standardization method is used, subtracting its mean and dividing by the standard deviation to make features of different dimensions comparable, which is beneficial to model training convergence. For missing data, the following strategies are adopted: single missing points are filled with linear interpolation; multiple missing points are estimated using historical averages or the ratio of neighboring watersheds; for completely missing static features, regional empirical values or reference values from similar watersheds are used as substitutes. After preprocessing, all features are aligned by time to form a structured input feature dataset.
[0050] Step S2 in this embodiment effectively solves the problem of missing key information such as rainfall and water use in areas with scarce data by integrating multi-source heterogeneous data such as ground observation, satellite remote sensing, reanalysis data and water resources statistics. At the same time, it extracts static geographical features such as runoff area and river gradient as well as dynamic enhancement features such as previous impact rainfall and potential evapotranspiration. This not only enriches the model's ability to represent the runoff generation and confluence mechanism of the watershed, but also constructs a high-quality input feature dataset through preprocessing methods such as standardization and missing value imputation, thereby improving the generalization ability and accuracy of the downstream flow prediction model.
[0051] S3. Select a watershed with similar hydrology to the target watershed as a reference watershed. Construct graph structure information based on the river network topology of the reference watershed, and construct a flow prediction model based on a spatiotemporal dependent graph neural network. Input the graph structure information of the reference watershed into the flow prediction model for pre-training. Transfer the pre-trained model parameters to the target watershed and fine-tune them using the feature dataset of the target watershed to obtain the trained flow prediction model, which is used to output the flow prediction value and confidence interval of the downstream section of the target watershed at future times. Based on the completion of multi-source data collection and fusion, this step addresses the core issue of extremely small sample sizes in areas without data by adopting a model construction strategy based on transfer learning. It selects a data-rich watershed with hydrological similarities to the target watershed as a reference watershed, fully pre-trains a spatiotemporal dependent graph neural network, and then transfers the pre-trained model parameters to the target watershed. After fine-tuning with a small amount of local data, it achieves accurate prediction of downstream cross-sectional flow.
[0052] Step S3, which involves selecting a watershed with similar hydrology to the target watershed as a reference watershed and constructing a graph structure based on the river network topology of the reference watershed, includes: A set of candidate watersheds is obtained. The data for each candidate watershed includes watershed area, average annual rainfall, average annual temperature, vegetation cover, soil type distribution, river gradient, and watershed shape coefficient. Based on the data of the candidate watersheds and the corresponding indicators of the target watershed, the similarity between each candidate watershed and the target watershed is calculated using weighted cosine similarity. The coefficient of variation method is then used to assign weights to each indicator, and the reference watershed with the highest similarity is selected. A directed graph is constructed based on the river network topology of the reference watershed, where nodes include upstream monitoring section nodes, inter-regional virtual confluence nodes, and downstream control section nodes. Edges are established according to the direction of water flow to form an adjacency matrix. The upstream section flow, inter-regional average rainfall, and inter-regional water consumption corresponding to each node in the reference watershed are used as the dynamic features of the nodes. The static features and dynamic features are concatenated to form the input feature vector of each node in the reference watershed.
[0053] It should be noted that, to avoid subjective weighting bias, the coefficient of variation method is used to objectively assign weights to each indicator. For each evaluation indicator, its coefficient of variation across all candidate watersheds is calculated, expressed as follows: ; In the formula, CV i For the first i The coefficient of variation of each indicator σ i For the first i The standard deviation of each indicator across all candidate watersheds μ i For the first i The average of the indicators across all candidate watersheds.
[0054] The coefficients of variation of each indicator are normalized to obtain the weights of each indicator, expressed as follows: ; In the formula, w i For the first i The weight of each indicator, m This represents the total number of evaluation indicators.
[0055] The weighted cosine similarity formula is used to calculate the similarity between the candidate watershed and the target watershed. The expression is as follows: ; In the formula, sim is the similarity value. x i The first of the candidate watersheds i Individual indicator values, y i For the target watershed i Individual indicator values, w i For the first i The weights of each indicator are determined; the similarity between all candidate watersheds and the target watershed is calculated, and the watershed with the highest similarity is selected as the reference watershed.
[0056] Based on the river network topology of the reference basin, a directed graph G=(V,E) is constructed. The upstream and downstream hydrological station network system is modeled as a graph structure, with each water volume change unit as a node in the graph and the river segment connection relationship between nodes as an edge in the graph.
[0057] The nodes include upstream monitoring section nodes, inter-regional virtual confluence nodes, and downstream control section nodes. Upstream monitoring section nodes correspond to upstream hydrological stations or video flow measurement sections in the reference watershed. Inter-regional virtual confluence nodes are typically set at 3–10 based on sub-watershed divisions. Downstream control section nodes correspond to ecological flow assessment sections. The total number of nodes, N, is typically 5–12. Edges are defined as directed edges based on the flow direction. If the flow can originate from a node… i Direct flow to nodes j Then there exists a path from i point to j The directed edges are used to construct the adjacency matrix.
[0058] The upstream cross-sectional flow, average rainfall, and water consumption of each node in the reference watershed are used as the dynamic features of the nodes. The static features are concatenated with the dynamic features to form the input feature vector of each node in the reference watershed, expressed as: ; In the formula, X ( t (time)t The feature tensor of all nodes, where N is the number of nodes. d The feature dimension for each node. The graph structure information of the reference watershed and the model weights are saved together for subsequent migration.
[0059] Step S3, which involves constructing a flow prediction model based on a spatiotemporally dependent graph neural network, includes inputting the graph structure information of the reference watershed into the flow prediction model for pre-training. Based on the directed graph and the input feature vector of each node, a sliding window method is used to construct training samples. A fixed-length time window is set, and the input feature vectors of each node at multiple consecutive historical moments within the time window are arranged in chronological order to form an input feature sequence. The downstream cross-sectional flow value at a future set time after the end of the time window is used as the output target. Each input feature sequence and the corresponding output target form a training sample. It should be noted that the training samples are constructed using a sliding window method, and the window length is determined by the dynamic foresight period, expressed as: ; In the formula, T in Let τ be the sliding window length, τ be the dynamic forecast period, and Δt be the time step of the model input. Here, Δt = 1 hour, and the sliding step is set to 1 hour to maximize sample utilization.
[0060] Specific construction method: Set a fixed-length time window, and arrange the input feature vectors of each node at multiple consecutive historical moments in chronological order to form an input feature sequence: ; The downstream cross-sectional flow rate at a predetermined time after the end of the time window is used as the output target. Each input feature sequence and its corresponding output target form a training sample. Specifically, the corresponding output target is the downstream cross-sectional flow rate at a predetermined time after the end of the time window. t Measured flow rate at time +τ y t+τ This forms sample pairs.
[0061] Z-score standardization is applied to all node features, and the samples are divided into training, validation, and test sets in chronological order.
[0062] Z-score standardization is performed independently for each feature dimension, and the mean is calculated for the training set. μ and standard deviation σ The validation and test sets use the mean obtained from the training set. μ and standard deviation σ Standardize it.
[0063] The standardized samples are divided chronologically into three sets: the first 70% are used as the training set, the next 15% as the validation set, and the last 15% as the test set.
[0064] A traffic prediction model is constructed using a spatiotemporal dependent graph neural network, which includes an input layer, a spatiotemporal dependent encoder, and an output decoder connected in sequence. The input layer is used to receive the adjacency matrix of the directed graph and the input feature vector of each node; The spatiotemporal dependency coding comprises multiple sequentially stacked spatiotemporal coding layers. Each spatiotemporal coding layer includes a spatial graph convolution module, a temporal convolution module, residual connections, and a layer normalization module. The output of the spatial graph convolution module is connected to the input of the temporal convolution module. The output of the temporal convolution module is connected to the first input of the residual connection and the input of the layer normalization module. The second input of the residual connection is connected to the original input signal of the spatiotemporal coding layer. The output of the layer normalization module is connected to the input of the next spatiotemporal coding layer. The spatial graph convolution module adopts a diffusion graph convolution structure. The diffusion map convolution is defined as: ; In the formula, H out For spatial graph convolution output, K For the number of diffusion steps, P The transition matrix is obtained by normalizing the adjacency matrix. X The input node feature matrix, W k For the first k The learnable weight matrix for each step.
[0065] The module contains, in sequence: adjacency matrix normalization unit, K-step random walk propagation unit, aggregation weighting unit, linear transformation unit, and ReLU activation unit.
[0066] The temporal convolution module employs a gated temporal convolutional network, comprising two parallel dilated causal convolutional layers. The first dilated causal convolutional layer is followed by a sigmoid activation function to output a gate signal, and the second dilated causal convolutional layer is followed by a Tanh activation function to output candidate features. The gate signal and the candidate features are then multiplied element-wise and output; the expression is: ; ; ; In the formula, g For gating signals, h As candidate features, σ forSigmoid The activation function is ⊙, which represents element-wise multiplication.
[0067] The output decoder includes at least one fully connected layer, whose input is connected to the feature vector of the corresponding downstream control section node in the output of the last spatiotemporal coding layer, and whose output is the predicted flow value of the downstream section at a future time; the expression is: ; In the formula, Extract the feature vectors of downstream control section nodes from the output of the last spatiotemporal coding layer.
[0068] Specifically, the following is a table of hyperparameter configurations for model training; ; All weight matrices are initialized using the Xavier uniform distribution initialization method; the bias vector is initialized to 0; the Dropout layer is enabled during the training phase and disabled during the validation and testing phases.
[0069] During model training, a comprehensive loss function is constructed, which includes the input feature sequence X. batch The adjacency matrix A is input into the STGNN. Then, it is processed sequentially... L The spatiotemporal encoder performs the following sequentially within each layer: diffusion map convolution, gated temporal convolution, residual connection, and layer normalization. Feature vectors of downstream control section nodes are extracted from the output of the last encoder layer, passed through a fully connected layer to obtain predicted values, and then calculated according to the comprehensive loss function L. total Calculate the current loss.
[0070] The comprehensive loss function equals the mean squared error loss plus the water balance constraint term multiplied by the first regularization coefficient, plus the flow process smoothness constraint term multiplied by the second regularization coefficient. The mean squared error loss is used to measure the deviation between the predicted value and the actual value. The water balance constraint term is used to ensure that the downstream flow and the upstream inflow plus the production flow minus the water use are basically balanced. The flow process smoothness constraint term is used to ensure that the predicted value changes smoothly between adjacent time steps. The first regularization coefficient and the second regularization coefficient are determined by optimization through the validation set.
[0071] The expression for the comprehensive loss function is: ; In the formula, L MSE For mean square error loss, Lwater This is a water balance constraint term. L smooth For smoothness constraint terms, λ water and λ smooth This is the regularization coefficient, determined through optimization using the validation set.
[0072] The expression for mean squared error loss is: ; In the formula, n For the sample size, y i For the first i The actual traffic value of each sample For the first i The predicted flow value for each sample.
[0073] The expression for the water balance constraint is: ; In the formula, T is the total number of time steps. Q down ( t (time) t Measured flow rate at downstream section Q up ( t ( ) for time t Flow rate from upstream section; P int ( t ( ) for time t Average rainfall across the interval; W use ( t (time) t Water consumption within the designated area.
[0074] The expression for the flow process smoothness constraint is: ; In the formula, For a moment t Forecast value of downstream cross-section flow.
[0075] The Adam optimizer is used for gradient descent optimization and iterative training until the model converges, resulting in a pre-trained traffic prediction model.
[0076] Specifically, the backpropagation function of the Adam optimizer is called to calculate the gradient, and the global gradient is clipped. Update all trainable parameters.
[0077] The ReduceLROnPlateau strategy is employed to monitor the validation set loss. If the continuous patchiness is achieved... lr =Validation loss did not decrease after 10 epochs (decrease <10) -4 If the learning rate is multiplied by the decay factor, then multiply the learning rate by the decay factor. γ =0.5, learning rate lower bound set to 10 -6 Below this value, it will no longer decay.
[0078] After each epoch, the validation set loss L is calculated. val If L val If the current model parameters are better than the historical best, then save the current model parameters as the best model. If the model has continuous performance... early =Validation loss did not improve after 20 epochs, improvement was less than 10%. -4 If the training fails, training will stop. After training is complete, the optimal model parameters will be loaded as the final pre-trained model.
[0079] The model is considered convergent if either of the following conditions is met: the loss on the validation set decreases by less than 10 over 20 consecutive epochs. -4 Furthermore, the Nash efficiency coefficient NSE ≥ 0.85 (for the reference watershed), reaching the maximum number of training epochs of 200 epochs.
[0080] Since no validation data was available for the target watershed, all hyperparameters were determined in the reference watershed through grid search combined with time series cross-validation. The grid search space is as follows: , , , , .
[0081] Evaluation metrics: Nash efficiency coefficient (NSE) and root mean square error (RMSE) on the validation set. The combination with the highest NSE and the lowest RMSE is selected as the optimal hyperparameter.
[0082] After training, save the model weight file (containing a dictionary of all trainable parameters), graph structure information (adjacency matrix A of the source and watersheds, node number and attribute mapping table), and standardized parameters (mean vector of each input feature). μ and standard deviation vector σ Hyperparameter configuration and training logs (training loss, validation loss, NSE, RMSE, etc. for each round, saved as CSV files).
[0083] Step S3 involves transferring the pre-trained model parameters to the target watershed, fine-tuning them using the feature dataset of the target watershed, and obtaining a trained flow prediction model. This model outputs the predicted flow values and their confidence intervals for the downstream sections of the target watershed at future times, including: A hierarchical transfer strategy is adopted to transfer the parameters of the pre-trained flow prediction model to the target watershed. The weight parameters of the first few layers in the spatial graph convolution module are frozen, and the weight parameters of the temporal convolution module and the output decoder are fine-tuned. The model is then fine-tuned using the feature dataset of the target watershed at a learning rate of one-tenth to one-hundredth of the pre-training rate.
[0084] In the prediction phase, the Monte Carlo Dropout method is used for multiple random forward propagations to calculate the mean and standard deviation of the predicted values. The 95% confidence interval for the predicted values is then […]. μ- 1.96 σ , μ +1.96 σ This function outputs the predicted flow rate and its confidence interval for the downstream section of the target watershed at future times, and can also output the probability density distribution of the predicted values. The calculation formula is as follows: ; In the formula, q This is a possible value for the instantaneous flow rate of the downstream section at a certain future moment.
[0085] In this embodiment, step S3 introduces a spatiotemporal dependent graph neural network based on transfer learning. First, the model is pre-trained on a data-rich reference watershed, and then its hydrological spatial dependence knowledge is transferred to a data-scarce target watershed and fine-tuned. This overcomes the technical bottleneck that prevents the training of traditional hydrophysical models or pure data-driven models in data-scarce areas due to sample scarcity. At the same time, STGNN, combined with diffusion graph convolution and gated temporal convolutional networks, can simultaneously capture the spatial propagation law of hydrological signals along the river network and the temporal evolution characteristics of flow processes. It also introduces physical regularization terms such as water balance constraints and process smoothness, which significantly improves the physical consistency, accuracy, and robustness of the prediction results. In addition, the Monte Carlo Dropout method is used to output the confidence interval of the predicted values, realizing the quantification of prediction uncertainty in ecological flow early warning and providing a probabilistic decision-making basis for subsequent graded early warning.
[0086] S4 calculates the probability of ecological flow shortage based on the predicted downstream cross-sectional flow and its confidence interval, and combines the predicted mean and the shortage probability to classify and correct the warning level, outputting probabilistic graded warning information.
[0087] Taking into account the characteristics of areas with scarce data, and following the technical methods and standards for determining ecological flow, ecological flow control targets for control sections or ecologically sensitive river sections should be rationally determined based on the ecological protection objectives of the river segments. These control targets can be expressed as ecological flow target values. Q ecol Or the cumulative ecological water volume target value over a period of time W ecol .
[0088] Step S4 includes: Based on the downstream cross-sectional flow prediction value and its confidence interval output in step S3, the probability of ecological flow shortage is calculated. This method supports two assessment methods.
[0089] When using ecological flow target values for assessment, the probability of ecological flow shortage is calculated based on the standard normal cumulative distribution function, the ecological flow target value, the mean of flow forecast, and the standard deviation of flow forecast. The ecological flow guarantee rate is defined as the mean of flow forecast divided by the ecological flow target value. The deterministic warning level is determined according to the numerical range of the ecological flow guarantee rate: a blue warning is given when the guarantee rate is in the first relatively high range, a yellow warning is given when the guarantee rate is in the second relatively high range, and a red warning is given when the guarantee rate is lower than the target value. The expression for the ecological flow guarantee rate is: ; In the formula, R represents the ecological flow guarantee rate. μ This is the predicted average flow rate at the downstream cross-section. Q ecol The target value for ecological flow; The probability of ecological flow shortage represents the probability that the actual flow at a downstream section is lower than the ecological flow target value, and is expressed as: ; In the formula, Φ(.) is the standard normal cumulative distribution function. P short The value range is [0,1], and the larger the value, the higher the risk of ecological flow shortage.
[0090] Specifically, a blue alert is issued when the ecological flow guarantee rate R is between 1.10 and 1.20, indicating that the ecological flow is too low and close to the lower limit of guarantee, and close monitoring is recommended. A yellow alert is issued when the ecological flow guarantee rate R is between 1.00 and 1.10, indicating that the ecological flow is near the lower limit of guarantee, and vigilance is required. A red alert is issued when the ecological flow guarantee rate R is less than 1.00, indicating that the ecological flow is lower than the guarantee target, and immediate measures must be taken.
[0091] When using the cumulative ecological water volume target value for assessment, the probability of ecological water shortage is calculated based on the standard normal cumulative distribution function, the cumulative ecological water volume target value for the time period, the predicted mean of the cumulative water volume for the time period, and the predicted standard deviation of the cumulative water volume for the time period. The cumulative water volume guarantee rate is defined as the predicted mean of the cumulative water volume for the time period divided by the cumulative ecological water volume target value for the time period. The deterministic warning level is determined according to the numerical range of the cumulative water volume guarantee rate: a blue warning is given when the guarantee rate is in the first low range, a yellow warning is given when the guarantee rate is in the second low range, and a red warning is given when the guarantee rate is lower than the target value. The expression for the cumulative water supply guarantee rate is: ; In the formula, R w For the cumulative water supply guarantee rate, μ W This represents the predicted average cumulative water volume over the period. Wecol The target value for cumulative ecological water volume over a given period.
[0092] The formula for calculating the probability of cumulative ecological water shortage over a period of time is: ; In the formula, σ W This represents the standard deviation of the cumulative water volume forecast for the time period.
[0093] Specifically, cumulative water supply guarantee rate R w ≤ 0.90 R w A reading below 1.00 indicates a blue alert, suggesting that the accumulated ecological water volume is low and close to the lower limit of protection, with a low cumulative water volume protection rate. R w ≤ 0.80 R w A value less than 0.90 indicates a yellow alert, meaning the accumulated ecological water volume is near the lower limit of the protection level, and the accumulated water volume protection rate is [not specified]. R w A reading of <0.80 indicates a red alert, meaning the accumulated ecological water volume is below the guaranteed target.
[0094] When both ecological flow and time-period ecological water volume assessment methods are used simultaneously at the cross-section, the system runs two sets of early warnings in parallel, and the final early warning level is merged and output according to the following rules, as shown in Table 1: ; The warning level is graded and corrected based on the deterministic warning level and the probability of shortage at the mean of the downstream cross-section flow forecast. When the deterministic warning level is blue and the probability of shortage exceeds the first probability threshold, it is upgraded to a yellow warning. When the deterministic warning level is yellow and the probability of shortage exceeds the second probability threshold, it is upgraded to a red warning. When the probability of shortage exceeds the third probability threshold, a red warning is directly triggered. The first probability threshold is less than the second probability threshold, and the second probability threshold is less than the third probability threshold.
[0095] Specifically, when the certainty warning level is blue, and the shortage probability... P short When the value is greater than 0.30, the warning level will be upgraded to yellow; when the deterministic warning level is yellow and the shortage probability is high... P short When the probability of shortage is greater than 0.70, the warning level will be raised to red. P short When the value is greater than 0.95, a red alert is triggered directly, regardless of the deterministic alert level. When the alert level is upgraded due to the probability of shortage, an additional note is added to the alert information indicating that the upgrade is based on the probability of shortage.
[0096] Because model predictions in data-scarce areas are uncertain, deterministic threshold warnings are integrated with the probability of data shortage to form probabilistic grading rules, which characterize the reliability of warnings and divide the reliability of warnings into three levels.
[0097] Step S4 also includes classifying the reliability level of the early warning based on the probability of shortage. When the shortage probability is lower than the first low threshold or higher than the first high threshold, it is judged as high reliability; When the shortage probability is between the first low threshold and the second low threshold, or when the shortage probability is between the first high threshold and the second high threshold, it is judged as medium reliability. When the shortage probability is between the second lowest threshold and the second highest threshold, it is judged as low reliability; Wherein, the first low value threshold is less than the second low value threshold, the second low value threshold is less than the second high value threshold, and the second high value threshold is less than the first high value threshold; and the first low value threshold corresponds to the lower limit of the extremely high confidence level, and the first high value threshold corresponds to the upper limit of the extremely high confidence level.
[0098] Specifically, when P short ≥0.95 or P short A value <0.05 indicates high reliability, with highly credible early warning conclusions that can be directly used for scheduling decisions. When 0.70 ≤ P short <0.95 or P short A value <0.30 indicates medium reliability, and the warning conclusion has some reference value. It is recommended to make a comprehensive judgment in conjunction with other information. When 0.30 ≤ P short A value <0.7 indicates high uncertainty in prediction; the warning conclusion is for reference only, and it is recommended to intensify monitoring. Among these, 0.05 is the first low threshold, 0.30 is the second low threshold, 0.70 is the second high threshold, and 0.95 is the first high threshold.
[0099] When finally outputting the warning information, both the warning level and the reliability level are marked. When the warning level is upgraded due to the shortage probability, it is additionally marked as upgraded based on the shortage probability.
[0100] The system re-executes step S3 at set time intervals to update the average traffic forecast. μ Standard deviation σ and the probability of shortage P short The system automatically updates the warning level and reliability level according to the above rules. When the predicted traffic exceeds the threshold boundary or the shortage probability exceeds the reliability threshold, it automatically pushes a warning upgrade, downgrade or reliability change notification.
[0101] In this embodiment, step S4 integrates the probability distribution of predicted flow with a deterministic ecological flow threshold, introducing a dual dimension of shortage probability and reliability level into ecological flow early warning in data-scarce areas. It dynamically calculates the shortage risk of flow falling below the target using a standard normal cumulative distribution function, and intelligently adjusts or directly triggers blue, yellow, and red warning levels based on preset probability thresholds. This achieves a leap from reactive, post-event alarms to proactive, pre-event risk warnings. Furthermore, it quantifies the impact of forecast uncertainty on decision-making by classifying high, medium, and low reliability levels based on the shortage probability, enabling managers to take tiered response measures based on the credibility of the warning conclusions. This effectively avoids false alarms or missed alarms caused by neglecting model errors in traditional threshold alarms, improving the scientific rigor and practicality of ecological flow early warning.
[0102] Secondly, the present invention also provides an ecological flow early warning system for data-scarce areas based on video perception, implemented using a video perception-based ecological flow early warning method for data-scarce areas, comprising: The first data acquisition module is used to deploy monitoring equipment at the upstream river section in areas with scarce data, calibrate the equipment through supplementary field measurements, and monitor and generate flow data of the upstream monitoring section in real time. The second acquisition module is used to collect multi-source environmental data, integrate it with upstream monitoring section flow data and perform data preprocessing to construct a feature dataset. The multi-source environmental data includes interval rainfall, interval water intake, auxiliary geographical features and environmental enhancement features. The prediction module is used to select watersheds with similar hydrology to the target watershed as reference watersheds, construct graph structure information based on the river network topology of the reference watersheds, and construct a flow prediction model based on spatiotemporal dependent graph neural network. The graph structure information of the reference watersheds is input into the flow prediction model for pre-training. The pre-trained model parameters are transferred to the target watershed and fine-tuned using the feature dataset of the target watershed to obtain the trained flow prediction model, which is used to output the flow prediction value and confidence interval of the downstream section of the target watershed at future times. The output early warning module is used to calculate the probability of ecological flow shortage based on the predicted flow value and its confidence interval at the downstream section, and to classify and correct the early warning level by combining the predicted mean and the shortage probability, and output probabilistic graded early warning information.
[0103] It should be noted that this system corresponds to the aforementioned method for early warning of ecological flow in data-scarce areas based on video perception. All implementation methods in the above method embodiments are applicable to the embodiments of this system and can achieve the same technical effect.
[0104] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0105] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system and modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0106] In the embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0107] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0108] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0109] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0110] Furthermore, it should be noted that in the system and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent solutions of the present invention. Moreover, the steps performing the above series of processes can naturally be executed in the order described, but are not necessarily required to be executed in chronological order; some steps can be executed in parallel or independently of each other. Those skilled in the art will understand that all or any step or component of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or network of computing devices, in hardware, firmware, software, or a combination thereof. This is something that those skilled in the art can achieve by using their basic programming skills after reading the description of the present invention.
[0111] Therefore, the object of the present invention can also be achieved by running a program or a set of programs on any computing system. The computing system can be a known general-purpose system. Therefore, the object of the present invention can also be achieved simply by providing a program product containing program code implementing the method or apparatus. That is, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any known storage medium or any storage medium developed in the future. It should also be noted that in the apparatus and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent to the present invention. Furthermore, the steps performing the above series of processes can naturally be performed in the order described, but are not necessarily required to be performed in chronological order. Some steps can be performed in parallel or independently of each other.
[0112] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for early warning of ecological flow in data-scarce areas based on video perception, characterized in that, Includes the following sub-steps: S1. Install monitoring equipment at the upstream river section in areas with scarce data, calibrate the equipment through supplementary field measurements, and monitor and generate flow data of the upstream monitoring section in real time. S2, collect multi-source environmental data, and integrate it with upstream monitoring section flow data and perform data preprocessing to construct a feature dataset. The multi-source environmental data includes interval rainfall, interval water intake, auxiliary geographical features and environmental enhancement features. S3. Select a watershed with similar hydrology to the target watershed as a reference watershed. Construct graph structure information based on the river network topology of the reference watershed, and construct a flow prediction model based on a spatiotemporal dependent graph neural network. Input the graph structure information of the reference watershed into the flow prediction model for pre-training. Transfer the pre-trained model parameters to the target watershed and fine-tune them using the feature dataset of the target watershed to obtain the trained flow prediction model, which is used to output the flow prediction value and confidence interval of the downstream section of the target watershed at future times. S4 calculates the probability of ecological flow shortage based on the predicted downstream cross-sectional flow and its confidence interval, and combines the predicted mean and the shortage probability to classify and correct the warning level, outputting probabilistic graded warning information.
2. The method for early warning of ecological flow in data-scarce areas based on video perception as described in claim 1, characterized in that, Step S1 includes the following sub-steps: S11, Select a monitoring section in the upstream river channel and install video flow monitoring equipment at the monitoring section, so that the optical axis of the video flow monitoring equipment is perpendicular to the direction of water flow; S12, perform cross-sectional measurements on the monitoring section, obtain the distance from the starting point and elevation data of the section, establish a cross-sectional geometric model, bury a temporary water gauge at the monitoring section, establish a water level benchmark, obtain the corresponding flow velocity and flow rate benchmark values at different water level levels, synchronously compare the water level observed by the temporary water gauge with the water level identified by the video flow measurement equipment, synchronously compare the measured flow velocity and flow rate benchmark values with the flow velocity and flow rate output by the video flow measurement monitoring equipment, and calibrate the water level, flow velocity and flow rate measurement parameters of the video flow measurement equipment; S13. After calibration, video images are acquired through video flow monitoring equipment to identify water level and surface velocity. Based on the cross-sectional geometric model and the identified water level, the cross-sectional area of the water passage is calculated. The surface velocity is multiplied by a preset velocity coefficient to obtain the average velocity of the cross-section. The cross-sectional area of the water passage is multiplied by the average velocity of the cross-section to calculate the instantaneous flow rate and generate the flow data of the upstream monitoring section.
3. The method for early warning of ecological flow in data-scarce areas based on video perception as described in claim 2, characterized in that, Step S2 includes the following sub-steps: S21. Collect measured data from ground meteorological observation stations. For areas lacking stations, obtain the average rainfall across the interval and extract rainfall intensity, rainfall duration, and rainfall pattern characteristics to obtain interval rainfall data. S22, by collecting regional water resources bulletins, water abstraction permit ledgers and agricultural irrigation water statistics, we obtain inter-regional water abstraction data; S23, extract auxiliary geographic feature data, which includes catchment area, watershed shape coefficient, river network density, main channel length, average channel gradient, and channel curvature; S24, calculate environmental enhancement feature data, which includes previous impact rainfall, potential evapotranspiration and temperature, wherein the previous impact rainfall for the next period is equal to the daily soil moisture decline coefficient multiplied by the sum of the previous impact rainfall and the average rainfall over the period, and the previous impact rainfall does not exceed the maximum water storage capacity of the watershed. S25 standardizes and imputes missing values in upstream cross-sectional flow data, interval rainfall data, interval water intake data, auxiliary geographic feature data, and enhanced feature data to construct the input feature dataset.
4. The method for early warning of ecological flow in data-scarce areas based on video perception as described in claim 3, characterized in that, Step S3, which involves selecting a watershed with similar hydrology to the target watershed as a reference watershed and constructing a graph structure based on the river network topology of the reference watershed, includes: A set of candidate watersheds is obtained. The data for each candidate watershed includes watershed area, average annual rainfall, average annual temperature, vegetation cover, soil type distribution, river gradient, and watershed shape coefficient. Based on the data of the candidate watersheds and the corresponding indicators of the target watershed, the similarity between each candidate watershed and the target watershed is calculated using weighted cosine similarity. The coefficient of variation method is then used to assign weights to each indicator, and the reference watershed with the highest similarity is selected. A directed graph is constructed based on the river network topology of the reference watershed, where nodes include upstream monitoring section nodes, inter-regional virtual confluence nodes, and downstream control section nodes. Edges are established according to the direction of water flow to form an adjacency matrix. The upstream section flow, inter-regional average rainfall, and inter-regional water consumption corresponding to each node in the reference watershed are used as the dynamic features of the nodes. The static features and dynamic features are concatenated to form the input feature vector of each node in the reference watershed.
5. The method for early warning of ecological flow in data-scarce areas based on video perception as described in claim 4, characterized in that, Step S3, which involves constructing a flow prediction model based on a spatiotemporally dependent graph neural network, includes inputting the graph structure information of the reference watershed into the flow prediction model for pre-training. Based on the directed graph and the input feature vector of each node, a sliding window method is used to construct training samples. A fixed-length time window is set, and the input feature vectors of each node at multiple consecutive historical moments within the time window are arranged in chronological order to form an input feature sequence. The downstream cross-sectional flow value at a future set time after the end of the time window is used as the output target. Each input feature sequence and the corresponding output target form a training sample. A traffic prediction model is constructed using a spatiotemporal dependent graph neural network, which includes an input layer, a spatiotemporal dependent encoder, and an output decoder connected in sequence. The input layer is used to receive the adjacency matrix of the directed graph and the input feature vector of each node; The spatiotemporal dependency coding comprises multiple sequentially stacked spatiotemporal coding layers. Each spatiotemporal coding layer includes a spatial graph convolution module, a temporal convolution module, residual connections, and a layer normalization module. The output of the spatial graph convolution module is connected to the input of the temporal convolution module. The output of the temporal convolution module is connected to the first input of the residual connection and the input of the layer normalization module. The second input of the residual connection is connected to the original input signal of the spatiotemporal coding layer. The output of the layer normalization module is connected to the input of the next spatiotemporal coding layer. The spatial graph convolution module adopts a diffusion graph convolution structure. The temporal convolution module adopts a gated temporal convolutional network, which includes two parallel dilated causal convolutional layers. The first dilated causal convolutional layer is followed by a Sigmoid activation function to output a gate signal, and the second dilated causal convolutional layer is followed by a Tanh activation function to output candidate features. The gate signal and the candidate features are then multiplied element-wise and output. The output decoder includes at least one fully connected layer, whose input is connected to the feature vector of the corresponding downstream control section node in the output of the last spatiotemporal coding layer, and whose output output is the predicted flow value of the downstream section at a future time. During model training, a comprehensive loss function is constructed, and the Adam optimizer is used for gradient descent optimization and iterative training until the model converges, thus obtaining a pre-trained traffic prediction model. The comprehensive loss function equals the mean squared error loss plus the water balance constraint term multiplied by the first regularization coefficient, plus the flow process smoothness constraint term multiplied by the second regularization coefficient. The mean squared error loss is used to measure the deviation between the predicted value and the actual value. The water balance constraint term is used to ensure that the downstream flow and the upstream inflow plus the production flow minus the water use are basically balanced. The flow process smoothness constraint term is used to ensure that the predicted value changes smoothly between adjacent time steps. The first regularization coefficient and the second regularization coefficient are determined by optimization through the validation set.
6. The method for early warning of ecological flow in data-scarce areas based on video perception as described in claim 5, characterized in that, Step S3 involves transferring the pre-trained model parameters to the target watershed, fine-tuning them using the feature dataset of the target watershed, and obtaining a trained flow prediction model. This model outputs the predicted flow values and their confidence intervals for the downstream sections of the target watershed at future times, including: A hierarchical transfer learning strategy is employed to transfer the parameters of the pre-trained traffic prediction model to the target watershed. The weight parameters of the first few layers in the spatial graph convolutional module are frozen, while the weight parameters of the temporal convolutional module and the output decoder are fine-tuned. Using the feature dataset of the target watershed, fine-tuning training is performed at one-tenth to one-hundredth of the pre-training learning rate. During the prediction phase, the Monte Carlo Dropout method is used. many The system performs a second random forward propagation to calculate the mean and standard deviation of the predicted values, and outputs the predicted flow values and their confidence intervals for the downstream sections of the target watershed at future times.
7. The method for early warning of ecological flow in data-scarce areas based on video perception as described in claim 6, characterized in that, Step S4 involves calculating the probability of ecological flow shortage based on the predicted downstream cross-sectional flow and its confidence interval, and then using the predicted mean and the probability of shortage to classify and correct the warning level, including: When using ecological flow target values for assessment, the probability of ecological flow shortage is calculated based on the standard normal cumulative distribution function, the ecological flow target value, the mean of flow forecast, and the standard deviation of flow forecast. The ecological flow guarantee rate is defined as the mean of flow forecast divided by the ecological flow target value. The deterministic warning level is determined according to the numerical range of the ecological flow guarantee rate: a blue warning is given when the guarantee rate is in the first relatively high range, a yellow warning is given when the guarantee rate is in the second relatively high range, and a red warning is given when the guarantee rate is lower than the target value. When using the cumulative ecological water volume target value for assessment, the probability of ecological water shortage is calculated based on the standard normal cumulative distribution function, the cumulative ecological water volume target value for the time period, the predicted mean of the cumulative water volume for the time period, and the predicted standard deviation of the cumulative water volume for the time period. The cumulative water volume guarantee rate is defined as the predicted mean of the cumulative water volume for the time period divided by the cumulative ecological water volume target value for the time period. The deterministic warning level is determined according to the numerical range of the cumulative water volume guarantee rate: a blue warning is given when the guarantee rate is in the first low range, a yellow warning is given when the guarantee rate is in the second low range, and a red warning is given when the guarantee rate is lower than the target value. The warning level is graded and corrected based on the deterministic warning level and the probability of shortage at the mean of the downstream cross-section flow forecast. When the deterministic warning level is blue and the probability of shortage exceeds the first probability threshold, it is upgraded to a yellow warning. When the deterministic warning level is yellow and the probability of shortage exceeds the second probability threshold, it is upgraded to a red warning. When the probability of shortage exceeds the third probability threshold, a red warning is directly triggered. The first probability threshold is less than the second probability threshold, and the second probability threshold is less than the third probability threshold.
8. The method for early warning of ecological flow in data-scarce areas based on video perception as described in claim 7, characterized in that, Step S4 also includes classifying the reliability level of the early warning based on the probability of shortage. When the shortage probability is lower than the first low threshold or higher than the first high threshold, it is judged as high reliability; When the shortage probability is between the first low threshold and the second low threshold, or when the shortage probability is between the first high threshold and the second high threshold, it is judged as medium reliability. When the shortage probability is between the second lowest threshold and the second highest threshold, it is judged as low reliability; Wherein, the first low value threshold is less than the second low value threshold, the second low value threshold is less than the second high value threshold, and the second high value threshold is less than the first high value threshold; and the first low value threshold corresponds to the lower limit of the extremely high confidence level, and the first high value threshold corresponds to the upper limit of the extremely high confidence level.
9. A video-perception-based ecological flow early warning system for data-scarce areas, implemented using the video-perception-based ecological flow early warning method for data-scarce areas as described in any one of claims 1-8, characterized in that, include: The first data acquisition module is used to deploy monitoring equipment at the upstream river section in areas with scarce data, calibrate the equipment through supplementary field measurements, and monitor and generate flow data of the upstream monitoring section in real time. The second acquisition module is used to collect multi-source environmental data, integrate it with upstream monitoring section flow data and perform data preprocessing to construct a feature dataset. The multi-source environmental data includes interval rainfall, interval water intake, auxiliary geographical features and environmental enhancement features. The prediction module is used to select watersheds with similar hydrology to the target watershed as reference watersheds, construct graph structure information based on the river network topology of the reference watersheds, and construct a flow prediction model based on spatiotemporal dependent graph neural network. The graph structure information of the reference watersheds is input into the flow prediction model for pre-training. The pre-trained model parameters are transferred to the target watershed and fine-tuned using the feature dataset of the target watershed to obtain the trained flow prediction model, which is used to output the flow prediction value and confidence interval of the downstream section of the target watershed at future times. The output early warning module is used to calculate the probability of ecological flow shortage based on the predicted flow value and its confidence interval at the downstream section, and to classify and correct the early warning level by combining the predicted mean and the shortage probability, and output probabilistic graded early warning information.
10. A computer-readable storage medium, characterized in that, The storage medium stores a video-perception-based method for early warning of ecological flow in data-scarce areas. When the video-perception-based method for early warning of ecological flow in data-scarce areas is executed, it implements the video-perception-based method for early warning of ecological flow in data-scarce areas as described in any one of claims 1-8.