A river flow prediction method and system based on multi-scale feature extraction

By integrating deep learning models to extract multi-scale characteristics of river flow, the problem of incomplete prediction caused by single time scale analysis is solved, and more accurate river flow prediction is achieved, which is suitable for large-scale data processing in complex river basin environments.

CN119558677BActive Publication Date: 2025-10-10SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411601924.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-10-10
Estimated Expiration
2044-11-11

AI Technical Summary

Technical Problem

Existing river flow prediction models analyze data at a single time scale and are unable to fully capture the multi-scale characteristics of river dynamics, resulting in incomplete and inaccurate prediction results.

Method used

A method based on multi-scale feature extraction is adopted, and an integrated deep learning model composed of convolutional neural networks, temporal convolutional networks and bidirectional gated recurrent units is used to extract local and seasonal features in river flow data, and learn the relationships between different features for prediction.

Benefits of technology

It improves the accuracy and robustness of river flow forecasts, can more accurately capture short-term and long-term trends, and is suitable for large-scale data processing in complex river basin environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558677B_ABST
    Figure CN119558677B_ABST
Patent Text Reader

Abstract

The application discloses a river flow prediction method and system based on multi-scale feature extraction, and relates to the technical fields of river flow prediction and deep learning. The method comprises the following steps: acquiring river flow data, performing preliminary feature extraction and screening on the river flow to obtain preliminary features of the river flow; performing preprocessing on the preliminary features of the river flow; and predicting the preliminary features of the river flow after preprocessing by using a river flow model to obtain a river flow prediction result, wherein the prediction process comprises the following steps: performing local feature extraction and seasonal feature extraction on the preliminary features of the river flow respectively, learning the mutual relationship of the features of different scales, and predicting the river flow according to the learning result. The application fully considers the multi-scale features in the river flow and the complex relationship between the features, and effectively improves the accuracy of the river flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of river flow prediction and deep learning technology, and in particular to a river flow prediction method and system based on multi-scale feature extraction. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] With the intensification of global climate change and the frequent occurrence of extreme weather events, accurate and reliable hydrological forecasts play a vital role in water resource management, flood prevention, and environmental sustainability. However, the complexity and uncertainty of hydrological processes make traditional hydrological models, such as statistical and physical models, challenging to process large amounts of data and predict long time series. With the rapid development of deep learning technology in recent years, it has been widely used in the field of hydrological forecasting. Deep learning has shown great potential in processing large amounts of data and simulating complex hydrological processes. Studies have shown that the performance and effectiveness of various deep learning models have surpassed those of traditional hydrological and physical models.

[0004] Current deep learning models used for river flow prediction, such as LSTM, GRU, and S2S models, analyze data only at a single time scale, which leads to certain limitations. Actual river flow data exhibits distinct characteristics at different time scales. On the hourly scale, river flow typically fluctuates gently, but can rise rapidly during sudden rainfall events and then fall rapidly after the rainfall ends. On the daily scale, river flow exhibits a series of peaks and troughs due to factors such as daily evaporation and temperature fluctuations. On the monthly scale, river flow exhibits significant seasonal fluctuations with the seasons. For example, increased rainfall in the summer leads to higher flow, while decreased rainfall and increased evaporation in the autumn and winter lead to lower flow. These characteristics can be categorized as local and seasonal. Local characteristics reflect short-term fluctuations on the hourly scale, while seasonal characteristics reflect long-term cyclical changes on the monthly and annual scales.

[0005] Currently, existing analyses of river flow data at a single scale fail to capture the full picture of river dynamics. This approach can overlook important features at certain scales, resulting in incomplete analysis. For example, models that primarily focus on hourly flow variations fail to capture seasonal patterns in the data, leading to lower accuracy in forecasts. River flow has complex dynamics, exhibiting distinct characteristics at different time scales. Single-scale analyses are often insufficient to fully capture these characteristics, making it difficult for models to provide comprehensive and accurate forecasts.

[0006] Therefore, how to comprehensively excavate the multi-scale features in the river flow data, fully utilize the interaction between the features, and realize more accurate river flow prediction has become a technical problem to be solved in the prior art. SUMMARY

[0007] In view of the deficiencies in the prior art, the purpose of the present application is to provide a river flow prediction method and system based on multi-scale feature extraction, which can extract local features and seasonal features in river flow data, effectively capture multi-scale features in river flow data. And further analyze and model the extracted multi-scale features, fully consider the interaction between different features, and deeply learn and predict the dynamic changes of river flow.

[0008] In order to achieve the above purpose, the present application is realized by the following technical scheme:

[0009] The first aspect of the present application provides a river flow prediction method based on multi-scale feature extraction, comprising the following steps:

[0010] Obtain river flow data, perform preliminary feature extraction and screening on the river flow, and obtain preliminary features of the river flow;

[0011] Pretreat the preliminary features of the river flow;

[0012] Use the river flow model to predict the pretreated preliminary features of the river flow, and obtain the river flow prediction result, wherein the prediction process includes extracting local features and seasonal features from the preliminary features of the river flow respectively, then learning the mutual relationship of the features of different scales, and predicting the river flow according to the learning result.

[0013] Further, the preliminary features of the river flow are subjected to data filtering, normalization and conversion preprocessing steps.

[0014] Further, the river flow prediction model construction process includes:

[0015] Divide the known data set into a training set and a test set;

[0016] Build a river flow prediction model structure, and train the river flow prediction model using the training set;

[0017] Use the test set to verify the prediction effect of the trained model.

[0018] Furthermore, the river flow prediction model structure consists of a convolutional neural network, a temporal convolutional network and a bidirectional gated recurrent unit. The convolutional neural network is used to extract local features from the preliminary characteristics of river flow, the temporal convolutional network is used to extract seasonal features from the preliminary characteristics of river flow, and the bidirectional gated recurrent unit is used to learn the relationship between the extracted features of different scales, and the river flow is predicted based on the learning results.

[0019] Furthermore, the river flow prediction model is evaluated using evaluation indicators, and the river flow prediction model parameters are adjusted according to the evaluation results.

[0020] Furthermore, the specific steps for training the river flow prediction model using the training set are as follows:

[0021] Input the training set into the constructed river flow prediction model for training;

[0022] Set the number of training rounds, determine the optimizer used during training, and set the learning rate;

[0023] After each round of training, the current model is checked to see if it is the optimal model. If it is the optimal model, it is saved locally. If not, training continues.

[0024] Set an early stopping strategy to avoid overfitting.

[0025] Furthermore, the specific steps for using the river flow model to predict the preliminary characteristics of the pre-processed river flow are as follows:

[0026] Load the optimal model after training and enter the gradient-free calculation mode;

[0027] Traverse the data to be tested and predict future river flow;

[0028] For the prediction results, the normalization method is used to perform denormalization on the results.

[0029] A second aspect of the present invention provides a river flow prediction system based on multi-scale feature extraction, comprising:

[0030] The data acquisition module is configured to acquire river flow data, perform preliminary feature extraction and screening on the river flow, and obtain preliminary river flow features;

[0031] a data processing module configured to pre-process preliminary characteristics of river flow;

[0032] The flow prediction module is configured to use the river flow model to predict the preprocessed preliminary river flow characteristics to obtain the river flow prediction results, wherein the prediction process includes extracting local features and seasonal features of the preliminary river flow characteristics, then learning the relationship between the extracted features of different scales, and predicting the river flow based on the learning results.

[0033] A third aspect of the present invention provides a medium having a program stored thereon, which, when executed by a processor, implements the steps of the river flow prediction method based on multi-scale feature extraction as described in the first aspect of the present invention.

[0034] The fourth aspect of the present invention provides a device comprising a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps of the river flow prediction method based on multi-scale feature extraction as described in the first aspect of the present invention are implemented.

[0035] One or more of the above technical solutions have the following beneficial effects:

[0036] This paper discloses a river flow forecasting method and system based on multi-scale feature extraction. This method effectively extracts features and patterns observed at different time scales, known as multi-scale features, from river flow data. This approach enables the model to more accurately capture short-term and long-term trends, improving the accuracy of river flow forecasts.

[0037] The present invention can process multi-scale features extracted at different time scales and learn the complex relationships between features through hidden units. This enables the model to capture long-term dependencies and relationships between features, thereby more accurately predicting future river flows.

[0038] The system of the present invention can be easily deployed in a distributed manner, supports the storage and processing of large-scale river flow data sets, and is suitable for complex river basin environments.

[0039] The system described in the present invention includes an integrated deep learning model based on multi-scale feature extraction. Users only need to make minor adjustments to use this system to train and predict models.

[0040] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0042] Figure 1 This is a flow chart of a river flow prediction method based on multi-scale feature extraction in Example 1 of the present invention;

[0043] Figure 2 Schematic diagram of the river flow model structure in Example 1 of the present invention. DETAILED DESCRIPTION

[0044] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.

[0045] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or their combinations;

[0046] Example 1:

[0047] The first embodiment of the present invention provides a river flow prediction method based on multi-scale feature extraction, such as Figure 1 As shown in the figure, first, a river flow dataset is obtained, and characteristic variables closely related to river flow are screened out; the time series data of river flow are preprocessed, including data normalization and noise removal, and the preprocessed dataset is divided into a training set and a test set; next, a CNN-TCN-BiGRU integrated deep learning model is constructed; the preprocessed training set data is then input into the CNN-TCN-BiGRU model to train the model, and the optimal model in the training process is saved; the test set data is input into the optimal model to verify the prediction effect of the model; the actual river flow data after preprocessing is input into the optimal model to predict future river flow; finally, the prediction accuracy of the model is evaluated using the relevant evaluation indicators NSE and KGE.

[0048] The specific steps include:

[0049] Step 1: Obtain river flow data, perform preliminary feature extraction and screening on river flow, and screen out features related to river flow as preliminary river flow features.

[0050] The river flow-related characteristics include area, slope, rainfall, soil type, evaporation, river flow, etc.

[0051] Step 2: Preprocessing steps such as data filtering, normalization, and transformation are performed on the preliminary characteristics of river discharge.

[0052] Step 2.1: First, remove the noise in the data and filter out the outliers and null values ​​in the river flow dataset;

[0053] Step 2.2: Use the MinMaxScaler normalization method to scale the features in the river flow data to a range of 0 to 1. Normalization ensures that the data has consistent scales across different feature dimensions, which helps accelerate model training and improve prediction accuracy.

[0054] The specific normalization formula satisfies the following formula:

[0055]

[0056] Among them, X t,norm represents the normalized river flow data at time t, and the normalized value is between [0,1]; X t represents the actual observed value of river flow at time t; X min represents the minimum river flow observed during the entire time period; X max Represents the maximum river discharge observed during the entire time period.

[0057] Step 2.3: Convert the data into PyTorch tensors to facilitate subsequent training and prediction of the hybrid deep learning model.

[0058] It should be noted that, in this embodiment, when training the river flow model, the selected known data set is also subjected to the above-mentioned preprocessing steps, and after the preprocessing, it is divided into a training set and a test set.

[0059] Step 3: Use the river flow model to predict the preliminary characteristics of the preprocessed river flow and obtain the river flow prediction results.

[0060] Step 3.1: Divide the known dataset into training set and test set.

[0061] The dataset used in this example is "WaterBench-Iowa," a large hydrological dataset published by the University of Iowa's UIHI Lab. This dataset contains data from 125 rivers in Iowa, USA, from 2011 to 2018. It includes six different features, such as area, slope, rainfall, soil type, evaporation, and river flow. The specific features and their explanations are shown in Table 1:

[0062] Table 1 Dataset description

[0063]

[0064] Step 3.2: Build the river flow prediction model structure.

[0065] The river flow prediction model in this embodiment is CNN-TCN-BiGRU, which is an integrated deep learning model. Figure 2 As shown in the figure, the river flow prediction model structure consists of a convolutional neural network, a temporal convolutional network and a bidirectional gated recurrent unit. The convolutional neural network is used to extract local features from the preliminary characteristics of river flow, the temporal convolutional network is used to extract seasonal features from the preliminary characteristics of river flow, and the bidirectional gated recurrent unit is used to learn the relationship between the extracted features of different scales, and the river flow is predicted based on the learning results.

[0066] In a specific implementation, local feature extraction, seasonal feature extraction, and context awareness modules are defined separately.

[0067] Local feature extraction module: This module extracts local features from river flow by stacking one-dimensional convolutional networks (1D-CNNs) to obtain a local feature matrix. The convolution kernel slides over the input data, operating on local regions of the river flow data (e.g., adjacent time steps) to identify local features. In this embodiment, local features refer to short-term, rapid changes in river flow caused by sudden natural factors. For example, sudden events such as heavy rainfall, continuous rainfall, and floods can cause significant fluctuations in river flow.

[0068] Seasonal Feature Extraction Module: This module is composed of a temporal convolutional network (TCN). Through its unique dilated convolution design, the TCN introduces gaps during the convolution process, allowing the convolution kernel to cover a longer timeframe. By stacking multiple layers of TCN, a deep network structure with strong "memory" is constructed. This allows the seasonal characteristics of historical data to be transferred to the current time step, effectively capturing the seasonal characteristics of river flow data.

[0069] In this example, seasonality refers to the cyclical patterns in river flow that occur with seasonal variations. These patterns are often closely related to environmental factors such as climate change and snowmelt. For example, spring snowmelt and summer rainfall can lead to significant increases in river flow, while in autumn and winter, due to reduced precipitation, river flow tends to decrease.

[0070] In the process of river flow prediction, local features help the model capture short-term changes in flow, while seasonal features help the model identify and utilize periodic patterns in historical data. Considering the complex relationships between features can help the model learn the interactions between different time scales, thereby improving the accuracy and robustness of the prediction.

[0071] Contextual perception module: This module is composed of a bidirectional gated recurrent unit (BiGRU). The bidirectional structure enables it to process features at different time scales and learn complex relationships between features through its hidden state. The core component of this module is the GRU, which can effectively learn dependencies in the data through gating mechanisms such as the update gate and the reset gate, thus more accurately predicting future river flow.

[0072] In some existing research on multi-scale feature extraction and analysis of flow, although time features and spatial features are extracted, the essential difference between river flow and other flows lies in the generation mechanism and dependence relationship of flow. River flow is affected by climate, topography, and human activities, and its changes have obvious periodicity and burstiness. Other flows such as network traffic are generally affected by user behavior and network protocols, and their change patterns are relatively different. The particularity of river flow prediction lies in the need to handle complex natural phenomena and sudden events, which exhibit different characteristics at different time scales and have complex interactions between features. The model in this invention not only focuses on local features and seasonal features, but also considers the complex relationships between features, thereby improving the accuracy and reliability of prediction.

[0073] Specifically, in this embodiment, the complex relationships between features are learned through the hidden state, in addition to learning the relationships between local features and seasonal features, the relationships between other features such as meteorological features (evaporation, etc.) and topographical features (slope, soil type, etc.) are also considered. By considering multi-scale features and their relationships, the model can better understand the changes in river flow.

[0074] Taking local features and seasonal features as an example:

[0075] There are complex interactions between local features and seasonal features, which can be summarized as follows:

[0076] 1. Superposition effect: Seasonal features provide the overall trend of river flow, and local features superimpose short-term flow fluctuations on this basis. The superposition effect makes local events (such as heavy rain or snowmelt) have a more significant impact on flow in the context of a particular season.

[0077] 2. Interactive influence: Seasonal features can affect the form and intensity of local features. For example, in the dry season, the soil is dry and water cannot penetrate, so a short-term heavy rain may quickly cause a flood. In the wet season, the soil is already saturated, and excess water is easily carried away by surface runoff, so the same amount of rainfall may only cause a moderate increase in flow.

[0078] 3. Time-dependent effects: The interaction between local and seasonal characteristics has significant time-dependent effects. For example, spring snowmelt may affect summer rainfall patterns, thereby changing the response of local flow.

[0079] Therefore, the context-aware module of the present invention performs feature learning and analysis on river flow-related features, thereby achieving a more accurate prediction of river flow.

[0080] Connecting the above three modules obtains the network structure of the integrated deep learning model.

[0081] Construct a fully connected layer, which is used to receive the output of the integrated deep learning model and obtain the final prediction result.

[0082] The specific calculation steps for the fully connected layer to obtain the final prediction result are as follows:

[0083] 1. Input feature vector: The input of the fully connected layer is the comprehensive feature vector output by the context-aware module, which contains information about local features, seasonal features, and the complex relationships between them.

[0084] 2. Linear transformation: Perform a linear transformation on the input comprehensive feature vector, expressed as Y = W*X + b, where X is the input feature vector, W is the weight matrix, b is the bias term, and Y is the result of the linear transformation.

[0085] 3. Activation function: The result after linear transformation is transformed nonlinearly through the ReLU activation function to increase the expressive power of the model.

[0086] 4. Output: After all activation functions are applied, the output vector represents the model’s prediction of future river flow.

[0087] 5. Denormalization: Finally, the prediction results are denormalized to restore them to the actual river flow value to ensure that the prediction results have actual physical meaning.

[0088] Step 3.3: Use the training set to train the constructed CNN-TCN-BiGRU (CTB) river flow prediction model.

[0089] Step 3.3.1: Input the training set into the constructed river flow prediction model for training.

[0090] Step 3.3.2: Set the number of training rounds, determine the optimizer used during training, and set the learning rate.

[0091] Specifically, set the training epoch to 50, select Adam as the optimizer, and set the learning rate to 0.001. The ReduceLROnPlateau scheduler adaptively adjusts the learning rate based on the decrease in loss during training to prevent the model from falling into a local optimum.

[0092] Step 3.3.3: After each round of training, check whether the current model is the optimal model. If it is the optimal model, save it locally. If not, continue training.

[0093] Specifically, the loss function uses the Mean Square Error (MSE) to evaluate the error between the model's predicted value and the true value. After each round of training, the optimal model is tested and saved locally.

[0094] Step 3.3.4: Set the early stopping strategy to avoid overfitting.

[0095] Step 3.4: Use the test set to verify the prediction effect of the trained model.

[0096] Step 3.5: Use the river flow model to predict the preprocessed preliminary river flow characteristics. The prediction process involves extracting local and seasonal features from the preliminary river flow characteristics, learning the relationships between the extracted features at different scales, and predicting the river flow based on the learning results.

[0097] The specific steps are:

[0098] Step 3.5.1: Load the optimal model after training and enter the no-gradient calculation mode torch.no_grad() to avoid unnecessary gradient calculations and improve prediction efficiency.

[0099] Step 3.5.2: Traverse the data to be tested and predict the future river flow.

[0100] Step 3.5.3: Denormalize the prediction results using the pre-saved MinMaxScaler normalization method. This denormalization restores the predicted values ​​output by the model to actual flow values, ensuring that the prediction results have actual physical meaning.

[0101] Step 3.6: Use the evaluation indicators to evaluate the river flow prediction model and adjust the river flow prediction model parameters according to the evaluation results.

[0102] In this embodiment, the prediction results are evaluated using the evaluation indicators NSE and KGE. Specifically, two commonly used hydrological evaluation indicators are used in the evaluation stage to measure the error between the predicted value and the true value, namely the Nash efficiency coefficient (NSE) and the Kling-Gupta efficiency coefficient (KGE). NSE mainly compares the degree of closeness between the model predicted value and the observed value. The closer its value is to 1, the higher the model prediction accuracy. However, NSE is sensitive to large errors, especially when the flow changes drastically or there are extreme values. Periods with large errors may cause the NSE to drop significantly, affecting the overall evaluation results. KGE evaluates the performance of the model from multiple angles, including the correlation between the predicted value and the observed value, the deviation of the mean flow, and the degree of dispersion, thereby more comprehensively reflecting the performance of the model. The closer the KGE value is to 1, the better the overall prediction effect of the model. These two indicators can comprehensively reflect the prediction accuracy of the model under different watersheds and hydrological conditions.

[0103] This embodiment also combines several advanced methods in this field (such as LSTM, GRU, S2S, Informer)

[0104] The experimental results obtained under the same data set and experimental conditions are compared, and the experimental results are shown in Table 2 and Table 3.

[0105] The evaluation indicators NSE and KGE satisfy the following formulas respectively:

[0106]

[0107]

[0108] Where N represents the predicted time range; Q obs,t represents the actual river flow value observed at time t; Q sim,t represents the river flow value predicted by the model at time t; It represents the average flow of actual observation data, that is, the mean of the observed flow in the entire time series; r represents the correlation coefficient between the observed flow and the predicted flow, which is used to measure the linear correlation between the two; β represents the deviation ratio, which is used to measure whether the overall level of the observed flow and the predicted flow is consistent; γ represents the coefficient of variation, which is used to measure the degree of dispersion between the data.

[0109] The calculation process of r, β, and γ is as follows:

[0110] r=correlation coefficient(Q obs,t ,Q sim,t ),

[0111]

[0112] Among them, correlation coefficient represents the calculation of Q obs,t and Q sim,t Correlation coefficient between sim Represents the standard deviation of the predicted flow data; σQ obs Represents the standard deviation of the observed flow data.

[0113] The Q obs,t , Q sim,t 、 σQ obs , σQ sim , which respectively represent:

[0114] The river flow observed at time t for a certain river, in units of / second / m 3 ;

[0115] The river flow predicted by the model at time t for a certain river, in units of / second / m 3 ;

[0116] The mean observed flow of a river in hours 0-N, in units of / second / m 3 ;

[0117] The predicted mean flow of a river in hours 0-N, in units of / second / m 3 ;

[0118] The standard deviation of the observed flow data of a river in hours 0-N;

[0119] The standard deviation of the predicted flow data for a river in hours 0-N.

[0120] Table 2 NSE comparison experimental results

[0121]

[0122]

[0123] Table 3 KGE comparison experimental results

[0124]

[0125] Tables 2 and 3 show that compared with other models, the ensemble deep learning model CTB achieves the best results in both the NSE and KGE evaluation metrics for predicting river flow for the next 120 hours. The CTB model comprehensively considers the multi-scale characteristics of river flow and the complex relationships between these characteristics to predict river flow, achieving high prediction accuracy.

[0126] Example 2:

[0127] A second embodiment of the present invention provides a river flow prediction system based on multi-scale feature extraction, including:

[0128] The data acquisition module is configured to acquire river flow data, perform preliminary feature extraction and screening on the river flow, and obtain preliminary river flow features;

[0129] a data processing module configured to pre-process preliminary characteristics of river flow;

[0130] The flow prediction module is configured to use the river flow model to predict the preprocessed preliminary river flow characteristics to obtain the river flow prediction results, wherein the prediction process includes extracting local features and seasonal features of the preliminary river flow characteristics, then learning the relationship between the extracted features of different scales, and predicting the river flow based on the learning results.

[0131] The data storage module is configured to use the InfluxDB time-series database to store river flow data, supporting efficient access to time-series data. The system not only stores massive amounts of data but also supports fast queries and aggregated analysis. The module also features a backup function, regularly backing up data to prevent data loss, system failures, or hardware damage. The data storage module uses the InfluxDB time-series database to store river flow data, supporting efficient access to time-series data. Regular data backups are also performed to mitigate data loss or system failures.

[0132] The Data Management module is configured to display and manage metadata for river flow data, allowing users to upload, view, and download datasets and their basic information (such as data description, data type, number of features, and collection frequency). Furthermore, this module allows users to preview, download, and upload river flow data. It also supports batch processing and cleaning of data to ensure data quality for input into models.

[0133] The Data Visualization module is configured to visualize the model's prediction results. It supports the generation of visual charts such as line charts and histograms, dynamically displaying the comparison between predicted and actual values. Furthermore, analysis reports or charts can be exported for subsequent research and analysis.

[0134] The logging and monitoring module is configured to record and monitor all user operations, such as data uploads and model training. By monitoring the system's operating status and data storage in real time, the system can automatically trigger alerts when anomalies are detected, notifying administrators in a timely manner.

[0135] The traffic prediction module includes a model training module and a model evaluation module:

[0136] The model training module is configured to train the CNN-TCN-BiGRU ensemble deep learning model using a river flow dataset and save the optimal model during training. Users can configure model parameters based on their specific needs. The system records model training results, parameter configuration, and other information to facilitate model version management and performance monitoring, ensuring transparency and traceability of the prediction model.

[0137] The model evaluation module is configured to evaluate the accuracy of model predictions and calculate the error between the predicted value and the observed value using the evaluation metrics NSE and KGE. The model evaluation module is used to evaluate the prediction effect of the trained model and supports the use of hydrological-related evaluation metrics NSE and KGE to evaluate the accuracy of model predictions.

[0138] Each module in the multi-scale feature extraction-based river flow prediction system is designed as an independent microservice, which can be containerized using Docker. To better manage these containerized microservices, container orchestration tools such as Kubernetes are used to support efficient distributed deployment. Through Kubernetes' service discovery mechanism, microservices can automatically discover and connect to related services, reducing hard-coded dependencies between services and enhancing the system's flexibility and maintainability.

[0139] The system integrates a distributed logging system and a monitoring system, enabling real-time monitoring of the operational status of microservices. These tools continuously collect and analyze microservice performance data. Once an anomaly or performance bottleneck is detected, the issue can be quickly located and addressed, ensuring stable system operation.

[0140] When users access the system, the load balancing mechanism distributes user requests to different servers reasonably by using the Nginx load balancing server, ensuring the system's high concurrent processing capability and stable user experience.

[0141] Through the design of distributed architecture and microservices, the system can efficiently handle the complex task of river flow forecasting and has good scalability, maintainability and fault tolerance.

[0142] Example 3:

[0143] A third embodiment of the present invention provides a medium having a program stored thereon. When the program is executed by a processor, the steps of the river flow prediction method based on multi-scale feature extraction as described in the first embodiment of the present invention are implemented.

[0144] Example 4:

[0145] Embodiment four of the present application provides a device comprising a memory, a processor and a program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the river flow prediction method based on multi-scale feature extraction according to embodiment one of the present application.

[0146] The steps and methods involved in embodiments two, three and four above correspond to embodiment one, and the specific implementation can refer to the relevant description of embodiment one.

[0147] Those skilled in the art should understand that the above-mentioned modules or steps of the present application can be realized by a general computer device, and alternatively, they can be realized by program codes executable by a computing device, so that they can be stored in a storage device and executed by a computing device, or they can be respectively manufactured into individual integrated circuit modules, or a plurality of modules or steps among them can be manufactured into a single integrated circuit module to realize. The present application is not limited to any specific combination of hardware and software.

[0148] Although the specific embodiments of the present application are described above in combination with the accompanying drawings, the description is not a limitation on the scope of protection of the present application, and those skilled in the art should understand that various modifications or changes made by those skilled in the art on the basis of the technical solutions of the present application without creative labor are still within the scope of protection of the present application.

Claims

1. A river flow prediction method based on multi-scale feature extraction, characterized in that: The following steps are involved: Obtain river flow data, perform preliminary feature extraction and screening on river flow, and obtain preliminary river flow characteristics; Preprocessing of preliminary characteristics of river flows; The river flow prediction model is used to predict the preprocessed preliminary river flow characteristics to obtain the river flow prediction results. The river flow prediction model structure consists of a convolutional neural network, a temporal convolutional network and a bidirectional gated recurrent unit. The convolutional neural network is used to extract local features from the preliminary river flow characteristics, the temporal convolutional network is used to extract seasonal features from the preliminary river flow characteristics, and the bidirectional gated recurrent unit is used to learn the relationship between the extracted features of different scales, and predict the river flow based on the learning results. The prediction process includes extracting local features and seasonal features from the preliminary river flow characteristics, learning the relationship between the extracted features of different scales, and predicting the river flow based on the learning results. Local features refer to sudden natural factors that cause short-term rapid changes in river flow, including heavy rainfall, continuous rainfall and floods. Seasonal features refer to the periodic pattern of river flow with seasonal changes, which is closely related to environmental factors, including climate change, ice and snow melting and summer rainfall.

2. The river flow prediction method based on multi-scale feature extraction according to claim 1, characterized in that: Preprocessing steps of data filtering, normalization, and transformation were performed for preliminary characterization of river discharge.

3. The river flow prediction method based on multi-scale feature extraction according to claim 1, characterized in that: The process of building a river flow prediction model includes: Divide the known data set into training set and test set; Build the river flow prediction model structure and use the training set to train the river flow prediction model; Use the test set to verify the prediction effect of the trained model.

4. The river flow prediction method based on multi-scale feature extraction according to claim 3 is characterized in that: The river flow prediction model is evaluated using evaluation indicators, and the river flow prediction model parameters are adjusted according to the evaluation results.

5. The river flow prediction method based on multi-scale feature extraction according to claim 1, characterized in that: The specific steps for training the river flow prediction model using the training set are: Input the training set into the constructed river flow prediction model for training; Set the number of training rounds, determine the optimizer used during training, and set the learning rate; After each round of training, the current model is checked to see if it is the optimal model. If it is the optimal model, it is saved locally. If not, training continues. Set an early stopping strategy to avoid overfitting.

6. The river flow prediction method based on multi-scale feature extraction according to claim 1, characterized in that: The specific steps for using the river flow model to predict the preliminary characteristics of the pre-processed river flow are as follows: Load the optimal model after training and enter the gradient-free calculation mode; Traverse the data to be tested and predict future river flow; For the prediction results, the normalization method is used to perform denormalization on the results.

7. A river flow prediction system based on multi-scale feature extraction, characterized in that: include: The data acquisition module is configured to acquire river flow data, perform preliminary feature extraction and screening on the river flow, and obtain preliminary river flow features; a data processing module configured to pre-process preliminary characteristics of river flow; The flow prediction module is configured to use the river flow prediction model to predict the preprocessed preliminary river flow characteristics to obtain the river flow prediction results. The river flow prediction model structure consists of a convolutional neural network, a temporal convolutional network and a bidirectional gated recurrent unit. The convolutional neural network is used to extract local features from the preliminary river flow characteristics, the temporal convolutional network is used to extract seasonal features from the preliminary river flow characteristics, and the bidirectional gated recurrent unit is used to learn the relationship between the extracted features of different scales, and predict the river flow based on the learning results; wherein, the prediction process includes extracting local features and seasonal features from the preliminary river flow characteristics, and then learning the relationship between the extracted features of different scales, and predicting the river flow based on the learning results; local features refer to sudden natural factors that cause short-term rapid changes in river flow, including heavy rainfall, continuous rainfall and floods, and seasonal features refer to the periodic pattern of river flow with seasonal changes, which is closely related to environmental factors, including climate change, ice and snow melting and summer rainfall.

8. A computer-readable storage medium, characterized in that Multiple instructions are stored therein, and the instructions are suitable for being loaded by a processor of a terminal device and executing the river flow prediction method based on multi-scale feature extraction according to any one of claims 1 to 6.

9. A terminal device, characterized in that: It includes a processor and a computer-readable storage medium, the processor is used to implement each instruction; the computer-readable storage medium is used to store multiple instructions, and the instructions are suitable for being loaded by the processor and executing the river flow prediction method based on multi-scale feature extraction according to any one of claims 1-6.

Citation Information

Patent Citations

  • River flow prediction method based on three-dimensional convolutional neural network

    CN111159149A

  • River flow prediction method, device and equipment and storage medium

    CN113139700A