A runoff prediction method and prediction system based on improved federated learning

By improving the federated learning method, using the coordinated training of parameter servers and local computing nodes to share the initial parameters of the model, the problem of hydrological information islands and model transplantation in the runoff prediction method is solved, and efficient prediction and hydrological analysis in different river basins are achieved support.

CN114818461BActive Publication Date: 2024-11-01HOHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210227312.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2024-11-01
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

Existing runoff prediction methods have problems with hydrological information islands and the problem of difficult transplantation of models to different watersheds, especially in areas with little or no data, which makes it difficult to provide effective hydrological and water resource analysis.

Method used

Adopting an improved federated learning method, through the collaborative training of parameter servers and local computing nodes, sharing the initial parameters of the model without sharing data, using a small number of samples to quickly generate local runoff prediction models that are adapted to specific watersheds, solving the problem of model heterogeneity and improving the Prediction accuracy.

Benefits of technology

It effectively solved the problem of hydrological information islands, improved the transplantability and prediction accuracy of the model, and provided support for hydrological and water resource analysis for areas with little or no data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818461B_ABST
    Figure CN114818461B_ABST
Patent Text Reader

Abstract

The present invention discloses a runoff prediction method and prediction system based on improved federated learning. Through the method of federated learning, multiple river basins containing runoff and meteorological data are jointly trained together, so that the hydrological information characteristics of multiple river basins can be captured. By improving the learning process of traditional federated learning, the problem of hydrological information islands is solved to a certain extent, the prediction accuracy is improved, and a reference is provided for realizing hydrological and water resources information analysis in areas with little or no data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a runoff prediction method based on improved federated learning. Background Art

[0002] Accurate runoff prediction is of great practical significance for the scheduling and rational allocation of water resources in the basin, the implementation of flood control and drought relief work, guiding the rational development and utilization of water resources, and reducing casualties and economic losses caused by extreme weather disasters.

[0003] Runoff prediction methods can be generally divided into two categories: hydrological models based on physical processes and data-driven models. Physical process models achieve prediction by considering the complex formation process of runoff, but such models usually require a large amount of hydrological, meteorological, topographical and other data, as well as complex mathematical tools and user expertise. Data-driven models are mainly based on the statistical laws of hydrological phenomena, and predict future hydrological processes by considering the statistical relationship of a hydrological phenomenon. Among them, the prediction method based on neural networks can simulate the complex nonlinear relationship between input and output without considering the specific hydrological physical process. It has a strong learning and fitting ability and has received extensive attention and research as a beneficial supplement to runoff prediction methods.

[0004] Although the neural network-based method can reduce the difficulty of modeling, there are still some problems that cannot be ignored, including:

[0005] First, a large number of water-related information systems are based on the needs of their own businesses or departments, and there are differences in application systems, data storage methods, and data formats, which leads to the dispersion of information and resources and serious heterogeneity. In addition, they are affected by the work system, management system, security, and confidentiality. The water and rainfall information of various hydrological departments cannot be shared in a timely manner, forming information islands. This has brought a certain degree of obstacles to the training and implementation of a centralized runoff prediction neural network model.

[0006] Second, most of the current research focuses on the prediction of time series data at a single site or a specific river basin. Neural networks improve the generalization ability of models by mining complex features from large data sets. Therefore, the current research work has limitations. The trained runoff prediction model is difficult to transplant to other river basins. There are still difficulties in using hydrological information in data-rich areas to provide assistance for hydrological and water resources analysis in areas with little or no information. Summary of the invention

[0007] Purpose of the invention: To solve the problem of hydrological information islands in hydrological big data and to provide a solution for generating runoff prediction models in areas with little or no data, the present invention proposes a runoff prediction method and prediction system based on improved federated learning. The model initial parameter learner trained by the federated learning method learns the hydrological data characteristics from multiple river basins. When applied to a specific river basin, a local model can be quickly obtained using a small number of samples, which is easier to transplant to areas with little or no data. At the same time, it solves the model heterogeneity problem existing in the use of traditional federated learning methods, and further improves the model performance.

[0008] Technical solution: A runoff prediction method based on improved federated learning, including the following steps:

[0009] Step 1: The parameter server sends the model initial parameter learner The tth round Send it to the randomly selected K local computing nodes participating in this round of federated training; t∈(0,S), where S is the specified communication round; K=rn, r∈(0,1), n ​​is the total number of participating basins, and n basins correspond to n local computing nodes;

[0010] Step 2: After receiving the initial model parameter learner The tth round The following training steps are performed in parallel on the local computing nodes:

[0011] The model initial parameter learner The tth round The initial model parameters of the local runoff prediction model of the local computing node are denoted as w i , represents the initial model parameters of the tth round of the local runoff prediction model of the i-th local computing node;

[0012] Based on the initial model parameters w i and from the support set N randomly selected from S The support subset consists of samples Train and optimize the local runoff prediction model of the local computing node to obtain the optimized initial model parameters

[0013] Based on the optimized initial model parameters and from the queryset N randomly selected from Q The query subset consists of samples Calculate the test loss and calculate the corresponding gradient g based on the test loss i ;

[0014] Step 3: The parameter server aggregates the gradients of all K local computing nodes participating in this round of federated training to obtain the gradient set {g1; g2; ...; g K}; Based on the gradient set {g1; g2; ...; g K}For the model initial parameter learner The tth round Use the gradient descent algorithm to update and get the t+1th round value

[0015] Step 4: Determine whether the model converges or the number of iterations reaches the specified communication round. If a certain condition is met, execute step 5, otherwise continue to execute steps 1 to 4;

[0016] Step 5: Initialize the model parameters The tth round As value Send it to all n local computing nodes;

[0017] Step 6: For each local compute node, based on the value Further fine-tuning is performed, including the following steps:

[0018] The value As the initial model parameters of the local runoff prediction model, the support set on the local computing node is used The local runoff prediction model is trained and the query set is used Conduct tests and eventually obtain model parameters that adapt to local data distribution;

[0019] Based on the model parameters, the local runoff is predicted and the prediction results are obtained.

[0020] Furthermore, the support set Query Set and support set Query Set They are constructed through the following steps:

[0021] Rainfall, shortwave downward radiation, daily maximum temperature, daily minimum temperature, and atmospheric pressure were selected as data features, and the daily runoff of the basin was used as the label;

[0022] Convert data features and labels into dimensionless pure values;

[0023] Based on the time step T, the converted values ​​are converted into data in the form of supervised learning problems, thereby constructing a data set;

[0024] Split the dataset into training and test sets, and subdivide the training set into support sets and queryset The test set is also subdivided into support sets and queryset

[0025] Further, in step 2, the initial model parameter w i and from the support set The support subset sampled from The local runoff prediction model f(w i ) to perform training optimization and obtain the optimized initial model parameters The specific calculation formula is:

[0026]

[0027]

[0028] in, represents the sampled support subset The number of samples, L i (w i ) is the loss value, x and y represent the features and corresponding labels of a single sample in the support set, respectively. Represents the model output result f(w i ; The loss between x) and the true value y, α represents the learning rate set by the local runoff prediction model, Indicates L i (w i ) for w i gradient.

[0029] Further, in step 2, the initial model parameters based on the optimization and from Sampled query subset Calculate the test loss and calculate the corresponding gradient g based on the test loss i , the specific process is:

[0030] Get updated Then, based on the query subset in the training set Perform the forward propagation calculation process to get the test loss And according to the test loss Calculate the corresponding gradient g i :

[0031]

[0032]

[0033] in, represents the number of sampled query subsets, and Represent the features and corresponding labels of a single sample in the query set, respectively. Represents the model output results With the true value The loss between represents the gradient calculation, g i express For w i The gradient of , which is essentially the second-order derivative.

[0034] Furthermore, in step 3, the gradient set {g1; g2; ...; g K}For the model initial parameter learner The tth round Use the gradient descent algorithm to update and get the t+1th round value The specific calculation formula is:

[0035]

[0036] Among them, β represents the model initial parameter learner The learning rate is set, and K represents the number of watersheds participating in this round of federated training.

[0037] The present invention also discloses a runoff prediction system based on improved federated learning, comprising:

[0038] n local computing nodes, deployed in the corresponding watersheds, with built-in local runoff prediction models, are used to perform the following federated learning steps and local runoff prediction model adjustment steps;

[0039] Among them, the federated learning steps include:

[0040] The initial model parameter learner sent by the parameter server The tth round The initial model parameters of the local runoff prediction model of the local computing node are denoted as w i , represents the initial model parameters of the tth round of the local runoff prediction model of the i-th local computing node;

[0041] Based on the initial model parameters w i and from the support set The support subset sampled from Train and optimize the local runoff prediction model of the local computing node to obtain the optimized initial model parameters

[0042] Based on the optimized initial model parameters and from the queryset The query subset sampled from Calculate the test loss and calculate the corresponding gradient g based on the test loss i ;

[0043] The gradient g i Upload to the parameter server;

[0044] Among them, the local runoff prediction model adjustment steps include:

[0045] The value sent by the parameter server As initial model parameters of local runoff prediction model;

[0046] Using the support set on the local computing node The local runoff prediction model is trained to obtain model parameters adapted to local data distribution;

[0047] Based on the model parameters, local runoff is predicted;

[0048] Parameter server, built-in model initial parameter learner Used to perform the following steps:

[0049] The model initial parameter learner Value Send it to K randomly selected local computing nodes;

[0050] Aggregate the gradients of the K local computing nodes participating in this round of federated training to obtain the gradient set {g1; g2; ...; g K};

[0051] Based on the gradient set {g1; g2; ...; g K}For the model initial parameter learner The tth round Use the gradient descent algorithm to update and get the t+1th round value

[0052] Determine whether the model converges or the number of iterations in the federated learning step reaches the specified communication round. If a certain condition is met, the model initial parameter learner The tth round As value Send it to all n local computing nodes; if none of them meet the requirements, continue to execute the above federated learning steps.

[0053] Furthermore, the initial model parameter w i and from the queryset The support subset sampled from The local runoff prediction model f(w i ) to perform training optimization and obtain the optimized initial model parameters The specific calculation formula is:

[0054]

[0055]

[0056] in, represents the sampled support subset The number of samples, L i (w i ) is the training loss value, x and y represent the features and corresponding labels of a single sample in the support set, respectively. Represents the model output result f(w i ; The loss between x) and the true value y, α represents the learning rate set by the local runoff prediction model, Indicates L i (w i ) for w i gradient.

[0057] Furthermore, the optimized initial model parameters and from the queryset The query subset sampled from Calculate the test loss and calculate the corresponding gradient g based on the test loss i , the specific process is:

[0058] Get updated Then, based on the sampling query subset Perform the forward propagation calculation process to get the test loss And according to the test loss Calculate the corresponding gradient g i :

[0059]

[0060]

[0061] in, represents the number of sampled query subsets, and Represent the features and corresponding labels of a single sample in the query set, respectively. Represents the model output results With the true value The loss between represents the gradient calculation, g i express For w i The gradient of , which is essentially the second-order derivative.

[0062] Furthermore, the gradient set {g1; g2; ...; g K}For the model initial parameter learner The tth round Use the gradient descent algorithm to update and get the t+1th round value The specific calculation formula is:

[0063]

[0064] Among them, β represents the model initial parameter learner The learning rate is set, and K is the number of watersheds participating in this round of federated training.

[0065] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0066] (1) The present invention uses a federated learning method to combine multiple watershed data to train a runoff prediction model. During the training process, only model parameters are shared without sharing data, which effectively solves the problem of hydrological information islands in hydrological big data.

[0067] (2) The present invention has made significant improvements over the traditional federated learning method, mainly in the following aspects: First, by sharing a parameterized model initial parameter learner instead of a global model, the problem of low global model accuracy in the traditional method is improved; Second, the model initial parameter learner obtained based on global training in a specific watershed is quickly adapted using a small number of samples to generate a local runoff prediction model for the specific watershed, which is easier to transplant to areas with little or no data. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 It is a schematic diagram of the principle of the present invention;

[0069] Figure 2 It is a process schematic diagram of the present invention. DETAILED DESCRIPTION

[0070] The present invention discloses a runoff prediction method based on improved federated learning. By improving the training process of traditional federated learning, computing nodes with computing and data storage capabilities deployed in multiple river basins are used to enable computing nodes corresponding to multiple river basins to jointly train a global model initial parameter learner, that is, to train together with data from multiple river basins, and only model parameters are shared during the training process without sharing data, which can solve the problem of hydrological information islands to a certain extent. The learner initially trained by the present invention is a global model initial parameter learner, which is not directly applied to the local global model. After the joint training, the learner masters the common basic feature representations of other river basins, so that it can quickly adapt to a specific river basin, that is, when the learner is applied to a specific river basin, a small number of samples can be used to quickly train a better local runoff prediction model, that is, a local runoff prediction model suitable for the specific river basin is obtained, which overcomes the model heterogeneity problem of the traditional federated learning method to a certain extent, improves the model prediction accuracy, and provides a means of hydrological and water resources analysis for areas with little or no data.

[0071] Now combined with the attached Figure 1 and Figure 2 The technical solution of the present invention is further described. Assuming that a runoff prediction model is to be jointly trained for n river basins, the present invention mainly involves a parameter server PS and n local computing nodes corresponding to the n river basins. The local runoff prediction model f(w i ) The neural network used is the long short-term memory network LSTM, and the n local computing nodes corresponding to the n basins have the historical daily time scale runoff data and meteorological data in the basin. It mainly includes the following steps:

[0072] Step 1: This step is mainly to prepare the runoff dataset for each computing node. The specific process is as follows:

[0073] S110: Assume that the local computing nodes corresponding to the n watersheds participating in the training are denoted as B i ,i=1,2,...,n, the parameter server is PS. Select the local computing node B i Corresponding to the historical runoff data and meteorological data of the basin, five attributes, including rainfall, shortwave downward radiation, daily maximum temperature, daily minimum temperature, and atmospheric pressure, are selected as data features, and the daily runoff of the current basin is used as the label. The resulting data set is (samples, 5) and the corresponding label shape is (samples, 1), where samples represents the number of samples.

[0074] In order to prevent the training efficiency from being reduced due to the magnitude difference of different attribute values, Z-Score normalization operation is performed on the data features and labels to remove the unit restriction of the data and convert it into a dimensionless pure value. The specific calculation formula is: x = (x-mean) / std, where mean represents the mean of the data x, and std represents the standard deviation of the data x.

[0075] S120: After normalizing the data, determine the time step T, and convert the data set obtained in S110 into data in the form of supervised learning problems based on the time step T. The shape after conversion is (samples, T, 5), and the corresponding label shape is (samples, 1), where the time step T represents the daily runoff Q at the current time predicted based on the meteorological and runoff data of the previous T days;

[0076] S130: Divide the dataset obtained in S120 into a training set for the federated training phase and a test set for the model adjustment phase in a ratio of 8:2, and subdivide the training set into a support set in a ratio of p, where p∈(0,1) and queryset The test set is also subdivided into support sets and queryset Usually p = 0.8;

[0077] Step 2: Parameter server PS learns the initial parameters of the model Perform initialization to get the initial value The initial parameters of the model are the trainable weight parameters of the model, where t∈(0,S), S is the total rounds of communication between the parameter server PS and the local computing node.

[0078] Step 3: Randomly select K local computing nodes, where K = rn, r∈(0,1), and set the value of the model initial parameter learner Sent to the K local computing nodes participating in this round of federated training.

[0079] Step 4: This step aims to learn the initial parameters of the model At Node B i Learning is suitable for Node B i The initial parameters of the model for data distribution; the specific process includes:

[0080] S410: Local computing node B participating in this round of federated training i Get the value of the model initial parameter learner sent by the parameter server PS After that, Assign value to local computing node B i The local runoff prediction model f(w i ) of the model parameter initial value w i,Right now

[0081] S420: Local computing node B i Based on the initial value of the model parameter w i Support subset on local training set Conduct local runoff prediction model f(w i ) training, the subset is from the support set The initial parameter learner of the model is obtained by sampling and using a gradient descent optimizer, such as the Adam optimizer, to perform gradient optimization operations Based on Node B i The initial model parameters learned from the data distribution The specific calculation formula is as follows:

[0082]

[0083]

[0084] in, represents the number of samples in the sampled support subset, x and y represent the features and corresponding labels of a single sample in the support set, respectively, and f(w i ; x) is the model output result, α represents the learning rate set by the local runoff prediction model, and different nodes can set different learning rates. Represents the gradient. is the loss function, specifically the mean square loss function:

[0085]

[0086] in represents the sampled support subset The number of samples, y j Indicates the label value, y pred Represents the model prediction value. The above process executes num local training rounds, optionally, num = 1, 5, and after training the specified local rounds, the model initial parameters of the updated local runoff prediction model are obtained. It can be understood as the model initial parameter learner Based on Node B i The initial model parameters of the local runoff prediction model learned from the data distribution.

[0087] Step 5: The purpose of this step is to evaluate the model initial parameter learner using the query set At Node B i The initial parameters of the model learned The effects include:

[0088] S510: Get updated After that, the local computing node B i Based on the query set from the training set Sampled query subset Perform forward propagation calculation to get the test loss And according to the test loss Calculate the corresponding gradient g i , the specific calculation formula is as follows:

[0089]

[0090]

[0091] in, Represents the loss function, and the loss function used is also MSE. and Represent the features and corresponding labels of a single sample in the query set, respectively. Output results for the model. is the true runoff value, represents the gradient calculation, g i express for The gradient of to w i The second-order derivative of the gradient is used to optimize the initial parameter learner of the model

[0092] S520: Local computing node B i The calculated gradient g i Sent to parameter server PS.

[0093] The local computing nodes participating in this round of federated training are all in parallel training state to increase the training speed.

[0094] Step 6: The purpose of this step is to optimize the initial parameter learner of the model based on the gradient uploaded by the local computing node. The specific process is as follows:

[0095] S610: The parameter server PS aggregates the gradients uploaded by all K local computing nodes participating in this round of federated training based on synchronous training to capture the intrinsic connection between runoff flow and meteorological characteristics between different watersheds corresponding to different computing nodes, and obtains the gradient set {g1; g2; ...; g K}, the gradient is used to optimize the model initial parameter learner

[0096] S620: The parameter server PS receives the gradient set {g1; g2; ...; g K}For the model initial parameter learner The value of round t Use the gradient descent algorithm to update and get the value of the t+1th round The specific calculation formula is:

[0097]

[0098] Among them, β represents the learning rate, which is different from the learning rate α during local model training, and K represents the number of watersheds participating in this round of federated training.

[0099] Step 7: If the model converges or the number of federated training reaches the specified communication rounds, the training ends. After the training ends, each local computing node will get the same model initial parameter learner. Value Otherwise, repeat steps 3 to 7.

[0100] The above steps 3 to 7 are the federation training stage.

[0101] Step 8: After the federated training is completed, the model adjustment phase begins. The specific process is as follows:

[0102] Each local computing node B i , based on the model initial parameter learner Value This value can be regarded as the local computing node B i The trained local runoff prediction model f(w i )’s initial model parameters w i ,Right now First, from the support set on the test set The support subset sampled from Training is performed on the num-step gradient descent algorithm, optionally: num = 1, 5, 10, so as to quickly obtain model parameters adapted to the local data distribution And obtain a local runoff prediction model adapted to the data distribution of local computing nodes Using local runoff prediction models Query set on the test set Conduct runoff forecasts and evaluate local runoff forecast models The prediction effect can be evaluated by using the Nash efficiency coefficient (NSE): an indicator commonly used in the hydrological field to verify the simulation results of hydrological models, and the root mean square error (RMSE) to evaluate the deviation between the predicted value and the true value:

[0103]

[0104]

[0105] in, Represents the query set in the test set used to evaluate the model effect. represents the number of samples in the query set, x j and j Represent the features and corresponding labels of a single sample in the query set, respectively. Represents the model prediction value, y j represents the true runoff value, Represents a query set Mean runoff flow, NSE∈(-∞,1). The closer NSE is to 1, the better the trained runoff prediction model is. The smaller the RMSE value, the higher the prediction accuracy.

[0106] In summary, the present invention jointly trains multiple river basins containing runoff and meteorological data through the method of federated learning, so as to capture the hydrological information characteristics of multiple river basins, and solves the problem of hydrological information islands to a certain extent by improving the learning process of traditional federated learning, improves the prediction accuracy, and provides a reference for realizing hydrological and water resources information analysis in areas with little or no data.

Claims

1. A runoff prediction method based on improved federated learning, characterized by: The following steps are involved: Step 1: The parameter server sends the model initial parameter learner The tth round Send it to the randomly selected K local computing nodes participating in this round of federated training; t∈(0,S), where S is the specified communication round; K=rn, r∈(0,1), n ​​is the total number of participating basins, and n basins correspond to n local computing nodes; Step 2: After receiving the initial model parameter learner The tth round The following training steps are performed in parallel on the local computing nodes: The model initial parameter learner The tth round The initial model parameters of the local runoff prediction model of the local computing node are denoted as w i , represents the initial model parameters of the tth round of the local runoff prediction model of the i-th local computing node; Based on the initial model parameters w i and from the support set N randomly selected from S The support subset consists of samples Train and optimize the local runoff prediction model of the local computing node to obtain the optimized initial model parameters Based on the optimized initial model parameters and from the queryset N randomly selected from Q The query subset consists of samples Calculate the test loss and calculate the corresponding gradient g based on the test loss i ; Step 3: The parameter server aggregates the gradients of all K local computing nodes participating in this round of federated training to obtain the gradient set {g1; g2; ...; g K }; Based on the gradient set {g1; g2; ...; g K }For the model initial parameter learner The tth round Use the gradient descent algorithm to update and get the t+1th round value Step 4: Determine whether the model converges or the number of iterations reaches the specified communication round. If a certain condition is met, execute step 5, otherwise continue to execute steps 1 to 4; Step 5: Initialize the model parameters The tth round As value Send it to all n local computing nodes; Step 6: For each local compute node, based on the value Further fine-tuning is performed, including the following steps: The value As the initial model parameters of the local runoff prediction model, the support set on the local computing node is used The local runoff prediction model is trained and the query set is used Conduct tests and eventually obtain model parameters that adapt to local data distribution; Based on the model parameters, the local runoff is predicted and the prediction results are obtained; Among them, in step 2, the initial model parameter w i and from the support set The support subset sampled from The local runoff prediction model f(w i ) to perform training optimization and obtain the optimized initial model parameters The specific calculation formula is: in, represents the sampled support subset The number of samples, L i (w i ) is the loss value, x and y represent the features and corresponding labels of a single sample in the support set, respectively, l i (f(w i ; x), y) represents the model output result f(w i ; The loss between x) and the true value y, α represents the learning rate set by the local runoff prediction model, Indicates L i (w i ) for w i The gradient of In step 2, the optimized initial model parameters and from Sampled query subset Calculate the test loss and calculate the corresponding gradient g based on the test loss i , the specific process is: Get updated Then, based on the query subset in the training set Perform the forward propagation calculation process to get the test loss And according to the test loss Calculate the corresponding gradient g i : in, represents the number of sampled query subsets, and Represent the features and corresponding labels of a single sample in the query set, respectively. Represents the model output results With the true value The loss between represents the gradient calculation, g i express For w i The gradient of In step 3, the gradient set {g1; g2; ...; g K }For the model initial parameter learner The tth round Use the gradient descent algorithm to update and get the t+1th round value The specific calculation formula is: Among them, β represents the model initial parameter learner The learning rate is set, and K represents the number of watersheds participating in this round of federated training.

2. The runoff prediction method based on improved federated learning according to claim 1, characterized in that: The support set Query Set and support set Query Set They are constructed through the following steps: Rainfall, shortwave downward radiation, daily maximum temperature, daily minimum temperature, and atmospheric pressure were selected as data features, and the daily runoff of the basin was used as the label; Convert data features and labels into dimensionless pure values; Based on the time step T, the converted values ​​are converted into data in the form of supervised learning problems, thereby constructing a data set; Split the dataset into training and test sets, and subdivide the training set into support sets and queryset The test set is also subdivided into support sets and queryset 3. A runoff prediction system based on improved federated learning, characterized in that: include: n local computing nodes, deployed in the corresponding watersheds, with built-in local runoff prediction models, used to perform federated learning steps and local runoff prediction model adjustment steps; Among them, the federated learning steps include: The initial model parameter learner sent by the parameter server The tth round The initial model parameters of the local runoff prediction model of the local computing node are denoted as w i , represents the initial model parameters of the tth round of the local runoff prediction model of the i-th local computing node; Based on the initial model parameters w i and from the support set The support subset sampled from Train and optimize the local runoff prediction model of the local computing node to obtain the optimized initial model parameters Based on the optimized initial model parameters and from the queryset The query subset sampled from Calculate the test loss and calculate the corresponding gradient g based on the test loss i ; The gradient g i Upload to the parameter server; The local runoff prediction model adjustment steps include: The value sent by the parameter server As initial model parameters for local runoff prediction models; Using the support set on the local computing node The local runoff prediction model is trained to obtain model parameters adapted to local data distribution; Based on the model parameters, local runoff is predicted; Parameter server, built-in model initial parameter learner Used to perform the following steps: The model initial parameter learner Value Send it to K randomly selected local computing nodes; Aggregate the gradients of the K local computing nodes participating in this round of federated training to obtain the gradient set {g1; g2; ...; g K }; Based on the gradient set {g1; g2; ...; g K }For the model initial parameter learner The tth round Use the gradient descent algorithm to update and get the t+1th round value Determine whether the model converges or the number of iterations reaches the specified communication round in the federated learning step. If a certain condition is met, the model initial parameter learner The tth round As value Send it to all n local computing nodes; if none of them meet the requirements, continue to execute the above federated learning steps; The initial model parameters w i and from the queryset The support subset sampled from The local runoff prediction model f(w i ) to perform training optimization and obtain the optimized initial model parameters The specific calculation formula is: in, represents the sampled support subset The number of samples, L i (w i ) is the training loss value, x and y represent the features and corresponding labels of a single sample in the support set, respectively, l i (f(w i ; x), y) represents the model output result f(w i ; The loss between x) and the true value y, α represents the learning rate set by the local runoff prediction model, Indicates L i (w i ) for w i The gradient of The optimized initial model parameters and from the queryset The query subset sampled from Calculate the test loss and calculate the corresponding gradient g based on the test loss i , the specific process is: Get updated Then, based on the sampling query subset Perform the forward propagation calculation process to get the test loss And according to the test loss Calculate the corresponding gradient g i : in, represents the number of sampled query subsets, and Represent the features and corresponding labels of a single sample in the query set, respectively. Represents the model output results With the true value The loss between represents the gradient calculation, g i express For w i The gradient of The gradient set {g1; g2; ...; g K }For the model initial parameter learner The tth round Use the gradient descent algorithm to update and get the t+1th round value The specific calculation formula is: Among them, β represents the model initial parameter learner The learning rate is set, and K is the number of watersheds participating in this round of federated training.