<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xml:lang="EN" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Water</journal-id>
<journal-title>Frontiers in Water</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Water</abbrev-journal-title>
<issn pub-type="epub">2624-9375</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/frwa.2023.1271780</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Water</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>An active learning convolutional neural network for predicting river flow in a human impacted system</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name><surname>Reed</surname> <given-names>Scott M.</given-names></name>
<xref ref-type="corresp" rid="c001"><sup>&#x0002A;</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/114480/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/conceptualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/methodology/"/>
<role content-type="https://credit.niso.org/contributor-roles/software/"/>
<role content-type="https://credit.niso.org/contributor-roles/visualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
</contrib>
</contrib-group>
<aff><institution>Department of Chemistry, University of Colorado Denver</institution>, <addr-line>Denver, CO</addr-line>, <country>United States</country></aff>
<author-notes>
<fn fn-type="edited-by"><p>Edited by: Francesco Granata, University of Cassino, Italy</p></fn>
<fn fn-type="edited-by"><p>Reviewed by: Fabio Di Nunno, University of Cassino, Italy; Yuankun Wang, North China Electric Power University, China</p></fn>

<corresp id="c001">&#x0002A;Correspondence: Scott M. Reed <email>scott.reed&#x00040;cudenver.edu</email></corresp>
</author-notes>
<pub-date pub-type="epub">
<day>17</day>
<month>10</month>
<year>2023</year>
</pub-date>
<pub-date pub-type="collection">
<year>2023</year>
</pub-date>
<volume>5</volume>
<elocation-id>1271780</elocation-id>
<history>
<date date-type="received">
<day>02</day>
<month>08</month>
<year>2023</year>
</date>
<date date-type="accepted">
<day>25</day>
<month>09</month>
<year>2023</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2023 Reed.</copyright-statement>
<copyright-year>2023</copyright-year>
<copyright-holder>Reed</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p></license></permissions>
<abstract>
<p>The South Platte river system contains a mixture of natural streams, reservoirs, and pipeline projects that redirect water to front range communities in Colorado. At many timepoints, a simple persistence model is the best predictor for flow from pipelines and reservoirs but at other times, flows change based on snowmelt and inputs such as reservoir fill rates, local weather, and anticipated demand. Here we find that a convolutional Long Short-Term Memory (LSTM) network is well suited to modeling flow in parts of this basin that are strongly impacted by water projects as well as ones that are relatively free from direct human modifications. Furthermore, it is found that including an active learning component in which separate Convolutional Neural Networks (CNNs) are used to classify and then select the data that is then used for training a convolutional LSTM network is advantageous. Models specific for each gauge are created by transfer of parameter from a base model and these gauge-specific models are then fine-tuned based a curated subset of training data. The result is accurate predictions for both natural flow and human influenced flow using only past river flow, reservoir capacity, and historical temperature data. In 14 of the 16 gauges modeled, the error in the prediction is reduced when using the combination of on-the-fly classification by CNN followed by analysis by either a persistence or convolutional LSTM model. The methods designed here could be applied broadly to other basins and to other situations where multiple models are needed to fit data at different times and locations.</p></abstract>
<kwd-group>
<kwd>neural network</kwd>
<kwd>artificial intelligence</kwd>
<kwd>LSTM</kwd>
<kwd>CNN</kwd>
<kwd>river</kwd>
<kwd>convolutional LSTM</kwd>
</kwd-group>
<counts>
<fig-count count="9"/>
<table-count count="2"/>
<equation-count count="2"/>
<ref-count count="32"/>
<page-count count="13"/>
<word-count count="6289"/>
</counts>
<custom-meta-wrap>
<custom-meta>
<meta-name>section-at-acceptance</meta-name>
<meta-value>Water and Artificial Intelligence</meta-value>
</custom-meta>
</custom-meta-wrap>
</article-meta>
</front>
<body>
<sec id="s1">
<title>1. Introduction</title>
<p>Machine learning methods for numerical prediction of streamflow have recently been utilized alongside traditional hydrological models. CNNs have been used to predict flow in rivers (Duan et al., <xref ref-type="bibr" rid="B4">2020</xref>; Shu et al., <xref ref-type="bibr" rid="B25">2021</xref>) and in urban areas prone to flooding (Chiacchiera et al., <xref ref-type="bibr" rid="B2">2022</xref>). Recurrent Neural Networks (RNNs) have also been used to predict flow (van der Lugt and Feelders, <xref ref-type="bibr" rid="B29">2020</xref>). These and other deep learning methods have been recently reviewed (Sit et al., <xref ref-type="bibr" rid="B26">2020</xref>; Le et al., <xref ref-type="bibr" rid="B14">2021</xref>) including the role of deep learning methods in predicting flow in urban areas (Fu et al., <xref ref-type="bibr" rid="B7">2022</xref>). LSTM models are particularly well-suited to time-series forecasting (Sagheer and Kotb, <xref ref-type="bibr" rid="B22">2019</xref>) as they retain time-dependent connections and a number of studies have shown that LSTM models incorporating hydrological inputs can successfully predict rainfall runoff (Kratzert et al., <xref ref-type="bibr" rid="B13">2018</xref>; Poornima and Pushpalatha, <xref ref-type="bibr" rid="B20">2019</xref>; Xiang et al., <xref ref-type="bibr" rid="B31">2020</xref>) over both short and medium timescale (Granata and Di Nunno, <xref ref-type="bibr" rid="B9">2023</xref>). However, the consensus is that innovation in deep learning models will be required to further improve forecasting over numerical models (Schultz et al., <xref ref-type="bibr" rid="B23">2021</xref>).</p>
<p>The convolutional LSTM (Shi et al., <xref ref-type="bibr" rid="B24">2015</xref>) is based on a fully connected LSTM but uses convolution outputs directly as part of reading input into the LSTM units. This approach is appealing to weather forecasting as it enables the patterns identified within past data, to be identified across time points in past data and projected forward in future predictions. Convolutional LSTMs have been used in applications as varied as predicting stock prices (Fang et al., <xref ref-type="bibr" rid="B6">2021</xref>) and air cargo transport patterns (Anguita and Olariaga, <xref ref-type="bibr" rid="B1">2023</xref>) and have recently been used for rainfall nowcasting (Liu et al., <xref ref-type="bibr" rid="B16">2022</xref>) and flood forecasting (Moishin et al., <xref ref-type="bibr" rid="B18">2021</xref>).</p>
<p>Here a river system that has a complicated combination of features many of which are highly impacted by human influence is modeled using both a CNN and a convolutional LSTM. Transfer learning, which has been successfully applied to benchmarked time series forecasting improving accuracy (Gikunda and Jouandeau, <xref ref-type="bibr" rid="B8">2021</xref>), is used here to create gauge specific models after initial training on all gauges with a single model. This is combined with an active learning (Ren et al., <xref ref-type="bibr" rid="B21">2021</xref>) approach to efficiently utilize the data available for training. Specifically, a CNN based classifier is used to select a subset of data most suitable for training the convolutional LSTM models and individual models for each predicted gauge are created through transfer learning from the base model. This same classification model is used to determine if a given set of input data is better modeled by a persistence model or the Convolutional LSTM for that gauge to provide on-the-fly model selection. This work uses a novel combination of transfer learning and active learning to account for the variability between the different streamflows being predicted. This combination improves the prediction accuracy of both the highly variable snowmelt driven gauges and the flows from water projects that have less variability over time. This method of combining classification and active learning approaches could be extended to combine other types of models.</p></sec>
<sec id="s2">
<title>2. Materials and methods</title>
<sec>
<title>2.1. Model</title>
<p>The upper region of the South Platte river basin (<xref ref-type="fig" rid="F1">Figure 1</xref>) serves as a water source for numerous communities. Colorado front range communities draw water from the South Platte and other nearby rivers to meet their water needs throughout the year. Data inputs were used from the major reservoirs (Stronita Springs, Cheesman, and Chatfield) along the South Platte, tunnels including ones that bring water across the Continental Divide (Roberts and Moffat tunnels) or move water within the drainage (homestake), and gauges representative of the many un-dammed streams (south fork of the South Platte, middle fork of Prince, and South Platte above Spinney), as well as gauges that are located below reservoirs (Eleven mile outflow, Antero outflow, below Brush creek, and Deckers), and the pipes (conduit 20 and 26) that send water from the reservoirs into Denver. Gauges were also included in the model that are outside of the South Platte drainage but are a part of the Denver Water system including South Boulder creek which supplies water to Denver and the Blue River below Dillon Reservoir which reflects releases of water into the Colorado that are therefore unavailable for transfer to the front range. Finally, gauges were included that do not directly supply water to the front range but that are connected indirectly because they are managed by Denver Water and governed by the Colorado River Compact of 1922 (MacDonnell, <xref ref-type="bibr" rid="B17">2023</xref>) which sets the total amount of water that must be sent to downstream states. Transfers of water eastward across the Divide are often offset by releases into the Colorado River to comply with this compact.</p>
<fig id="F1" position="float">
<label>Figure 1</label>
<caption><p>Map showing region including location of the gauges examined in this study.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frwa-05-1271780-g0001.tif"/>
</fig>
<p>Gauges were selected for the final model by examining which gauges in this region showed strong correlations to each other within this river basin (<xref ref-type="fig" rid="F2">Figure 2</xref>). Some strong correlations are due to close geography. For example, the majority of the flow out of Strontia Spring reservoir flows directly into Chatfield reservoir and these gauges have a 0.969203 Pearson correlation coefficient. In contrast, a correlation of &#x02212;0.126896 is seen between the Roberts tunnel which brings water from Dillon reservoir across the continental divide to be used in Denver and the inflow to Cheesman reservoir, which feeds Denver from other sources east of the divide. When water is available east of the divide, water is not transported from west of the divide.</p>
<fig id="F2" position="float">
<label>Figure 2</label>
<caption><p>Correlation heatmap for raw data from all riverflow gauges using data from 1996 through 2021.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frwa-05-1271780-g0002.tif"/>
</fig>
<p>The homestake pipeline stands out as being negatively correlated with many of the other gauges. This project takes water from the South Platte basin and delivers it further south, to the city of Colorado Springs. Similarly, two other gauges that were geographically within this region but delivered water to the town of Aurora likewise had weaker correlations.</p></sec>
<sec>
<title>2.2. Data inputs</title>
<p>Data from 1996 through 2021 was collected using the Colorado Division of Water Resources (<ext-link ext-link-type="uri" xlink:href="https://dwr.state.co.us/Rest/">https://dwr.state.co.us/Rest/</ext-link>) Application Programming Interface. Outlier datapoints 2 times above the 95th percentile or below the 10th percentile in flow or capacity were removed. Historical weather data was obtained from the National Centers for Environmental Information (<ext-link ext-link-type="uri" xlink:href="https://www.ncdc.noaa.gov/cdo-web/datasets">https://www.ncdc.noaa.gov/cdo-web/datasets</ext-link>) for the city of Lakewood, Colorado which is close to the region of study, receives water from this river system, and has a long and continuous set of temperature readings through the period of study. Training was performed on all days available where 21 prior days are included in the model and 7 future days are predicted.</p></sec>
<sec>
<title>2.3. Seasonality adjustments</title>
<p>While any river flow data is likely to have seasonal variation, the data used here presents unique challenges. In a river system heavily influenced by anthropogenic activity, not all gauges follow a similar pattern of seasonality. Some gauges on unmodified streams have seasonality expected for natural rivers with increased flow during spring snowmelt. Other gauges are inactive for long periods of time, and some have absolutely no variability for the majority of the year. Some of the gauges that are largely inactive become active during spring runoff, but others are countercyclical, changing little during the spring, but becoming more active at other times of year. For example, several tunnels bring water across the continental divide and are often most active in the fall when water demands in the front range cannot be met with natural flow from streams into reservoirs.</p>
<p>Winter data was removed because flow is negligible at most of the gauges, however, this creates a discontinuity in the data. While careful selection of start and end dates can avoid using data that crosses this discontinuity, it is desirable to have flexibility in data handling and training of the neural network. Ideal flexibility would allow for selecting gauges, past and future window lengths, and setting weights prior to editing out data that contains such discontinuities. Under these circumstances, a final step must be performed to remove data that crosses the discontinuity. Since there are no column labels on data used for training and validation, another method is needed for identifying data that crosses this discontinuity. For this reason, a unique identifier is created by multiplying two arbitrarily selected column values. This product acts as a unique identifier of discontinuities and it is used to identify datasets containing discontinuities to be removed immediately before training.</p>
<p>After combining all seasons, the data was split into three sets. The first set was used for training the neural networks. A second validation set used to periodically check the network against data that had not yet been seen by the model to protect against overfitting; when validation data did not improve the fit, fitting was stopped regardless of whether the training data was still improving the quality of fit. Finally, a third set of data was set aside and not used for training or validation but rather for testing the model. All evaluation reported here is based on how well the model handled this testing data that was not used for training or for validation. All the data was Z-score normalized and the mean and standard deviation for the training set was used to normalize the training, validation, and testing data sets to avoid risk of information creeping into the validation and testing set. A final practical consideration centered on what years to include in each set. Given that later years had more gauges available, setting aside only later years for validation and testing was not practical. Instead, the training set was constructed from a mixture of older data (1996&#x02013;2012) and newer data (2017&#x02013;2021), validation was based on 2013&#x02013;2014 and testing was based on 2015&#x02013;2016. The total training data contained 4,558 elements and the validation data contained 398 elements where each element corresponds to three prior weeks of data connected to labels composed of the actual data (flow, temperature, and reservoir capacity) for the following 7 days.</p></sec>
<sec>
<title>2.4. Simulated weather forecasts</title>
<p>Changes to water flow at some gauges are based on water managers and water users making predictions about their anticipated needs. For example, a farmer might place a water rights call when the forecast temperatures are high in upcoming days. For this reason, the forecast high temperatures for the next 4 days were included into the model. With the goal of forecasting based on current conditions, it is important to keep in mind that more accurate temperature forecasts are available now than in the past. And records of past forecasts are not available for as many regions with as many time points as are currently available. For these reasons, the past forecast data that was used was simulated. Specifically, the actual high temperatures recorded were used as a stand-in for what would have been an accurate prediction for those temperatures on previous days. With this method, any location that has accurate historical weather data can be used also as a source of simulated forecast data. This does not account for prior inaccurate forecasts that might have impacted changes to water use since these simulated forecasts are artificially perfect.</p></sec>
<sec>
<title>2.5. Neural network</title>
<p>The base and per-gauge neural networks were built using a tensorflow ConvLSTM2D with data inputs arranged into a two-dimensional grid. The gauge data was spread across the x and y axes normally used as image vectors, creating an artificial image of the data. Two ConvLSTM2D layers were used with a padded 3 by 3 kernel. The first layer encoded input data and the second layer included future predictions from the input labels. These were followed by a time-distributed Dense layer.</p>
<p>Optimization of the ConvLSTM2D base model and each per-gauge model was done with Root Mean Squared Propagation, a learning rate of 0.003, and a clip value of 1.0. Kernel regularizers, recurrent regularizers, bias regularizers, and activity regularizer were all set to 1x10-6. A dropout and a recurrent dropout of 0.3 was used.</p>
<p>The classifier was based on a simple 3D CNN using a padded kernel of 3 with sigmoidal activation. The categorization model used a glorot uniform kernel initializer, an orthogonal recurrent initializer, and a bias initializer of zeros. Kernel regularizers, recurrent regularizers, bias regularizers, and activity regularizer were all set to 1x10-6. The recurrent activation was hard sigmoid, and the model was optimized using adam while minimizing losses calculated with sparse categorical cross entropy.</p>
<p>Training was performed in multiple steps (<xref ref-type="fig" rid="F3">Figure 3</xref>), starting with the base ConvLSTM2D using all available data. Next, this base model was used to evaluate the training data a second time with the goal of determining in which cases the base model performed better than a simple persistence model. The ratio of mean average error (MAE) for the LSTM model and the persistence model was recorded and then used as a label for training the classification model. The classification models for each gauge were also built with CNNs but with a final sigmoidal activation producing a single value between 0 and 1 to describe each data input rather than predicting the future flow. Using min-max normalization of the ratio of MAE values for each individual gauge, a label between 0 and 1 was produced for each input that conveys whether that data was best described using a persistence model or the base model. A separate classification model was made for each gauge of interest (<xref ref-type="table" rid="T1">Table 1</xref>). The final gauge-specific models were trained on only data that was rated by the classifier as being modeled better by the base (convolutional LSTM) model than a persistence model. Each gauge had its own LSTM model with its weights optimized during training.</p>
<fig id="F3" position="float">
<label>Figure 3</label>
<caption><p>Sequence of model training and testing.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frwa-05-1271780-g0003.tif"/>
</fig>
<table-wrap position="float" id="T1">
<label>Table 1</label>
<caption><p>Description of models used.</p></caption> 
<table frame="box" rules="all">
<thead>
<tr style="background-color:&#x00023;919498;color:&#x00023;ffffff">
<th valign="top" align="left"><bold>Name</bold></th>
<th valign="top" align="left"><bold>Base model</bold></th>
<th valign="top" align="left"><bold>Classification model</bold></th>
<th valign="top" align="left"><bold>Active learning model</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Type</td>
<td valign="top" align="left">LSTM</td>
<td valign="top" align="left">CNN-Sigmoid</td>
<td valign="top" align="left">LSTM</td>
</tr> <tr>
<td valign="top" align="left">Train data</td>
<td valign="top" align="left">4,558</td>
<td valign="top" align="left">4,558</td>
<td valign="top" align="left">2,739&#x02013;4,524 per model</td>
</tr> <tr>
<td valign="top" align="left">Val data</td>
<td valign="top" align="left">398</td>
<td valign="top" align="left">398</td>
<td valign="top" align="left">230&#x02013;364 per model</td>
</tr> <tr>
<td valign="top" align="left">Sample weights</td>
<td valign="top" align="left">All gauges equal</td>
<td valign="top" align="left">Active gauge = 1, inactive = 0</td>
<td valign="top" align="left">Active gauge = 1, inactive = 0</td>
</tr> <tr>
<td valign="top" align="left">Time weights</td>
<td valign="top" align="left">Uniform with time</td>
<td valign="top" align="left">none</td>
<td valign="top" align="left">Decreasing with time</td>
</tr> <tr>
<td valign="top" align="left">Epochs required</td>
<td valign="top" align="left">33</td>
<td valign="top" align="left">15/model</td>
<td valign="top" align="left">&#x0007E;15/model</td>
</tr> <tr>
<td valign="top" align="left">Time to train</td>
<td valign="top" align="left">3 min</td>
<td valign="top" align="left">5 min combined</td>
<td valign="top" align="left">1 min/model</td>
</tr></tbody>
</table>
</table-wrap>
<p>The slowest training step was creating the persistence labels which took 89 min. However, once created, these could be used for many different attempts at optimizing the per-gauge LSTM models.</p></sec></sec>
<sec id="s3">
<title>3. Results</title>
<sec>
<title>3.1. Model analysis</title>
<p>Various methods are commonly used to evaluate river flow forecast accuracy. Both the Nash and Sutcliffe (<xref ref-type="bibr" rid="B19">1970</xref>) method (Eq 1) and the dimensionless version of the Willmott et al. (<xref ref-type="bibr" rid="B30">2011</xref>) technique (Eq 2) were utilized here. The shortcomings of the most common methods including these two have been documented (Legates and McCabe, <xref ref-type="bibr" rid="B15">1999</xref>; Jackson et al., <xref ref-type="bibr" rid="B12">2019</xref>). One particular concern that has been raised before for the Willmott method is that it is benchmarked against the variance in past data. For the type of data examined here, this is especially problematic as the past variance can be zero for gauges near reservoirs and pipes. Unlike natural streams, reservoir levels, tunnel flows, and gauges directly connected to reservoir outflows can report zero past fluctuation for substantial periods of time. The Nash method suffers from lacking a lower bound and being strongly influenced by extreme outliers. While neural networks have used Nash as a minimization function, both Nash and Willmott were unsatisfying as loss functions for multiple reasons. MAE was found to be a more satisfying minimization and evaluation criteria although both Nash:</p>
<disp-formula id="E1"><label>(1)</label><mml:math id="M1"><mml:mrow><mml:mi>E</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>&#x02212;</mml:mo><mml:mfrac><mml:mrow><mml:mstyle displaystyle='true'><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:mrow><mml:msup><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:msub><mml:mi>O</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle displaystyle='true'><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:mrow><mml:msup><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:mover accent='true'><mml:mi>O</mml:mi><mml:mo>&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:mstyle></mml:mrow></mml:mfrac></mml:mrow></mml:math></disp-formula>
<p>and Willmott error analysis:</p>
<disp-formula id="E2"><label>(2)</label><mml:math id="M2"><mml:mtable columnalign='left'><mml:mtr><mml:mtd><mml:mn>1</mml:mn><mml:mo>&#x02212;</mml:mo><mml:mfrac><mml:mrow><mml:mstyle displaystyle='true'><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:msub><mml:mi>O</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:mrow><mml:mrow><mml:mi>c</mml:mi><mml:mstyle displaystyle='true'><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:mover accent='true'><mml:mi>O</mml:mi><mml:mo>&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:mrow></mml:mfrac><mml:mtext>&#x000A0;&#x000A0;&#x000A0;when</mml:mtext><mml:mstyle displaystyle='true'><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:msub><mml:mi>O</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:mstyle><mml:mo>&#x02264;</mml:mo><mml:mi>c</mml:mi><mml:mstyle displaystyle='true'><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:mover accent='true'><mml:mi>O</mml:mi><mml:mo>&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:mstyle><mml:mo>&#x000A0;</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mtext>&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;and&#x000A0;&#x000A0;</mml:mtext></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mtext>&#x000A0;</mml:mtext><mml:mfrac><mml:mrow><mml:mi>c</mml:mi><mml:mstyle displaystyle='true'><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:mover accent='true'><mml:mi>O</mml:mi><mml:mo>&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle displaystyle='true'><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:msub><mml:mi>O</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:mrow></mml:mfrac><mml:mo>&#x02212;</mml:mo><mml:mn>1</mml:mn><mml:mtext>&#x000A0;&#x000A0;&#x000A0;when</mml:mtext><mml:mstyle displaystyle='true'><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:msub><mml:mi>O</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:mstyle><mml:mo>&#x0003E;</mml:mo><mml:mi>c</mml:mi><mml:mstyle displaystyle='true'><mml:msubsup><mml:mo>&#x02211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:msubsup><mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:mover accent='true'><mml:mi>O</mml:mi><mml:mo>&#x000AF;</mml:mo></mml:mover></mml:mrow><mml:mo>|</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>MAE was found to be a more satisfying both Nash (Eq 1) and Willmott (Eq 2) analysis of the model using the set aside test data set are provided here. While the MAE is very direct and easily understandable, one drawback is that it is not scaled. As a result, gauges that have higher average flows tend to have predictions with larger MAE values. The impact of this scaling issue on using MAE for optimization is minimal. Most of the models described here are specific to a single gauge, so minimizing them based on errors on that gauge is not problematic. In the base model, all gauges are weighted equally, and higher flow gauges may disproportionately impact the gradient descent, but this base model is not used directly for predictions. Another consequence of using MAE is that when comparing predictions on the test data it can appear that gauges with higher average flow have larger errors. One common method to solve this is to scale errors using the mean absolute scaled error (MASE) (Hyndman and Koehler, <xref ref-type="bibr" rid="B11">2006</xref>). However, the MASE would be infinite or undefined when recent historical observations are all equal in value, which is common for this type of data.</p>
<p>Each final LSTM model used a different number of days of data (out of a possible 4558) for training. While the initial training was performed on all 4,558 data sets, the classification allowed for curating the training set to contain only that data expected to help the most. The classification method when applied to selecting data used in the final model for each gauge ranged from 2,739 to 4,524 (<xref ref-type="fig" rid="F4">Figure 4</xref>) out of the possible 4,558 days available. The gauges nearer water projects used the persistence model more frequently than the natural streams.</p>
<fig id="F4" position="float">
<label>Figure 4</label>
<caption><p>Number of days used in training final LSTM models.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frwa-05-1271780-g0004.tif"/>
</fig>
<p>When a 7-day prediction was run on 210 days of test data, the prediction 1 day into the future was close to that of the persistence model (<xref ref-type="fig" rid="F5">Figure 5</xref>). In cases where there were rapid changes in flow, typically a rise, the convolutional LSTM model often was slower to show the increase. The convolutional LSTM models had mixed results when reservoirs or pipelines had long periods without any change. In some cases, such as below Dillon reservoir, this model was very similar to the persistence model. In other cases, such as homestake pipeline and cheesman reservoir, the convolutional LSTM model predicted flow at large sections of time when there was no flow recorded. Natural undammed streams such as below brush were reasonably accurate although the convolutional LSTM model was slower to respond to rapid changes. When run on the test data, the number of weeks labeled as being better modeled with persistence ranged from 98 to 133 out of the 210 days evaluated (yellow points in <xref ref-type="fig" rid="F5">Figure 5</xref>).</p>
<fig id="F5" position="float">
<label>Figure 5</label>
<caption><p>Two hundred and ten days of testing data where each gauge is modeled one day ahead using a persistence model and a gauge-specific convolutional LSTM for 2015 and 2016. A yellow square on the baseline indicates that the CNN classifier identified the convolutional LSTM as the better model based on the input past data. Blue line represents actual data, red the persistence model prediction, and green the convolutional LSTM prediction.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frwa-05-1271780-g0005.tif"/>
</fig>
<p>In the same 7-day prediction, the prediction 7 days into the future was not unexpectedly, less accurate than 1 day into the future (<xref ref-type="fig" rid="F6">Figure 6</xref>). Again, when changes in flow were rapid, the convolutional LSTM model often was slower and did not rise as high as the actual flow (blue) or the persistence prediction (red). The convolutional LSTM models again overestimated flow at times when reservoirs or pipelines had long periods without any change such as in homestake, underestimated at other times as in Roberts tunnel, and identified small peaks below cheesman reservoir when the actual data had no such spike. Although the reservoir was undergoing repairs during this time period that may have caused it to deviate from the model prediction.</p>
<fig id="F6" position="float">
<label>Figure 6</label>
<caption><p>Two hundred and ten days of testing data where each gauge is modeled seven days ahead using a persistence model and a gauge-specific Convolutional LSTM for 2015 and 2016. A yellow square on the baseline indicates that the CNN classifier identified the Convolutional LSTM as the better model based on the input past data. Blue line represents actual data, red the persistence model prediction, and green the convolutional LSTM prediction.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frwa-05-1271780-g0006.tif"/>
</fig>
<p>The fully trained gauge specific models utilized approximately half of the available data provided from the classifier. These models trained on smaller datasets performed well at predicting flow from all the gauges. The median total error (sum of the absolute value of the difference between true value and predicted value for 7 future days combined) ranged from 0 cfs to as high as 413.7 cfs (<xref ref-type="fig" rid="F7">Figure 7</xref>). The models with the higher flow gauges showed larger errors, as expected.</p>
<fig id="F7" position="float">
<label>Figure 7</label>
<caption><p>Combined absolute value of difference between predicted and actual values (in cfs) from 2015 and 2016 for 7 days of forecast combined.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frwa-05-1271780-g0007.tif"/>
</fig>
<p>When analyzing the test data (<xref ref-type="fig" rid="F3">Figure 3</xref>, right) using this combination of classification CNN and convolutional LSTM predictor, the median Willmott values for all gauges ranged from 0.801 to 1.0 (<xref ref-type="fig" rid="F8">Figure 8</xref>). Here the lowest values were for pipeline and reservoir gauges rather than natural river and stream flows.</p>
<fig id="F8" position="float">
<label>Figure 8</label>
<caption><p>Error analysis on test data predictions from 2015 and 2016 using Willmott analysis.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frwa-05-1271780-g0008.tif"/>
</fig>
<p>The median Nash values for each gauge ranged from 0.65 to &#x02212;5.39 with gauges close to reservoirs showing worse performance. Here the Nash values are graphed as a boxplot after removing outliers one standard deviation beyond the IQR (<xref ref-type="fig" rid="F9">Figure 9</xref>).</p>
<fig id="F9" position="float">
<label>Figure 9</label>
<caption><p>Nash-Sutcliffe analysis of test data predictions from 2015 and 2016.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="frwa-05-1271780-g0009.tif"/>
</fig>
<p>Predictions were also made using the base model to allow for an analysis of the benefit of including the active learning and transfer learning into the overall model. In almost all cases, the final model performed better than the base model (<xref ref-type="table" rid="T2">Table 2</xref>) despite both being based on convolutional LSTM architecture, demonstrating that this approach does add to the forecast accuracy. The total error (over 7 days) was 11 to 196 cubic feet per second (cfs) better for the final model, all but two gauges had a better Willmott score, and all but 5 had a better Nash-Sutcliffe score. The propensity of Nash-Sutcliffe to overweight outliers likely impacted this result.</p>
<table-wrap position="float" id="T2">
<label>Table 2</label>
<caption><p>Average difference between LSTM base and final models in three metrics for all testing data.</p></caption> 
<table frame="box" rules="all">
<thead>
<tr style="background-color:&#x00023;919498;color:&#x00023;ffffff">
<th valign="top" align="left"><bold>Gauge</bold></th>
<th valign="top" align="center"><bold>Total error</bold></th>
<th valign="top" align="center"><bold>Willmott</bold></th>
<th valign="top" align="center"><bold>Nash</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">cfs_roberts</td>
<td valign="top" align="center">&#x02212;115.5</td>
<td valign="top" align="center">0.12</td>
<td valign="top" align="center">&#x02212;8.79</td>
</tr> <tr>
<td valign="top" align="left">cfs_deckers</td>
<td valign="top" align="center">&#x02212;33.5</td>
<td valign="top" align="center">&#x02212;0.03</td>
<td valign="top" align="center">&#x02212;29.79</td>
</tr> <tr>
<td valign="top" align="left">cfs_grant</td>
<td valign="top" align="center">&#x02212;59.0</td>
<td valign="top" align="center">0.07</td>
<td valign="top" align="center">&#x02212;1.18</td>
</tr> <tr>
<td valign="top" align="left">cfs_below_brush</td>
<td valign="top" align="center">&#x02212;45.0</td>
<td valign="top" align="center">0.03</td>
<td valign="top" align="center">&#x02212;28.28</td>
</tr> <tr>
<td valign="top" align="left">cfs_below_dillon</td>
<td valign="top" align="center">&#x02212;86.1</td>
<td valign="top" align="center">0.06</td>
<td valign="top" align="center">&#x02212;103.81</td>
</tr> <tr>
<td valign="top" align="left">cfs_waterton</td>
<td valign="top" align="center">&#x02212;6.6</td>
<td valign="top" align="center">0.00</td>
<td valign="top" align="center">13.71</td>
</tr> <tr>
<td valign="top" align="left">cfs_bailey</td>
<td valign="top" align="center">&#x02212;56.6</td>
<td valign="top" align="center">0.08</td>
<td valign="top" align="center">2.92</td>
</tr> <tr>
<td valign="top" align="left">cfs_cheesman_inflow</td>
<td valign="top" align="center">&#x02212;28.19</td>
<td valign="top" align="center">0.01</td>
<td valign="top" align="center">8.44</td>
</tr> <tr>
<td valign="top" align="left">cfs_above_chatfield</td>
<td valign="top" align="center">&#x02212;7.42</td>
<td valign="top" align="center">0.10</td>
<td valign="top" align="center">8.17</td>
</tr> <tr>
<td valign="top" align="left">cfs_below_strontia</td>
<td valign="top" align="center">&#x02212;15.98</td>
<td valign="top" align="center">&#x02212;0.08</td>
<td valign="top" align="center">&#x02212;20.00</td>
</tr> <tr>
<td valign="top" align="left">cfs_cheesman_res</td>
<td valign="top" align="center">2.41</td>
<td valign="top" align="center">0.26</td>
<td valign="top" align="center">0.46</td>
</tr> <tr>
<td valign="top" align="left">cfs_homestake_pipeline</td>
<td valign="top" align="center">&#x02212;33.71</td>
<td valign="top" align="center">0.14</td>
<td valign="top" align="center">&#x02212;7.78</td>
</tr> <tr>
<td valign="top" align="left">cfs_above_spinney</td>
<td valign="top" align="center">0.06</td>
<td valign="top" align="center">0.04</td>
<td valign="top" align="center">0.89</td>
</tr> <tr>
<td valign="top" align="left">cfs_11mile_outflow</td>
<td valign="top" align="center">&#x02212;40.32</td>
<td valign="top" align="center">0.05</td>
<td valign="top" align="center">2.54</td>
</tr> <tr>
<td valign="top" align="left">cfs_11mileinflow</td>
<td valign="top" align="center">&#x02212;26.21</td>
<td valign="top" align="center">0.07</td>
<td valign="top" align="center">4.79</td>
</tr> <tr>
<td valign="top" align="left">cfs_tarryall_borden</td>
<td valign="top" align="center">&#x02212;18.46</td>
<td valign="top" align="center">0.00</td>
<td valign="top" align="center">&#x02212;127.63</td>
</tr></tbody>
</table>
</table-wrap></sec></sec>
<sec id="s4">
<title>4. Discussion</title>
<p>A novel combination of neural networks was employed and in combination they provided more accurate predictions than a single convolutional LSTM model in isolation. The convolutional LSTM structure was a useful way to aggregate data from multiple inputs and to find patterns within those data sources while retaining time-based correlations within the data. The addition of a CNN based classifier to select data fed into the convolutional LSTM model training improved the accuracy of the predictions.</p>
<p>Unlike past ensemble methods, this is an on-the-fly approach where each dataset is examined to determine whether the characteristics of that dataset suggest the best method to fit the data. Two options are available although more could be added. Either the data is fit to a very simple persistence model or the data is fit to a convolutional LSTM. Yellow boxes in <xref ref-type="fig" rid="F5">Figures 5</xref>, <xref ref-type="fig" rid="F6">6</xref> reveal the granularity of this approach with model selection sometimes varying day by day and gauge by gauge.</p>
<p>Selection of an optimal model from among multiple models has long been performed using cross-validation (van der Laan et al., <xref ref-type="bibr" rid="B28">2007</xref>). A more recent approach, the super ensemble method (Tyralis et al., <xref ref-type="bibr" rid="B27">2021</xref>), combines multiple machine learning (ML) methods and applies a weighting to each method. This is computationally expensive as each ML method must be run even if it is determined that it merits an insignificant weighting. Also, this is not an on-the-fly method that adapts to different data inputs. If certain input data being used for a prediction is better suited to one of the aggregated ML methods than another, the weightings are not updated. Furthermore, hybrid methods have been developed (Di Nunno et al., <xref ref-type="bibr" rid="B3">2023</xref>; Granata and Di Nunno, <xref ref-type="bibr" rid="B9">2023</xref>) that combine both machine learning and deep learning methods to forecast streamflow. These also do not adapt to data on the fly.</p>
<p>The approach described here is a unique ensemble method although the selection is simply between two possible models (persistence or convolutional LSTM). Here only one of the two models is selected as opposed to the super ensemble approach which might be more suitable for combining multiple machine learning approaches. Here, if conditions are expected to result in no flow changes, a simple persistence model is the best possible predictor, so mixing in other methods might reduce the performance.</p>
<p>This approach is unique in that CNN convolutions of the data in the two dimensions the data is assembled and in the third dimension (time) are used to classify and thereby select a model to fit the data. This captures the same variability in data that is used in the LSTM based forecast. Unlike past ensemble methods, this is an on-the-fly approach where each analyzed dataset is examined to determine whether the characteristics of that dataset suggest the best method to fit the data with. Two options are available although more could be added. Local neighbors within the past states of the data determine the future states. In isolation, a CNN may seem like a heavy-handed method for characterizing data and selecting a model, however, the work of arranging the data into the structure necessary for analyzing by a CNN is already completed in preparation for analysis by the convolutional LSTM. We have not directly compared this classifies to other ensemble methods, which would be a worthwhile comparison, however, a more standard dataset may be more suitable to that analysis.</p>
<p>These models provide accurate predictions of flow both upriver and downriver of reservoirs and pipelines. These predictions could be useful to water users and water managers in modeling how individual decisions in one area effect other areas. Models of reservoir impacted streamflow have been proposed as a guide to support reservoir operations (Zhao and Cai, <xref ref-type="bibr" rid="B32">2020</xref>) and have been modeled using machine learning (Huang et al., <xref ref-type="bibr" rid="B10">2021</xref>). In addition to predicting flows, this method could be useful for modeling how to make changes to reservoir operations to account for climate change and other factors.</p>
<p>Other combinations could be used where a classifier selected data to be used in training later models in an active learning step. LSTM is one of many neural networks that can be used to predict future flows and classifier could be used to select between many different models.</p></sec>
<sec id="s5">
<title>5. Conclusions</title>
<p>The approach described here could be most suitable to forecasting in circumstances with large variation in inputs, such as extreme weather events. Combining multiple models that work under different circumstances allows monitoring for large changes while still using the best model available for more normal circumstances.</p>
<p>Predicting flow in rivers where human decision making is involved can only succeed when similar decisions were included in the training data. Singular events, such as repairs to a tunnel, or draw down of a reservoir for repairs may occur too infrequently to be modeled within the training data. One missing variable, in particular, are water calls made by downstream users. These calls may be made based on weather conditions far outside the river basin and add to uncertainty in these predictions.</p>
<p>The approach used here improves prediction accuracy but does so with an increase in complexity. Many different neural networks are used, and the process of transfer learning increases this complexity. Making changes to the data processing in this format can be challenging. It is not possible for example to drop a single gauge part way through the process, although weights can be used to minimize the influence of that gauge.</p>
<p>Optimizing a combination of neural networks such as this is complicated. Relatively minimal effort has been made to fully optimize all the possible hyperparameters because of this. Specifically, a few different regularization values and batch sizes were explored in the base LSTM model. Once selected, these values were used throughout with all subsequent models. Methods are available to systematically explore hyperparameters (Dumont et al., <xref ref-type="bibr" rid="B5">2021</xref>), however, it would take significant adaptation to use these approaches and to allow the hyperparameters to vary between models.</p>
<p>This approach could be employed recursively by creating a new classifier not from the base LSTM but from the active-learning improved LSTMs. In turn, these LSTMs could again be used to create new classifiers to better select training data to be used in another round of training in a recursive manner.</p></sec>
<sec sec-type="data-availability" id="s6">
<title>Data availability statement</title>
<p>Publicly available datasets were analyzed in this study. This data can be found here: <ext-link ext-link-type="uri" xlink:href="https://dwr.state.co.us/Rest/GET/Help">https://dwr.state.co.us/Rest/GET/Help</ext-link> and details on the specific data used in this study can be found here: <ext-link ext-link-type="uri" xlink:href="https://github.com/scottmreed/Active-Learning-CNN-for-Predicting-River-Flow">https://github.com/scottmreed/Active-Learning-CNN-for-Predicting-River-Flow</ext-link>.</p></sec>
<sec sec-type="author-contributions" id="s7">
<title>Author contributions</title>
<p>SR: Conceptualization, Methodology, Software, Visualization, Writing.</p></sec>
</body>
<back>
<sec sec-type="funding-information" id="s8">
<title>Funding</title>
<p>The author(s) declare that no financial support was received for the research, authorship, and/or publication of this article.</p>
</sec>

<sec sec-type="COI-statement" id="conf1">
<title>Conflict of interest</title>
<p>The author declares that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec sec-type="disclaimer" id="s9">
<title>Publisher&#x00027;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>

<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Anguita</surname> <given-names>J. G. M.</given-names></name> <name><surname>Olariaga</surname> <given-names>O. D.</given-names></name></person-group> (<year>2023</year>). <article-title>Air cargo transport demand forecasting using ConvLSTM2D, an artificial neural network architecture approach</article-title>. <source>Case Stud. Transp. Policy</source> <volume>12</volume>, <fpage>101009</fpage>. <pub-id pub-id-type="doi">10.1016/j.cstp.2023.101009</pub-id></citation>
</ref>
<ref id="B2">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Chiacchiera</surname> <given-names>A.</given-names></name> <name><surname>Sai</surname> <given-names>F.</given-names></name> <name><surname>Salvetti</surname> <given-names>A.</given-names></name> <name><surname>Guariso</surname> <given-names>G.</given-names></name></person-group> (<year>2022</year>). <article-title>Neural Structures to Predict River Stages in Heavily Urbanized Catchments</article-title>. <source>Water</source>, 14, 2330. <pub-id pub-id-type="doi">10.3390/w14152330</pub-id></citation>
</ref>
<ref id="B3">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Di Nunno</surname> <given-names>F.</given-names></name> <name><surname>de Marinis</surname> <given-names>G.</given-names></name> <name><surname>Granata</surname> <given-names>F.</given-names></name></person-group> (<year>2023</year>). <article-title>Short-term forecasts of streamflow in the UK based on a novel hybrid artificial intelligence algorithm</article-title>. <source>Sci. Rep.</source> <volume>13</volume>, <fpage>7036</fpage>. <pub-id pub-id-type="doi">10.1038/s41598-023-34316-3</pub-id><pub-id pub-id-type="pmid">37120698</pub-id></citation></ref>
<ref id="B4">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Duan</surname> <given-names>S.</given-names></name> <name><surname>Ullrich</surname> <given-names>P.</given-names></name> <name><surname>Shu</surname> <given-names>L.</given-names></name></person-group> (<year>2020</year>). <article-title>Using convolutional neural networks for streamflow projection in California</article-title>. <source>Front. Water</source> <volume>2</volume>, <fpage>28</fpage>. <pub-id pub-id-type="doi">10.3389/frwa.2020.00028</pub-id></citation>
</ref>
<ref id="B5">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Dumont</surname> <given-names>V.</given-names></name> <name><surname>Garner</surname> <given-names>C.</given-names></name> <name><surname>Trivedi</surname> <given-names>A.</given-names></name> <name><surname>Jones</surname> <given-names>C.</given-names></name> <name><surname>Ganapati</surname> <given-names>V.</given-names></name> <name><surname>Mueller</surname> <given-names>J.</given-names></name> <etal/></person-group>. (<year>2021</year>). HYPPO: a surrogate-based multi-level parallelism tool for hyperparameter optimization. In: <italic>IEEE/ACM Workshop on Machine Learning in High Performance Computing Environments (MLHPC)</italic>, St. Louis, <volume>MO</volume>, <fpage>81</fpage>&#x02013;<lpage>93</lpage>.</citation>
</ref>
<ref id="B6">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Fang</surname> <given-names>Z.</given-names></name> <name><surname>Xie</surname> <given-names>J.</given-names></name> <name><surname>Peng</surname> <given-names>R.</given-names></name> <name><surname>Wang</surname> <given-names>S.</given-names></name></person-group> (<year>2021</year>). <article-title>Climate finance: mapping air pollution and finance market in time series</article-title>. <source>Econometrics</source> <volume>9</volume>, <fpage>43</fpage>. <pub-id pub-id-type="doi">10.3390/econometrics9040043</pub-id></citation>
</ref>
<ref id="B7">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Fu</surname> <given-names>G.</given-names></name> <name><surname>Jin</surname> <given-names>Y.</given-names></name> <name><surname>Sun</surname> <given-names>S.</given-names></name> <name><surname>Yuan</surname> <given-names>Z.</given-names></name> <name><surname>Butler</surname> <given-names>D.</given-names></name></person-group> (<year>2022</year>). <article-title>The role of deep learning in urban water management: a critical review</article-title>. <source>Water Res.</source> <volume>223</volume>, <fpage>118973</fpage>. <pub-id pub-id-type="doi">10.1016/j.watres.2022.118973</pub-id></citation>
</ref>
<ref id="B8">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Gikunda</surname> <given-names>P.</given-names></name> <name><surname>Jouandeau</surname> <given-names>N.</given-names></name></person-group> (<year>2021</year>). Homogeneous transfer active learning for time series classification. In: <italic>2021 20th IEEE International Conference on Machine Learning and Applications (ICMLA)</italic>, Pasadena, <volume>CA</volume>, <fpage>778</fpage>&#x02013;<lpage>784</lpage>.</citation>
</ref>
<ref id="B9">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Granata</surname> <given-names>F.</given-names></name> <name><surname>Di Nunno</surname> <given-names>F.</given-names></name></person-group> (<year>2023</year>). <article-title>Neuroforecasting of daily streamflows in the UK for short- and medium-term horizons: a novel insight</article-title>. <source>J. Hydrol.</source> <volume>624</volume>, <fpage>129888</fpage>. <pub-id pub-id-type="doi">10.1016/j.jhydrol.2023.129888</pub-id></citation>
</ref>
<ref id="B10">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Huang</surname> <given-names>R.</given-names></name> <name><surname>Ma</surname> <given-names>C.</given-names></name> <name><surname>Ma</surname> <given-names>J.</given-names></name> <name><surname>Huangfu</surname> <given-names>X.</given-names></name> <name><surname>He</surname> <given-names>Q.</given-names></name></person-group> (<year>2021</year>). <article-title>Machine learning in natural and engineered water systems</article-title>. <source>Water Res.</source> <volume>205</volume>, <fpage>117666</fpage>. <pub-id pub-id-type="doi">10.1016/j.watres.2021.117666</pub-id><pub-id pub-id-type="pmid">34560616</pub-id></citation></ref>
<ref id="B11">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Hyndman</surname> <given-names>R. J.</given-names></name> <name><surname>Koehler</surname> <given-names>A. B.</given-names></name></person-group> (<year>2006</year>). <article-title>Another look at measures of forecast accuracy</article-title>. <source>Int. J. Forecast.</source> <volume>22</volume>, <fpage>679</fpage>&#x02013;<lpage>688</lpage>. <pub-id pub-id-type="doi">10.1016/j.ijforecast.2006.03.001</pub-id></citation>
</ref>
<ref id="B12">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jackson</surname> <given-names>E. K.</given-names></name> <name><surname>Roberts</surname> <given-names>W.</given-names></name> <name><surname>Nelsen</surname> <given-names>B.</given-names></name> <name><surname>Williams</surname> <given-names>G. P.</given-names></name> <name><surname>Nelson</surname> <given-names>E. J.</given-names></name> <name><surname>Ames</surname> <given-names>D. P.</given-names></name></person-group> (<year>2019</year>). <article-title>Introductory overview: error metrics for hydrologic modelling A review of common practices and an open source library to facilitate use and adoption</article-title>. <source>Environ. Model. Software</source> <volume>119</volume>, <fpage>32</fpage>&#x02013;<lpage>48</lpage>. <pub-id pub-id-type="doi">10.1016/j.envsoft.2019.05.001</pub-id></citation>
</ref>
<ref id="B13">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kratzert</surname> <given-names>F.</given-names></name> <name><surname>Klotz</surname> <given-names>D.</given-names></name> <name><surname>Brenner</surname> <given-names>C.</given-names></name> <name><surname>Schulz</surname> <given-names>K.</given-names></name> <name><surname>Herrnegger</surname> <given-names>M.</given-names></name></person-group> (<year>2018</year>). <article-title>Rainfallrunoff modelling using Long Short-Term Memory (LSTM) networks</article-title>. <source>Hydrol. Earth Syst. Sci.</source> <volume>22</volume>, <fpage>6005</fpage>&#x02013;<lpage>6022</lpage>. <pub-id pub-id-type="doi">10.5194/hess-22-6005-2018</pub-id></citation>
</ref>
<ref id="B14">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Le</surname> <given-names>X. -H.</given-names></name> <name><surname>Nguyen</surname> <given-names>D. -H.</given-names></name> <name><surname>Jung</surname> <given-names>S.</given-names></name> <name><surname>Yeon</surname> <given-names>M</given-names></name> <name><surname>Lee</surname> <given-names>G.</given-names></name></person-group> (<year>2021</year>). <article-title>Comparison of deep learning techniques for river streamflow Forecasting</article-title>. <source>IEEE Access</source> <volume>9</volume>, <fpage>71805</fpage>&#x02013;<lpage>71820</lpage>. <pub-id pub-id-type="doi">10.1109/ACCESS.2021.3077703</pub-id></citation>
</ref>
<ref id="B15">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Legates</surname> <given-names>D. R.</given-names></name> <name><surname>McCabe</surname> <given-names>G. J.</given-names></name></person-group> (<year>1999</year>). <article-title>Evaluating the use of goodness-of-fit measures in hydrologic and hydroclimatic model validation</article-title>. <source>Water Res. Res.</source> <volume>35</volume>, <fpage>233</fpage>&#x02013;<lpage>241</lpage>. <pub-id pub-id-type="doi">10.1029/1998WR900018</pub-id></citation>
</ref>
<ref id="B16">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Liu</surname> <given-names>W.</given-names></name> <name><surname>Wang</surname> <given-names>Y.</given-names></name> <name><surname>Zhong</surname> <given-names>D.</given-names></name> <name><surname>Xie</surname> <given-names>S.</given-names></name> <name><surname>Xu</surname> <given-names>J.</given-names></name></person-group> (<year>2022</year>). <article-title>ConvLSTM network-based rainfall nowcasting method with combined reflectance and radar-retrieved wind field as inputs</article-title>. <source>Atmosphere</source> <volume>13</volume>, <fpage>411</fpage>. <pub-id pub-id-type="doi">10.3390/atmos13030411</pub-id></citation>
</ref>
<ref id="B17">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>MacDonnell</surname> <given-names>L.</given-names></name></person-group> (<year>2023</year>). <source>The 1922 Colorado River Compact at 100. Western Legal History. p. 33</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="https://ssrn.com/abstract=4526135">https://ssrn.com/abstract=4526135</ext-link> (accessed August 2, 2023).</citation>
</ref>
<ref id="B18">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Moishin</surname> <given-names>M.</given-names></name> <name><surname>Deo</surname> <given-names>R. C.</given-names></name> <name><surname>Prasad</surname> <given-names>R.</given-names></name> <name><surname>Raj</surname> <given-names>N.</given-names></name> <name><surname>Abdulla</surname> <given-names>S.</given-names></name></person-group> (<year>2021</year>). <article-title>Designing deep-based learning flood forecast model with ConvLSTM hybrid algorithm</article-title>. <source>IEEE</source> <volume>9</volume>, <fpage>50982</fpage>&#x02013;<lpage>50993</lpage>. <pub-id pub-id-type="doi">10.1109/ACCESS.2021.3065939</pub-id></citation>
</ref>
<ref id="B19">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Nash</surname> <given-names>J. E.</given-names></name> <name><surname>Sutcliffe</surname> <given-names>J. V.</given-names></name></person-group> (<year>1970</year>). <article-title>River flow forecasting through conceptual models part I A discussion of principles</article-title>. <source>J. Hydrol.</source> <volume>10</volume>, <fpage>282</fpage>&#x02013;<lpage>290</lpage>. <pub-id pub-id-type="doi">10.1016/0022-1694(70)90255-6</pub-id></citation>
</ref>
<ref id="B20">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Poornima</surname> <given-names>S.</given-names></name> <name><surname>Pushpalatha</surname> <given-names>M.</given-names></name></person-group> (<year>2019</year>). <article-title>Prediction of rainfall using intensified LSTM based recurrent neural network with weighted linear units</article-title>. <source>Atmosphere</source> <volume>10</volume>, <fpage>668</fpage>. <pub-id pub-id-type="doi">10.3390/atmos10110668</pub-id></citation>
</ref>
<ref id="B21">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ren</surname> <given-names>P.</given-names></name> <name><surname>Xiao</surname> <given-names>Y.</given-names></name> <name><surname>Chang</surname> <given-names>X.</given-names></name> <name><surname>Huang</surname> <given-names>P.-Y.</given-names></name> <name><surname>Li</surname> <given-names>Z.</given-names></name> <name><surname>Gupta</surname> <given-names>B. B.</given-names></name> <etal/></person-group>. (<year>2021</year>). <article-title>A survey of deep active learning</article-title>. <source>ACM Comput. Surv.</source> <volume>54</volume>, <fpage>1</fpage>&#x02013;<lpage>40</lpage>. <pub-id pub-id-type="doi">10.1145/3472291</pub-id></citation>
</ref>
<ref id="B22">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sagheer</surname> <given-names>A.</given-names></name> <name><surname>Kotb</surname> <given-names>M.</given-names></name></person-group> (<year>2019</year>). <article-title>Unsupervised pre-training of a deep LSTM-based stacked autoencoder for multivariate time series forecasting problems</article-title>. <source>Sci. Rep.</source> <volume>9</volume>, <fpage>19038</fpage>. <pub-id pub-id-type="doi">10.1038/s41598-019-55320-6</pub-id><pub-id pub-id-type="pmid">31836728</pub-id></citation></ref>
<ref id="B23">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Schultz</surname> <given-names>M. G.</given-names></name> <name><surname>Betancourt</surname> <given-names>C.</given-names></name> <name><surname>Gong</surname> <given-names>B.</given-names></name> <name><surname>Kleinert</surname> <given-names>F.</given-names></name> <name><surname>Langguth</surname> <given-names>M.</given-names></name> <name><surname>Leufen</surname> <given-names>L. H.</given-names></name> <etal/></person-group>. (<year>2021</year>). <article-title>Can deep learning beat numerical weather prediction?</article-title> <source>Philos. Trans. A Math. Phy. Eng. Sci.</source> <volume>379</volume>, <fpage>20200097</fpage>. <pub-id pub-id-type="doi">10.1098/rsta.2020.0097</pub-id><pub-id pub-id-type="pmid">33583266</pub-id></citation></ref>
<ref id="B24">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Shi</surname> <given-names>X.</given-names></name> <name><surname>Chen</surname> <given-names>Z.</given-names></name> <name><surname>Wang</surname> <given-names>H.</given-names></name> <name><surname>Yeung</surname> <given-names>D. Y.</given-names></name> <name><surname>Wong</surname> <given-names>W. K.</given-names></name> <name><surname>andWoo</surname> <given-names>W. C.</given-names></name></person-group> (<year>2015</year>). <article-title>Convolutional LSTM network: a machine learning approach for precipitation nowcasting</article-title>. <source>Adv. Neural Inform. Proc. Syst.</source> <volume>28</volume>, <fpage>802</fpage>&#x02013;<lpage>810</lpage>.</citation>
</ref>
<ref id="B25">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Shu</surname> <given-names>X.</given-names></name> <name><surname>Ding</surname> <given-names>W.</given-names></name> <name><surname>Peng</surname> <given-names>Y.</given-names></name> <name><surname>Wang</surname> <given-names>Z.</given-names></name> <name><surname>Wu</surname> <given-names>J.</given-names></name> <name><surname>Li</surname> <given-names>M.</given-names></name></person-group> (<year>2021</year>). <article-title>Monthly streamflow forecasting using convolutional neural network</article-title>. <source>Water Resour. Manage.</source> <volume>35</volume>, <fpage>5089</fpage>&#x02013;<lpage>5104</lpage> <pub-id pub-id-type="doi">10.1007/s11269-021-02961-w</pub-id></citation>
</ref>
<ref id="B26">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sit</surname> <given-names>M.</given-names></name> <name><surname>Demiray</surname> <given-names>B. Z.</given-names></name> <name><surname>Xiang</surname> <given-names>Z.</given-names></name> <name><surname>Ewing</surname> <given-names>G. J.</given-names></name> <name><surname>Sermet</surname> <given-names>Y.</given-names></name> <name><surname>Demir</surname> <given-names>I.</given-names></name></person-group> (<year>2020</year>). <article-title>A comprehensive review of deep learning applications in hydrology and water resources</article-title>. <source>Water Sci. Technol.</source> <volume>82</volume>, <fpage>2635</fpage>&#x02013;<lpage>2670</lpage>. <pub-id pub-id-type="doi">10.2166/wst.2020.369</pub-id><pub-id pub-id-type="pmid">33341760</pub-id></citation></ref>
<ref id="B27">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Tyralis</surname> <given-names>H.</given-names></name> <name><surname>Papacharalampous</surname> <given-names>G.</given-names></name> <name><surname>Langousis</surname> <given-names>A.</given-names></name></person-group> (<year>2021</year>). <article-title>Super ensemble learning for daily streamflow forecasting: large-scale demonstration and comparison with multiple machine learning algorithms</article-title>. <source>Neural Comput. Appl.</source> <volume>33</volume>, <fpage>3053</fpage>&#x02013;<lpage>3068</lpage>. <pub-id pub-id-type="doi">10.1007/s00521-020-05172-3</pub-id></citation>
</ref>
<ref id="B28">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>van der Laan</surname> <given-names>M. J.</given-names></name> <name><surname>Polley</surname> <given-names>E. C.</given-names></name> <name><surname>Hubbard</surname> <given-names>A. E.</given-names></name></person-group> (<year>2007</year>). <article-title>Super learner</article-title>. <source>Stat. Appl. Genet. Mol. Biol.</source> <volume>6</volume>, <fpage>25</fpage>. <pub-id pub-id-type="doi">10.2202/1544-6115.1309</pub-id></citation>
</ref>
<ref id="B29">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>van der Lugt</surname> <given-names>B. J.</given-names></name> <name><surname>Feelders</surname> <given-names>A. J.</given-names></name></person-group> (<year>2020</year>). <article-title>&#x0201C;Conditional forecasting of water level time series with RNNs&#x0201D;</article-title> in <source>Advanced Analytics and Learning on Temporal Data</source>, (<publisher-loc>Berlin</publisher-loc>: <publisher-name>Springer International Publishing</publisher-name>), <fpage>55</fpage>&#x02013;<lpage>71</lpage>.</citation>
</ref>
<ref id="B30">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Willmott</surname> <given-names>C. J.</given-names></name> <name><surname>Robeson</surname> <given-names>S. M.</given-names></name> <name><surname>Matsuura</surname> <given-names>K.</given-names></name></person-group> (<year>2011</year>). <article-title>A refined index of model performance</article-title>. <source>Int. J. Climatol.</source> <volume>32</volume>, <fpage>2088</fpage>&#x02013;<lpage>2094</lpage>. <pub-id pub-id-type="doi">10.1002/joc.2419</pub-id></citation>
</ref>
<ref id="B31">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Xiang</surname> <given-names>Z.</given-names></name> <name><surname>Yan</surname> <given-names>J.</given-names></name> <name><surname>Demir</surname> <given-names>I.</given-names></name></person-group> (<year>2020</year>). <article-title>A rainfall-runoff model with LSTM-based sequence-to-sequence learning</article-title>. <source>Water Res. Res.</source> <volume>56</volume>, <fpage>e2019W</fpage>R025326. <pub-id pub-id-type="doi">10.1029/2019WR025326</pub-id></citation>
</ref>
<ref id="B32">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zhao</surname> <given-names>Q.</given-names></name> <name><surname>Cai</surname> <given-names>X.</given-names></name></person-group> (<year>2020</year>). <article-title>Deriving representative reservoir operation rules using a hidden Markov-decision tree model</article-title>. <source>Adv. Water Res.</source> <volume>146</volume>, <fpage>103753</fpage>. <pub-id pub-id-type="doi">10.1016/j.advwatres.2020.103753</pub-id></citation>
</ref>
</ref-list> 
</back>
</article> 
