<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article">
 <front>
  <journal-meta>
   <journal-id journal-id-type="publisher-id">
    jcc
   </journal-id>
   <journal-title-group>
    <journal-title>
     Journal of Computer and Communications
    </journal-title>
   </journal-title-group>
   <issn pub-type="epub">
    2327-5219
   </issn>
   <issn publication-format="print">
    2327-5227
   </issn>
   <publisher>
    <publisher-name>
     Scientific Research Publishing
    </publisher-name>
   </publisher>
  </journal-meta>
  <article-meta>
   <article-id pub-id-type="doi">
    10.4236/jcc.2025.136008
   </article-id>
   <article-id pub-id-type="publisher-id">
    jcc-143484
   </article-id>
   <article-categories>
    <subj-group subj-group-type="heading">
     <subject>
      Articles
     </subject>
    </subj-group>
    <subj-group subj-group-type="Discipline-v2">
     <subject>
      Computer Science 
     </subject>
     <subject>
       Communications
     </subject>
    </subj-group>
   </article-categories>
   <title-group>
    Hybrid PINN-LSTM Model for River Temperature Prediction: A Physics-Informed Deep Learning Approach
   </title-group>
   <contrib-group>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Marcos Batista
      </surname>
      <given-names>
       Figueredo
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff1"> 
      <sup>1</sup>
     </xref>
    </contrib>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Mario de Jesus
      </surname>
      <given-names>
       Ferreira
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff1"> 
      <sup>1</sup>
     </xref>
    </contrib>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Roberto Luiz Souza
      </surname>
      <given-names>
       Monteiro
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff2"> 
      <sup>2</sup>
     </xref>
    </contrib>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Alexandre do Nascimento
      </surname>
      <given-names>
       Silva
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff3"> 
      <sup>3</sup>
     </xref>
    </contrib>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Thiago Barros
      </surname>
      <given-names>
       Murari
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff2"> 
      <sup>2</sup>
     </xref>
    </contrib>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Thaís de Souza
      </surname>
      <given-names>
       Neri
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff1"> 
      <sup>1</sup>
     </xref>
    </contrib>
   </contrib-group> 
   <aff id="aff1">
    <addr-line>
     aDepartment of Exact and Earth Sciences, Bahia State University, Alagoinhas, Brazil
    </addr-line> 
   </aff> 
   <aff id="aff2">
    <addr-line>
     aGraduate Studies Department, SENAI CIMATEC University, Salvador, Brazil
    </addr-line> 
   </aff> 
   <aff id="aff3">
    <addr-line>
     aDepartment of Engineering and Computing, State University of Santa Cruz, Ilheus, Brazil
    </addr-line> 
   </aff> 
   <pub-date pub-type="epub">
    <day>
     11
    </day> 
    <month>
     06
    </month>
    <year>
     2025
    </year>
   </pub-date> 
   <volume>
    13
   </volume> 
   <issue>
    06
   </issue>
   <fpage>
    115
   </fpage>
   <lpage>
    134
   </lpage>
   <history>
    <date date-type="received">
     <day>
      4,
     </day>
     <month>
      April
     </month>
     <year>
      2025
     </year>
    </date>
    <date date-type="published">
     <day>
      21,
     </day>
     <month>
      April
     </month>
     <year>
      2025
     </year> 
    </date> 
    <date date-type="accepted">
     <day>
      21,
     </day>
     <month>
      June
     </month>
     <year>
      2025
     </year> 
    </date>
   </history>
   <permissions>
    <copyright-statement>
     © Copyright 2014 by authors and Scientific Research Publishing Inc. 
    </copyright-statement>
    <copyright-year>
     2014
    </copyright-year>
    <license>
     <license-p>
      This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/
     </license-p>
    </license>
   </permissions>
   <abstract>
    This study proposes a hybrid modeling approach that integrates a Physics Informed Neural Network (PINN) and a long short-term memory (LSTM) network to predict river water temperature in a defined section of the Catu River. The PINN is formulated on the basis of the advection-dispersion-reaction equation to incorporate physical constraints into the learning process, while the LSTM captures temporal patterns from meteorological inputs. The model was trained using normalized historical data and evaluated with standard quantitative metrics and visual comparisons. To examine the influence of each input feature, sensitivity and ablation analyses were performed. The results indicate that the model accurately learns the relevant dependencies, with humidity and dew point exerting the greatest influence on the predictions. In contrast, precipitation showed negligible impact on model performance, aligning with the low and seasonally concentrated rainfall of the region. These results suggest that the model captures both the temporal and physical patterns associated with the thermal dynamics of the river. The hybrid model reproduced observed seasonal variations and extreme temperature peaks with consistency, demonstrating predictive robustness under variable environmental conditions. The combination of data-driven learning and physically constrained modeling offers a viable solution for temperature forecasting in river systems, particularly in regions with limited observational data.
   </abstract>
   <kwd-group> 
    <kwd>
     PINN
    </kwd> 
    <kwd>
      LSTM
    </kwd> 
    <kwd>
      Catu River
    </kwd> 
    <kwd>
      Neural Network
    </kwd> 
    <kwd>
      Information Systems
    </kwd>
   </kwd-group>
  </article-meta>
 </front>
 <body>
  <sec id="s1">
   <title>1. Introduction</title>
   <p>The temperature of the water is a key factor in the dynamics of aquatic ecosystems, directly influencing the physical, chemical, and biological processes of rivers <xref ref-type="bibr" rid="scirp.143484-1">
     [1]
    </xref>-<xref ref-type="bibr" rid="scirp.143484-4">
     [4]
    </xref>. This variable affects gas solubility, dissolved oxygen availability, metabolism of aquatic organisms, and even the evaporation rate of the water surface <xref ref-type="bibr" rid="scirp.143484-5">
     [5]
    </xref>-<xref ref-type="bibr" rid="scirp.143484-7">
     [7]
    </xref>. Changes in water temperature can alter the composition of aquatic communities, modify biogeochemical cycles, and impact food chains, making its analysis essential for the conservation and sustainable management of water resources <xref ref-type="bibr" rid="scirp.143484-8">
     [8]
    </xref> <xref ref-type="bibr" rid="scirp.143484-9">
     [9]
    </xref>. Furthermore, water temperature plays a crucial role in the thermal regime of rivers, reflecting climatic variations and environmental changes caused by anthropogenic activities, such as dam construction and rapid urbanization <xref ref-type="bibr" rid="scirp.143484-10">
     [10]
    </xref>. In this context, continuous and accurate monitoring of water temperature not only provides relevant data for environmental quality assessment <xref ref-type="bibr" rid="scirp.143484-11">
     [11]
    </xref>, but also supports the development of efficient strategies for managing water bodies in the face of increasing human impact and global climate change.</p>
   <p>Given the complexity of the interactions that determine river thermal variations, mathematical modeling emerges as an essential tool to predict future scenarios and gain a deeper understanding of the factors that regulate water temperature. Computational models allow the simulation of different environmental conditions by incorporating variables such as air temperature, solar radiation, thermal pollution, and river flow <xref ref-type="bibr" rid="scirp.143484-12">
     [12]
    </xref> <xref ref-type="bibr" rid="scirp.143484-13">
     [13]
    </xref>. In recent years, artificial intelligence and neural network-based approaches have demonstrated great potential in capturing nonlinear patterns in these dynamic systems, allowing more robust predictions that adapt to various hydroclimatic conditions <xref ref-type="bibr" rid="scirp.143484-14">
     [14]
    </xref> <xref ref-type="bibr" rid="scirp.143484-15">
     [15]
    </xref>. The integration of physics-informed models, such as Physics-Informed Neural Networks (PINNs) <xref ref-type="bibr" rid="scirp.143484-16">
     [16]
    </xref>-<xref ref-type="bibr" rid="scirp.143484-18">
     [18]
    </xref>, combined with recurrent neural networks such as Long-Short-Term Memory (LSTM) <xref ref-type="bibr" rid="scirp.143484-19">
     [19]
    </xref>-<xref ref-type="bibr" rid="scirp.143484-22">
     [22]
    </xref>, presents a promising approach for forecasting water temperature. This method takes advantage of physical principles and deep learning to improve prediction accuracy, providing more precise information on the thermal response of rivers to environmental changes <xref ref-type="bibr" rid="scirp.143484-23">
     [23]
    </xref>.</p>
   <p>Several methodologies have been explored to improve river water temperature forecasting, taking advantage of well-established theories and modern computational approaches <xref ref-type="bibr" rid="scirp.143484-24">
     [24]
    </xref>-<xref ref-type="bibr" rid="scirp.143484-26">
     [26]
    </xref>. Although physics-based models provide a structured framework for representing thermal dynamics, they often require extensive parameterization and struggle with data limitations in complex environments. In contrast, statistical and machine learning models have gained prominence for their ability to extract patterns from observational data, enabling efficient and adaptable predictions under diverse hydroclimatic conditions <xref ref-type="bibr" rid="scirp.143484-27">
     [27]
    </xref> <xref ref-type="bibr" rid="scirp.143484-28">
     [28]
    </xref>.</p>
   <p>Despite these advances, there are challenges to accurately model temperature variations in regions with intricate environmental dynamics, such as urban areas with heterogeneous land cover and localized heat fluxes. Many empirical models, though effective within known data distributions, lack robustness when extrapolating to new conditions <xref ref-type="bibr" rid="scirp.143484-29">
     [29]
    </xref> <xref ref-type="bibr" rid="scirp.143484-30">
     [30]
    </xref>. Furthermore, reliance on purely data-driven approaches can obscure the underlying physical mechanisms that govern river temperature fluctuations <xref ref-type="bibr" rid="scirp.143484-31">
     [31]
    </xref> <xref ref-type="bibr" rid="scirp.143484-32">
     [32]
    </xref>. Addressing these gaps requires an integrative strategy that balances data-driven insights with physically consistent representations, ensuring both predictive reliability and interpretability in dynamic aquatic systems.</p>
   <p>The Catu River region has a tropical climate, with average annual temperatures ranging between 24˚C and 26˚C. During summer, maximum temperatures can reach 33˚C, while in winter, minimum temperatures rarely drop below 18˚C <xref ref-type="bibr" rid="scirp.143484-33">
     [33]
    </xref>. This seasonal variation significantly influences the thermal balance of the river, leading to changes that occur both on a local scale and in response to global climatic trends. In addition to directly affecting aquatic ecosystems, these thermal fluctuations highlight the need for continuous and precise monitoring, which is essential for sustainable management of the watershed and conservation of water resources.</p>
   <p>In this study, we propose a hybrid approach that integrates Physics-Informed Neural Networks (PINNs) and Long-Short-Term Memory (LSTM) to predict the temperature of the Catu River in a specific section. This approach is justified by the necessity of incorporating physical knowledge directly into the LSTM model, which alone does not explicitly recognize the hydrological and climatic variability of the region.</p>
   <p>Based on the governing differential equations, we developed a new model (PINN-LSTM) with limited computational complexity, comparable to that of statistical models. The final structure combines an Advection-Diffusion-Reaction Equation dependent on variables such as precipitation, air temperature, humidity, evaporation, and wind speed with the LSTM’s capability to learn temporal patterns from historical river temperature data. This combination allows the model to learn the river’s thermal evolution while incorporating both underlying physical principles and patterns extracted from observed data.</p>
   <p>Thus, the PINN-LSTM can be seen as a hybrid tool that preserves physical foundations while leveraging machine learning to enhance predictive capacity. However, our study focuses exclusively on this section of the river, without considering external influences such as tributaries, due to the unavailability of comprehensive data on these variables.</p>
   <p>Additionally, the network was trained and validated to identify temporal patterns in river temperature variations, analyzing the delays between precipitation events and thermal changes over time. This enables a detailed evaluation of the Catu Rive’s thermal behavior, accounting for both seasonal impacts and extreme hydrological events.</p>
   <p>This publication presents an investigation into a model, input data, and training characteristics for the daily prediction of water temperature in a section of the Catu River. It consists of the application of two types of machine learning models to input datasets.</p>
   <p>The main contributions of this work can be described as follows: 1) the development of a hybrid approach integrating Physics-Informed Neural Networks (PINNs) and Long-Short-Term Memory (LSTM) to improve temperature prediction by combining physical knowledge with deep learning techniques; 2) the incorporation of an advection-diffusion-reaction equation that accounts for the influence of precipitation, air temperature, humidity, evaporation, and wind speed, allowing for a physically consistent representation of river thermal dynamics; 3) the evaluation of the model’s performance with a limited dataset, analyzing its robustness in handling noise and its capacity to capture nonlinearities present in the data; 4) an investigation of the role of seasonal variations and extreme meteorological events in river temperature fluctuations, assessing the predictive capability of the PINN-LSTM framework under different hydroclimatic conditions; and 5) a demonstration that traditional machine learning models struggle when applied to large environmental datasets, reinforcing the need for hybrid approaches that integrate physical constraints to enhance prediction reliability.</p>
  </sec><sec id="s2">
   <title>2. Method</title>
   <sec id="s2_1">
    <title>2.1. Study Area and Data</title>
    <p>In this study, we analyzed a 1 km stretch of the Catu River, located in a watershed covering 208.5 km<sup>2</sup> and encompassing the municipalities of Alagoinhas, Catu, and Pojuca (<xref ref-type="fig" rid="fig1">
      Figure 1
     </xref>). Measurements were conducted between the coordinates 12˚10'05.1"S, 38˚24'23.8"W and 12˚11'04.6"S, 38˚24'11.9"W, with altitudes ranging from 40 to 255 meters. The average slope of the basin is 30%.</p>
    <fig id="fig1" position="float">
     <label>Figure 1</label>
     <caption>
      <title>Figure 1. Catu River section.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1733147-rId16.jpeg?20250624022712" />
    </fig>
   </sec>
   <sec id="s2_2">
    <title>2.2. Dataset</title>
    <p>Meteorological data were obtained from the National Institute of Meteorology (INMET), using measurements from the station located in Alagoinhas, BA, with latitude −12˚14'86" and longitude −38˚50'57". The station is situated at an altitude of 47.56 meters and provides records from January 1, 2009, to January 1, 2017, with a sampling resolution of 10 minutes.</p>
    <p>The meteorological variables included in the study are air temperature (Air Temp), Wind Speed, relative humidity (Humidity), evaporation and precipitation. <xref ref-type="table" rid="table1">
      Table 1
     </xref> summarizes the training data used for predictive model calibration.</p>
    <table-wrap id="table1">
     <label>
      <xref ref-type="table" rid="table1">
       Table 1
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.143484-"></xref>Table 1. Summary of meteorological data used in the study.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="16.66%"><p style="text-align:center">Year</p></td> 
       <td class="custom-bottom-td acenter" width="16.67%"><p style="text-align:center">Air Temp</p></td> 
       <td class="custom-bottom-td acenter" width="16.67%"><p style="text-align:center">Wind Speed</p></td> 
       <td class="custom-bottom-td acenter" width="16.66%"><p style="text-align:center">Humidity</p></td> 
       <td class="custom-bottom-td acenter" width="16.67%"><p style="text-align:center">Evaporation</p></td> 
       <td class="custom-bottom-td acenter" width="16.67%"><p style="text-align:center">Precipitation</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="16.66%"><p style="text-align:center">2009</p></td> 
       <td class="custom-top-td acenter" width="16.67%"><p style="text-align:center">31.05</p></td> 
       <td class="custom-top-td acenter" width="16.67%"><p style="text-align:center">2.10</p></td> 
       <td class="custom-top-td acenter" width="16.66%"><p style="text-align:center">77.25</p></td> 
       <td class="custom-top-td acenter" width="16.67%"><p style="text-align:center">3.80</p></td> 
       <td class="custom-top-td acenter" width="16.67%"><p style="text-align:center">2.66</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="16.66%"><p style="text-align:center">2010</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">30.52</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">2.18</p></td> 
       <td class="acenter" width="16.66%"><p style="text-align:center">77.05</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">3.39</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">3.33</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="16.66%"><p style="text-align:center">2011</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">29.85</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">2.16</p></td> 
       <td class="acenter" width="16.66%"><p style="text-align:center">74.92</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">3.32</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">3.26</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="16.66%"><p style="text-align:center">2012</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">30.54</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">2.17</p></td> 
       <td class="acenter" width="16.66%"><p style="text-align:center">74.32</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">4.48</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">1.82</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="16.66%"><p style="text-align:center">2013</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">30.56</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">2.20</p></td> 
       <td class="acenter" width="16.66%"><p style="text-align:center">77.38</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">3.84</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">3.06</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="16.66%"><p style="text-align:center">2014</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">29.98</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">2.04</p></td> 
       <td class="acenter" width="16.66%"><p style="text-align:center">77.74</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">3.65</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">2.74</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="16.66%"><p style="text-align:center">2015</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">31.08</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">1.28</p></td> 
       <td class="acenter" width="16.66%"><p style="text-align:center">73.76</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">4.15</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">2.82</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="16.66%"><p style="text-align:center">2016</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">31.27</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">2.03</p></td> 
       <td class="acenter" width="16.66%"><p style="text-align:center">75.85</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">6.31</p></td> 
       <td class="acenter" width="16.67%"><p style="text-align:center">2.32</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>To validate the model, a temperature measurement campaign of the Catu River was conducted between January and December 2023. Data were collected using DS18B20 sensors coupled to an Arduino microcontroller, positioned 5 cm from the water surface. Measurements followed the same sampling frequency as that adopted by the National Institute of Meteorology (INMET, Brazil), ensuring compatibility with the available meteorological data.</p>
    <p>The collected data were compared with the predictions generated by the trained PINN-LSTM networks, allowing for an assessment of the model’s accuracy in the real context of the watershed. The data used and historical records are available at <xref ref-type="bibr" rid="scirp.143484-https://www.kaggle.com/datasets/corcova/caturiverbahia/data">
      https://www.kaggle.com/datasets/corcova/caturiverbahia/data
     </xref>.</p>
    <p>Although this study focuses on the middle section of the Catu River and uses data limited to the period 2016-2017, this choice was made based on the availability and reliability of observed river temperature records. Future work will expand the dataset to include other stretches and longer time series to improve model generalization.</p>
   </sec>
   <sec id="s2_3">
    <title>2.3. Model Framework</title>
    <p>As shown in <xref ref-type="fig" rid="fig2">
      Figure 2
     </xref>, the PINN-LSTM forecasting model follows a structured pipeline:</p>
    <fig id="fig2" position="float">
     <label>Figure 2</label>
     <caption>
      <title>Figure 2. Steps for building the PINN-LSTM predicting model.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1733147-rId18.jpeg?20250624022714" />
    </fig>
    <p>First, meteorological and hydrological data, including air temperature, wind speed, humidity, evaporation, and precipitation, are preprocessed for consistency, normalization, and handling missing values.</p>
    <p>Next, the Physics-Informed Neural Network (PINN) is trained to learn the governing thermal dynamics of the river, providing physically consistent estimates 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          y 
        </mi> 
        <mrow> 
         <mtext>
           pinn 
         </mtext> 
         <mo>
           _ 
         </mo> 
         <mtext>
           pred 
         </mtext> 
        </mrow> 
       </msub> 
      </mrow> 
     </math>. This output is incorporated into the final hybrid model training.</p>
    <p>The Long-Short-Term Memory (LSTM) network captures temporal dependencies and nonlinear patterns, integrating both observational data and PINN constraints. The final model is evaluated using RMSE, NSE, and R<sup>2</sup>, ensuring accuracy across different climatic and hydrological conditions.</p>
    <p>Once validated, the model is deployed for inference, enabling real-time river temperature predictions. <xref ref-type="fig" rid="fig2">
      Figure 2
     </xref> summarizes the complete PINN-LSTM model pipeline.</p>
   </sec>
   <sec id="s2_4">
    <title>2.4. Governing Equation and PINN Formulation</title>
    <p>The Physics-Informed Neural Network (PINN) used in this study is built upon the governing advection-dispersion-reaction equation that models river water temperature dynamics. The equation integrates advective heat transport, longitudinal thermal dispersion, and source/sink terms representing atmospheric and hydrological exchanges:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mfrac> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <msub> 
          <mi>
            T 
          </mi> 
          <mi>
            w 
          </mi> 
         </msub> 
        </mrow> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <mi>
           t 
         </mi> 
        </mrow> 
       </mfrac> 
       <mo>
         = 
       </mo> 
       <mo>
         − 
       </mo> 
       <mi>
         U 
       </mi> 
       <mfrac> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <msub> 
          <mi>
            T 
          </mi> 
          <mi>
            w 
          </mi> 
         </msub> 
        </mrow> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <mi>
           x 
         </mi> 
        </mrow> 
       </mfrac> 
       <mo>
         + 
       </mo> 
       <msub> 
        <mi>
          D 
        </mi> 
        <mi>
          L 
        </mi> 
       </msub> 
       <mfrac> 
        <mrow> 
         <msup> 
          <mo>
            ∂ 
          </mo> 
          <mn>
            2 
          </mn> 
         </msup> 
         <msub> 
          <mi>
            T 
          </mi> 
          <mi>
            w 
          </mi> 
         </msub> 
        </mrow> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <msup> 
          <mi>
            x 
          </mi> 
          <mn>
            2 
          </mn> 
         </msup> 
        </mrow> 
       </mfrac> 
       <mo>
         + 
       </mo> 
       <msub> 
        <mi>
          R 
        </mi> 
        <mi>
          h 
        </mi> 
       </msub> 
       <mo>
         + 
       </mo> 
       <msub> 
        <mi>
          R 
        </mi> 
        <mi>
          i 
        </mi> 
       </msub> 
       <mo>
         , 
       </mo> 
      </mrow> 
     </math> (1)</p>
    <p>where:</p>
    <p>The PINN architecture approximates the solution 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          T 
        </mi> 
        <mi>
          w 
        </mi> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mi>
           x 
         </mi> 
         <mo>
           , 
         </mo> 
         <mi>
           t 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> and minimizes the residual of the governing PDE, which is defined as:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          ℛ 
        </mi> 
        <mrow> 
         <mtext>
           PDE 
         </mtext> 
        </mrow> 
       </msub> 
       <mo>
         = 
       </mo> 
       <mfrac> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <msub> 
          <mi>
            T 
          </mi> 
          <mi>
            w 
          </mi> 
         </msub> 
        </mrow> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <mi>
           t 
         </mi> 
        </mrow> 
       </mfrac> 
       <mo>
         + 
       </mo> 
       <mi>
         U 
       </mi> 
       <mfrac> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <msub> 
          <mi>
            T 
          </mi> 
          <mi>
            w 
          </mi> 
         </msub> 
        </mrow> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <mi>
           x 
         </mi> 
        </mrow> 
       </mfrac> 
       <mo>
         − 
       </mo> 
       <msub> 
        <mi>
          D 
        </mi> 
        <mi>
          L 
        </mi> 
       </msub> 
       <mfrac> 
        <mrow> 
         <msup> 
          <mo>
            ∂ 
          </mo> 
          <mn>
            2 
          </mn> 
         </msup> 
         <msub> 
          <mi>
            T 
          </mi> 
          <mi>
            w 
          </mi> 
         </msub> 
        </mrow> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <msup> 
          <mi>
            x 
          </mi> 
          <mn>
            2 
          </mn> 
         </msup> 
        </mrow> 
       </mfrac> 
       <mo>
         − 
       </mo> 
       <msub> 
        <mi>
          R 
        </mi> 
        <mi>
          h 
        </mi> 
       </msub> 
       <mo>
         − 
       </mo> 
       <msub> 
        <mi>
          R 
        </mi> 
        <mi>
          i 
        </mi> 
       </msub> 
       <mo>
         . 
       </mo> 
      </mrow> 
     </math> (2)</p>
    <p>This residual is evaluated at a set of collocation points using automatic differentiation. The neural network is trained to minimize this residual along with prediction errors based on available data.</p>
    <p>Boundary and Initial Conditions:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mrow> 
         <mrow> 
          <mrow> 
           <mfrac> 
            <mrow> 
             <mo>
               ∂ 
             </mo> 
             <msub> 
              <mi>
                T 
              </mi> 
              <mi>
                w 
              </mi> 
             </msub> 
            </mrow> 
            <mrow> 
             <mo>
               ∂ 
             </mo> 
             <mi>
               n 
             </mi> 
            </mrow> 
           </mfrac> 
          </mrow> 
          <mo>
            | 
          </mo> 
         </mrow> 
        </mrow> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <mi>
           Ω 
         </mi> 
        </mrow> 
       </msub> 
       <mo>
         = 
       </mo> 
       <msub> 
        <mi>
          q 
        </mi> 
        <mn>
          0 
        </mn> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mi>
           x 
         </mi> 
         <mo>
           , 
         </mo> 
         <mi>
           t 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         , 
       </mo> 
      </mrow> 
     </math> (3)</p>
    <p>where 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mo>
         ∂ 
       </mo> 
       <mi>
         Ω 
       </mi> 
      </mrow> 
     </math> is the boundary domain and 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          q 
        </mi> 
        <mn>
          0 
        </mn> 
       </msub> 
      </mrow> 
     </math> the known flux.</p>
    <p>Loss Function:</p>
    <p>The complete loss function for the hybrid PINN-LSTM model combines the physical constraint, prediction accuracy, and LSTM forecast loss:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          ℒ 
        </mi> 
        <mrow> 
         <mtext>
           total 
         </mtext> 
        </mrow> 
       </msub> 
       <mo>
         = 
       </mo> 
       <msub> 
        <mi>
          λ 
        </mi> 
        <mn>
          1 
        </mn> 
       </msub> 
       <msub> 
        <mi>
          ℒ 
        </mi> 
        <mrow> 
         <mtext>
           PDE 
         </mtext> 
        </mrow> 
       </msub> 
       <mo>
         + 
       </mo> 
       <msub> 
        <mi>
          λ 
        </mi> 
        <mn>
          2 
        </mn> 
       </msub> 
       <msub> 
        <mi>
          ℒ 
        </mi> 
        <mrow> 
         <mtext>
           LSTM 
         </mtext> 
        </mrow> 
       </msub> 
       <mo>
         + 
       </mo> 
       <msub> 
        <mi>
          λ 
        </mi> 
        <mn>
          3 
        </mn> 
       </msub> 
       <msub> 
        <mi>
          ℒ 
        </mi> 
        <mrow> 
         <mtext>
           data 
         </mtext> 
        </mrow> 
       </msub> 
       <mo>
         , 
       </mo> 
      </mrow> 
     </math> (4)</p>
    <p>where 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          λ 
        </mi> 
        <mi>
          i 
        </mi> 
       </msub> 
      </mrow> 
     </math> are weighting coefficients, 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          ℒ 
        </mi> 
        <mrow> 
         <mtext>
           PDE 
         </mtext> 
        </mrow> 
       </msub> 
      </mrow> 
     </math> corresponds to the residual of the PDE, 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          ℒ 
        </mi> 
        <mrow> 
         <mtext>
           LSTM 
         </mtext> 
        </mrow> 
       </msub> 
      </mrow> 
     </math> represents the sequential prediction error from the LSTM, and 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          ℒ 
        </mi> 
        <mrow> 
         <mtext>
           data 
         </mtext> 
        </mrow> 
       </msub> 
      </mrow> 
     </math> is the supervised loss from observed data. This formulation ensures that the predictions are consistent with both the observed data and the physical dynamics of the river system.</p>
   </sec>
   <sec id="s2_5">
    <title>2.5. PINN Architecture and Training Process</title>
    <p>The Physics-Informed Neural Network (PINN) employed in this study was designed to estimate the thermal dynamics of the Catu River by embedding the underlying advection-dispersion-reaction equation into its architecture. The network consists of:</p>
    <p>
     <xref ref-type="fig" rid="fig3">
      Figure 3
     </xref> shows the architecture of the network, including a symbolic representation of the differential constraints.</p>
    <p>The training process uses automatic differentiation to compute the residuals of the governing PDE:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          ℛ 
        </mi> 
        <mrow> 
         <mtext>
           PDE 
         </mtext> 
        </mrow> 
       </msub> 
       <mo>
         = 
       </mo> 
       <mfrac> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <msub> 
          <mi>
            T 
          </mi> 
          <mi>
            w 
          </mi> 
         </msub> 
        </mrow> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <mi>
           t 
         </mi> 
        </mrow> 
       </mfrac> 
       <mo>
         + 
       </mo> 
       <mi>
         U 
       </mi> 
       <mfrac> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <msub> 
          <mi>
            T 
          </mi> 
          <mi>
            w 
          </mi> 
         </msub> 
        </mrow> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <mi>
           x 
         </mi> 
        </mrow> 
       </mfrac> 
       <mo>
         − 
       </mo> 
       <msub> 
        <mi>
          D 
        </mi> 
        <mi>
          L 
        </mi> 
       </msub> 
       <mfrac> 
        <mrow> 
         <msup> 
          <mo>
            ∂ 
          </mo> 
          <mn>
            2 
          </mn> 
         </msup> 
         <msub> 
          <mi>
            T 
          </mi> 
          <mi>
            w 
          </mi> 
         </msub> 
        </mrow> 
        <mrow> 
         <mo>
           ∂ 
         </mo> 
         <msup> 
          <mi>
            x 
          </mi> 
          <mn>
            2 
          </mn> 
         </msup> 
        </mrow> 
       </mfrac> 
       <mo>
         − 
       </mo> 
       <msub> 
        <mi>
          R 
        </mi> 
        <mi>
          h 
        </mi> 
       </msub> 
       <mo>
         − 
       </mo> 
       <msub> 
        <mi>
          R 
        </mi> 
        <mi>
          i 
        </mi> 
       </msub> 
       <mo>
         , 
       </mo> 
      </mrow> 
     </math></p>
    <p>which are incorporated into the loss function. The model is optimized via stochastic gradient descent (AdamW), minimizing a composite loss consisting of the PDE residual, temporal prediction error from the LSTM, and observational data mismatch. This architecture ensures both physical consistency and high predictive capability.</p>
    <fig id="fig3" position="float">
     <label>Figure 3</label>
     <caption>
      <title>Figure 3. Architecture of the Physics-Informed Neural Network (PINN) used for estimating river water temperature.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1733147-rId79.jpeg?20250624022716" />
    </fig>
   </sec>
   <sec id="s2_6">
    <title>2.6. LSTM Architecture</title>
    <p>The proposed hybrid model integrates a Physics-Informed Neural Network (PINN) with a Long-Short-Term Memory (LSTM) network. The physically-informed prediction 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          y 
        </mi> 
        <mrow> 
         <mtext>
           pinn_pred 
         </mtext> 
        </mrow> 
       </msub> 
      </mrow> 
     </math>, generated by the PINN module, is used as input to the LSTM. This integration allows the model to extract temporal features and nonlinear dependencies from time-series data that already respect physical constraints.</p>
    <p>The LSTM architecture consists of three bidirectional layers-two with 64 neurons and one with 32 neurons-followed by a dense output module with layers of 64, 32, and 1 neuron, respectively. A temporal window of seven days was adopted (time_steps = 7), enabling weekly pattern analysis and sensitivity to abrupt thermal variations. Several topologies and hyperparameters were evaluated, and only the best configuration is presented in this work.</p>
    <p>The internal structure of the LSTM cell is defined by the following set of equations:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mtable columnalign="left"> 
       <mtr> 
        <mtd> 
         <msub> 
          <mi>
            i 
          </mi> 
          <mi>
            t 
          </mi> 
         </msub> 
         <mo>
           = 
         </mo> 
         <mi>
           σ 
         </mi> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <msub> 
            <mi>
              U 
            </mi> 
            <mi>
              i 
            </mi> 
           </msub> 
           <msub> 
            <mi>
              h 
            </mi> 
            <mrow> 
             <mi>
               t 
             </mi> 
             <mo>
               − 
             </mo> 
             <mn>
               1 
             </mn> 
            </mrow> 
           </msub> 
           <mo>
             + 
           </mo> 
           <msub> 
            <mi>
              W 
            </mi> 
            <mi>
              i 
            </mi> 
           </msub> 
           <msub> 
            <mi>
              x 
            </mi> 
            <mi>
              t 
            </mi> 
           </msub> 
           <mo>
             + 
           </mo> 
           <msub> 
            <mi>
              b 
            </mi> 
            <mi>
              i 
            </mi> 
           </msub> 
          </mrow> 
          <mo>
            ) 
          </mo> 
         </mrow> 
        </mtd> 
       </mtr> 
       <mtr> 
        <mtd> 
         <msub> 
          <mi>
            f 
          </mi> 
          <mi>
            t 
          </mi> 
         </msub> 
         <mo>
           = 
         </mo> 
         <mi>
           σ 
         </mi> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <msub> 
            <mi>
              U 
            </mi> 
            <mi>
              f 
            </mi> 
           </msub> 
           <msub> 
            <mi>
              h 
            </mi> 
            <mrow> 
             <mi>
               t 
             </mi> 
             <mo>
               − 
             </mo> 
             <mn>
               1 
             </mn> 
            </mrow> 
           </msub> 
           <mo>
             + 
           </mo> 
           <msub> 
            <mi>
              W 
            </mi> 
            <mi>
              f 
            </mi> 
           </msub> 
           <msub> 
            <mi>
              x 
            </mi> 
            <mi>
              t 
            </mi> 
           </msub> 
           <mo>
             + 
           </mo> 
           <msub> 
            <mi>
              b 
            </mi> 
            <mi>
              f 
            </mi> 
           </msub> 
          </mrow> 
          <mo>
            ) 
          </mo> 
         </mrow> 
        </mtd> 
       </mtr> 
       <mtr> 
        <mtd> 
         <msub> 
          <mover accent="true"> 
           <mi>
             c 
           </mi> 
           <mo>
             ˜ 
           </mo> 
          </mover> 
          <mi>
            t 
          </mi> 
         </msub> 
         <mo>
           = 
         </mo> 
         <mtext>
           tanh 
         </mtext> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <msub> 
            <mi>
              U 
            </mi> 
            <mi>
              c 
            </mi> 
           </msub> 
           <msub> 
            <mi>
              h 
            </mi> 
            <mrow> 
             <mi>
               t 
             </mi> 
             <mo>
               − 
             </mo> 
             <mn>
               1 
             </mn> 
            </mrow> 
           </msub> 
           <mo>
             + 
           </mo> 
           <msub> 
            <mi>
              W 
            </mi> 
            <mi>
              c 
            </mi> 
           </msub> 
           <msub> 
            <mi>
              x 
            </mi> 
            <mi>
              t 
            </mi> 
           </msub> 
           <mo>
             + 
           </mo> 
           <msub> 
            <mi>
              b 
            </mi> 
            <mi>
              c 
            </mi> 
           </msub> 
          </mrow> 
          <mo>
            ) 
          </mo> 
         </mrow> 
        </mtd> 
       </mtr> 
       <mtr> 
        <mtd> 
         <msub> 
          <mi>
            c 
          </mi> 
          <mi>
            t 
          </mi> 
         </msub> 
         <mo>
           = 
         </mo> 
         <msub> 
          <mi>
            f 
          </mi> 
          <mi>
            t 
          </mi> 
         </msub> 
         <mo>
           ⊙ 
         </mo> 
         <msub> 
          <mi>
            c 
          </mi> 
          <mrow> 
           <mi>
             t 
           </mi> 
           <mo>
             − 
           </mo> 
           <mn>
             1 
           </mn> 
          </mrow> 
         </msub> 
         <mo>
           + 
         </mo> 
         <msub> 
          <mi>
            i 
          </mi> 
          <mi>
            t 
          </mi> 
         </msub> 
         <mo>
           ⊙ 
         </mo> 
         <msub> 
          <mover accent="true"> 
           <mi>
             c 
           </mi> 
           <mo>
             ˜ 
           </mo> 
          </mover> 
          <mi>
            t 
          </mi> 
         </msub> 
        </mtd> 
       </mtr> 
       <mtr> 
        <mtd> 
         <msub> 
          <mi>
            o 
          </mi> 
          <mi>
            t 
          </mi> 
         </msub> 
         <mo>
           = 
         </mo> 
         <mi>
           σ 
         </mi> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <msub> 
            <mi>
              U 
            </mi> 
            <mi>
              o 
            </mi> 
           </msub> 
           <msub> 
            <mi>
              h 
            </mi> 
            <mrow> 
             <mi>
               t 
             </mi> 
             <mo>
               − 
             </mo> 
             <mn>
               1 
             </mn> 
            </mrow> 
           </msub> 
           <mo>
             + 
           </mo> 
           <msub> 
            <mi>
              W 
            </mi> 
            <mi>
              o 
            </mi> 
           </msub> 
           <msub> 
            <mi>
              x 
            </mi> 
            <mi>
              t 
            </mi> 
           </msub> 
           <mo>
             + 
           </mo> 
           <msub> 
            <mi>
              b 
            </mi> 
            <mi>
              o 
            </mi> 
           </msub> 
          </mrow> 
          <mo>
            ) 
          </mo> 
         </mrow> 
        </mtd> 
       </mtr> 
       <mtr> 
        <mtd> 
         <msub> 
          <mi>
            h 
          </mi> 
          <mi>
            t 
          </mi> 
         </msub> 
         <mo>
           = 
         </mo> 
         <msub> 
          <mi>
            o 
          </mi> 
          <mi>
            t 
          </mi> 
         </msub> 
         <mo>
           ⊙ 
         </mo> 
         <mtext>
           tanh 
         </mtext> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <msub> 
            <mi>
              c 
            </mi> 
            <mi>
              t 
            </mi> 
           </msub> 
          </mrow> 
          <mo>
            ) 
          </mo> 
         </mrow> 
        </mtd> 
       </mtr> 
      </mtable> 
     </math> (5)</p>
    <p>where:</p>
    <p>
     <xref ref-type="fig" rid="fig4">
      Figure 4
     </xref> illustrates the overall LSTM pipeline, showing the PINN prediction being processed through sequential LSTM and dense layers. The internal cell computation matches the mathematical formulation above.</p>
    <fig id="fig4" position="float">
     <label>Figure 4</label>
     <caption>
      <title>Figure 4. LSTM architecture used in the model. The output of the PINN (

       <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
  
         <msub> 
   
          <mi>
           
    y
   
          </mi> 
   
          <mrow> 
    
           <mtext>
            
     pinn_pred
    
           </mtext>
   
          </mrow> 
  
         </msub> 
 
        </mrow>

       </math>) is used as input to the LSTM.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1733147-rId104.jpeg?20250624022717" />
    </fig>
   </sec>
   <sec id="s2_7">
    <title>2.7. Integration of PINN and LSTM for Temperature Prediction</title>
    <p>The Physics-Informed Neural Network (PINN) employed in this study approximates the solution to the Advection-Dispersion-Reaction Equation (1):</p>
    <p>During training, the PINN learns a continuous temperature function 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mover accent="true"> 
         <mi>
           T 
         </mi> 
         <mo>
           ^ 
         </mo> 
        </mover> 
        <mi>
          w 
        </mi> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mi>
           x 
         </mi> 
         <mo>
           , 
         </mo> 
         <mi>
           t 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> satisfying:</p>
    <p>The trained PINN generates a continuous function:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mover accent="true"> 
         <mi>
           T 
         </mi> 
         <mo>
           ^ 
         </mo> 
        </mover> 
        <mi>
          w 
        </mi> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mi>
           x 
         </mi> 
         <mo>
           , 
         </mo> 
         <mi>
           t 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         = 
       </mo> 
       <msub> 
        <mrow> 
         <mtext>
           NeuralNetwork 
         </mtext> 
        </mrow> 
        <mi>
          θ 
        </mi> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mi>
           x 
         </mi> 
         <mo>
           , 
         </mo> 
         <mi>
           t 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> (6)</p>
    <p>where 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>
        θ 
      </mi> 
     </math> represents network parameters. Practically, this continuous function is sampled at discrete points corresponding to observational and meteorological data intervals, resulting in a discrete time series:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mover accent="true"> 
         <mi>
           T 
         </mi> 
         <mo>
           ^ 
         </mo> 
        </mover> 
        <mrow> 
         <mtext>
           PINN 
         </mtext> 
        </mrow> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <msub> 
          <mi>
            t 
          </mi> 
          <mn>
            1 
          </mn> 
         </msub> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         , 
       </mo> 
       <msub> 
        <mover accent="true"> 
         <mi>
           T 
         </mi> 
         <mo>
           ^ 
         </mo> 
        </mover> 
        <mrow> 
         <mtext>
           PINN 
         </mtext> 
        </mrow> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <msub> 
          <mi>
            t 
          </mi> 
          <mn>
            2 
          </mn> 
         </msub> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         , 
       </mo> 
       <mo>
         ⋯ 
       </mo> 
       <mo>
         , 
       </mo> 
       <msub> 
        <mover accent="true"> 
         <mi>
           T 
         </mi> 
         <mo>
           ^ 
         </mo> 
        </mover> 
        <mrow> 
         <mtext>
           PINN 
         </mtext> 
        </mrow> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <msub> 
          <mi>
            t 
          </mi> 
          <mi>
            n 
          </mi> 
         </msub> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> (7)</p>
    <p>This discretized series serves as input for the LSTM model. Specifically, the LSTM takes sequences of the simulated temperature data (e.g. time window of 7 days):</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mrow> 
        <mo>
          [ 
        </mo> 
        <mrow> 
         <msub> 
          <mover accent="true"> 
           <mi>
             T 
           </mi> 
           <mo>
             ^ 
           </mo> 
          </mover> 
          <mrow> 
           <mtext>
             PINN 
           </mtext> 
          </mrow> 
         </msub> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <msub> 
            <mi>
              t 
            </mi> 
            <mi>
              i 
            </mi> 
           </msub> 
          </mrow> 
          <mo>
            ) 
          </mo> 
         </mrow> 
         <mo>
           , 
         </mo> 
         <msub> 
          <mover accent="true"> 
           <mi>
             T 
           </mi> 
           <mo>
             ^ 
           </mo> 
          </mover> 
          <mrow> 
           <mtext>
             PINN 
           </mtext> 
          </mrow> 
         </msub> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <msub> 
            <mi>
              t 
            </mi> 
            <mrow> 
             <mi>
               i 
             </mi> 
             <mo>
               + 
             </mo> 
             <mn>
               1 
             </mn> 
            </mrow> 
           </msub> 
          </mrow> 
          <mo>
            ) 
          </mo> 
         </mrow> 
         <mo>
           , 
         </mo> 
         <mo>
           ⋯ 
         </mo> 
         <mo>
           , 
         </mo> 
         <msub> 
          <mover accent="true"> 
           <mi>
             T 
           </mi> 
           <mo>
             ^ 
           </mo> 
          </mover> 
          <mrow> 
           <mtext>
             PINN 
           </mtext> 
          </mrow> 
         </msub> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <msub> 
            <mi>
              t 
            </mi> 
            <mrow> 
             <mi>
               i 
             </mi> 
             <mo>
               + 
             </mo> 
             <mn>
               6 
             </mn> 
            </mrow> 
           </msub> 
          </mrow> 
          <mo>
            ) 
          </mo> 
         </mrow> 
        </mrow> 
        <mo>
          ] 
        </mo> 
       </mrow> 
       <mo>
         → 
       </mo> 
       <msub> 
        <mi>
          T 
        </mi> 
        <mi>
          w 
        </mi> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <msub> 
          <mi>
            t 
          </mi> 
          <mrow> 
           <mi>
             i 
           </mi> 
           <mo>
             + 
           </mo> 
           <mn>
             7 
           </mn> 
          </mrow> 
         </msub> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> (8)</p>
    <p>This integration is conceptually justified because the PINN provides physically-informed, realistic temperature estimations based on governing physical laws, while the LSTM model refines predictions by capturing temporal patterns observed historically.</p>
    <p>The boundary conditions implicitly applied within the PINN framework are Dirichlet conditions at 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mi>
         x 
       </mi> 
       <mo>
         = 
       </mo> 
       <mn>
         0 
       </mn> 
      </mrow> 
     </math>:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          T 
        </mi> 
        <mi>
          w 
        </mi> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mn>
           0 
         </mn> 
         <mo>
           , 
         </mo> 
         <mi>
           t 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         = 
       </mo> 
       <msub> 
        <mi>
          T 
        </mi> 
        <mi>
          r 
        </mi> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mi>
          t 
        </mi> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> (9)</p>
    <p>where 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          T 
        </mi> 
        <mi>
          r 
        </mi> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mi>
          t 
        </mi> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> represents observed temperature data at the initial spatial point. This condition is enforced by minimizing the discrepancy between predicted and observed temperatures at 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mi>
         x 
       </mi> 
       <mo>
         = 
       </mo> 
       <mn>
         0 
       </mn> 
      </mrow> 
     </math>.</p>
    <p>Thus, the PINN-LSTM hybrid approach effectively combines theoretical physical modeling (PINN) and empirical temporal pattern recognition (LSTM), leveraging strengths of both methods to enhance prediction accuracy for river temperature forecasting.</p>
   </sec>
   <sec id="s2_8">
    <title>2.8. Performance Metrics</title>
    <p>To evaluate the performance of the PINN-LSTM hybrid model in predicting the thermal behavior of the Catu River, three commonly used metrics were adopted: the coefficient of determination ( 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msup> 
        <mi>
          R 
        </mi> 
        <mn>
          2 
        </mn> 
       </msup> 
      </mrow> 
     </math>), the Mean Absolute Error (MAE), and the Root Mean Squared Error (RMSE). These metrics quantify how well the model predictions 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mover accent="true"> 
         <mi>
           u 
         </mi> 
         <mo>
           ˜ 
         </mo> 
        </mover> 
        <mi>
          i 
        </mi> 
       </msub> 
      </mrow> 
     </math> approximate the observed values 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          u 
        </mi> 
        <mi>
          i 
        </mi> 
       </msub> 
      </mrow> 
     </math> across all 
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>
        n 
      </mi> 
     </math> data points.</p>
    <p>The formulas are defined as follows:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msup> 
        <mi>
          R 
        </mi> 
        <mn>
          2 
        </mn> 
       </msup> 
       <mo>
         = 
       </mo> 
       <mfrac> 
        <mrow> 
         <msubsup> 
          <mstyle mathsize="140%" displaystyle="true"> 
           <mo>
             ∑ 
           </mo> 
          </mstyle> 
          <mrow> 
           <mi>
             i 
           </mi> 
           <mo>
             = 
           </mo> 
           <mn>
             1 
           </mn> 
          </mrow> 
          <mi>
            n 
          </mi> 
         </msubsup> 
         <msup> 
          <mrow> 
           <mrow> 
            <mo>
              ( 
            </mo> 
            <mrow> 
             <msub> 
              <mover accent="true"> 
               <mi>
                 u 
               </mi> 
               <mo>
                 ˜ 
               </mo> 
              </mover> 
              <mi>
                i 
              </mi> 
             </msub> 
             <mo>
               − 
             </mo> 
             <mover accent="true"> 
              <mi>
                u 
              </mi> 
              <mo>
                ¯ 
              </mo> 
             </mover> 
            </mrow> 
            <mo>
              ) 
            </mo> 
           </mrow> 
          </mrow> 
          <mn>
            2 
          </mn> 
         </msup> 
        </mrow> 
        <mrow> 
         <msubsup> 
          <mstyle mathsize="140%" displaystyle="true"> 
           <mo>
             ∑ 
           </mo> 
          </mstyle> 
          <mrow> 
           <mi>
             i 
           </mi> 
           <mo>
             = 
           </mo> 
           <mn>
             1 
           </mn> 
          </mrow> 
          <mi>
            n 
          </mi> 
         </msubsup> 
         <msup> 
          <mrow> 
           <mrow> 
            <mo>
              ( 
            </mo> 
            <mrow> 
             <msub> 
              <mi>
                u 
              </mi> 
              <mi>
                i 
              </mi> 
             </msub> 
             <mo>
               − 
             </mo> 
             <mover accent="true"> 
              <mi>
                u 
              </mi> 
              <mo>
                ¯ 
              </mo> 
             </mover> 
            </mrow> 
            <mo>
              ) 
            </mo> 
           </mrow> 
          </mrow> 
          <mn>
            2 
          </mn> 
         </msup> 
        </mrow> 
       </mfrac> 
      </mrow> 
     </math> (10)</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mtext>
         MAE 
       </mtext> 
       <mo>
         = 
       </mo> 
       <mfrac> 
        <mn>
          1 
        </mn> 
        <mi>
          n 
        </mi> 
       </mfrac> 
       <munderover> 
        <mstyle displaystyle="true" mathsize="140%"> 
         <mo>
           ∑ 
         </mo> 
        </mstyle> 
        <mrow> 
         <mi>
           i 
         </mi> 
         <mo>
           = 
         </mo> 
         <mn>
           1 
         </mn> 
        </mrow> 
        <mi>
          n 
        </mi> 
       </munderover> 
       <mrow> 
        <mo>
          | 
        </mo> 
        <mrow> 
         <msub> 
          <mi>
            u 
          </mi> 
          <mi>
            i 
          </mi> 
         </msub> 
         <mo>
           − 
         </mo> 
         <msub> 
          <mover accent="true"> 
           <mi>
             u 
           </mi> 
           <mo>
             ˜ 
           </mo> 
          </mover> 
          <mi>
            i 
          </mi> 
         </msub> 
        </mrow> 
        <mo>
          | 
        </mo> 
       </mrow> 
      </mrow> 
     </math> (11)</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mtext>
         RMSE 
       </mtext> 
       <mo>
         = 
       </mo> 
       <msqrt> 
        <mrow> 
         <mfrac> 
          <mn>
            1 
          </mn> 
          <mi>
            n 
          </mi> 
         </mfrac> 
         <munderover> 
          <mstyle displaystyle="true" mathsize="140%"> 
           <mo>
             ∑ 
           </mo> 
          </mstyle> 
          <mrow> 
           <mi>
             i 
           </mi> 
           <mo>
             = 
           </mo> 
           <mn>
             1 
           </mn> 
          </mrow> 
          <mi>
            n 
          </mi> 
         </munderover> 
         <msup> 
          <mrow> 
           <mrow> 
            <mo>
              ( 
            </mo> 
            <mrow> 
             <msub> 
              <mi>
                u 
              </mi> 
              <mi>
                i 
              </mi> 
             </msub> 
             <mo>
               − 
             </mo> 
             <msub> 
              <mover accent="true"> 
               <mi>
                 u 
               </mi> 
               <mo>
                 ˜ 
               </mo> 
              </mover> 
              <mi>
                i 
              </mi> 
             </msub> 
            </mrow> 
            <mo>
              ) 
            </mo> 
           </mrow> 
          </mrow> 
          <mn>
            2 
          </mn> 
         </msup> 
        </mrow> 
       </msqrt> 
      </mrow> 
     </math> (12)</p>
    <p>where:</p>
    <p>The R<sup>2</sup> metric assesses the proportion of variance in the observed data explained by the model, with values closer to 1 indicating better fit. MAE represents the average magnitude of the errors without considering their direction, while RMSE penalizes larger errors more heavily due to squaring, making it particularly sensitive to outliers.</p>
   </sec>
  </sec><sec id="s3">
   <title>3. Main Results</title>
   <p>The dataset was chronologically split into two subsets: approximately 80% for training and 20% for testing. Specifically, the first 80% (2009-2015) of the data was used for model training, while the remaining 20% (2016-2017) was reserved exclusively for model validation and testing.</p>
   <p>The model was trained using the combined Physics-Informed Neural Network (PINN) and Long-Short-Term Memory (LSTM) approach for a maximum of 500 epochs, with batch size set at 64. To prevent overfitting and enhance generalization capability, early stopping was implemented. The training process was automatically terminated if the validation loss did not improve after 40 consecutive epochs.</p>
   <table-wrap id="table2">
    <label>
     <xref ref-type="table" rid="table2">
      Table 2
     </xref></label>
    <caption>
     <title>
      <xref ref-type="bibr" rid="scirp.143484-"></xref>Table 2. Results of quantitative metrics for model evaluation.</title>
    </caption>
    <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
     <tr> 
      <td class="acenter" width="25.75%"><p style="text-align:center">Model</p></td> 
      <td class="acenter" width="18.56%"><p style="text-align:center">MAE</p></td> 
      <td class="acenter" width="18.57%"><p style="text-align:center">MSE</p></td> 
      <td class="acenter" width="18.56%"><p style="text-align:center">RMSE</p></td> 
      <td class="acenter" width="18.57%"><p style="text-align:center">R<sup>2</sup></p></td> 
     </tr> 
     <tr> 
      <td class="custom-top-td acenter" width="25.75%"><p style="text-align:center">LSTM + PINN</p></td> 
      <td class="custom-top-td acenter" width="18.56%"><p style="text-align:center">0.1154</p></td> 
      <td class="custom-top-td acenter" width="18.57%"><p style="text-align:center">0.0208</p></td> 
      <td class="custom-top-td acenter" width="18.56%"><p style="text-align:center">0.1443</p></td> 
      <td class="custom-top-td acenter" width="18.57%"><p style="text-align:center">0.5394</p></td> 
     </tr> 
     <tr> 
      <td class="acenter" width="25.75%"><p style="text-align:center">CNN + PINN</p></td> 
      <td class="acenter" width="18.56%"><p style="text-align:center">0.1349</p></td> 
      <td class="acenter" width="18.57%"><p style="text-align:center">0.0312</p></td> 
      <td class="acenter" width="18.56%"><p style="text-align:center">0.1767</p></td> 
      <td class="acenter" width="18.57%"><p style="text-align:center">0.3098</p></td> 
     </tr> 
     <tr> 
      <td class="acenter" width="25.75%"><p style="text-align:center">LSTM</p></td> 
      <td class="acenter" width="18.56%"><p style="text-align:center">0.1664</p></td> 
      <td class="acenter" width="18.57%"><p style="text-align:center">0.0502</p></td> 
      <td class="acenter" width="18.56%"><p style="text-align:center">0.2240</p></td> 
      <td class="acenter" width="18.57%"><p style="text-align:center">0.1084</p></td> 
     </tr> 
     <tr> 
      <td class="acenter" width="25.75%"><p style="text-align:center">Other topologies</p></td> 
      <td class="acenter" width="18.56%"><p style="text-align:center">0.1495</p></td> 
      <td class="acenter" width="18.57%"><p style="text-align:center">0.0392</p></td> 
      <td class="acenter" width="18.56%"><p style="text-align:center">0.1980</p></td> 
      <td class="acenter" width="18.57%"><p style="text-align:center">0.1334</p></td> 
     </tr> 
    </table>
   </table-wrap>
   <p>The comparative analysis of the evaluated models reveals significant distinctions in predictive capability, as indicated by the quantitative metrics detailed in <xref ref-type="table" rid="table2">
     Table 2
    </xref>. The hybrid architecture, integrating Long-Short-Term Memory (LSTM) networks with Physics-Informed Neural Networks (PINNs), consistently demonstrated superior predictive accuracy, achieving the lowest errors across all considered metrics, Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE), alongside the highest coefficient of determination (R<sup>2</sup>), as shown in <xref ref-type="table" rid="table2">
     Table 2
    </xref>. These outcomes suggest that incorporating physics-based constraints and domain-specific knowledge effectively enhances the robustness of predictions, promoting improved model generalization and reliability.</p>
   <p>Conversely, models relying exclusively on LSTM architectures exhibited notably inferior performance, particularly when assessed through metrics sensitive to squared errors (MSE and RMSE). This reduced performance indicates heightened vulnerability to data variability and potential susceptibility to anomalous observations. Such results underscore the critical role of embedding physical regularization techniques within neural network models, as these constraints significantly mitigate undesirable model behaviors by leveraging prior knowledge intrinsic to the physical system under study.</p>
   <p>Furthermore, the alternative evaluated topologies, including Convolutional Neural Networks (CNNs) combined with PINNs, presented intermediate predictive capabilities. While these models surpassed purely traditional approaches, they still fell short compared to the hybrid LSTM + PINN architecture, underscoring that while innovative, their performance remains limited by factors potentially related to their architectural complexity or inadequate integration of domain-specific physical insights.</p>
   <p>Despite the hybrid model’s superiority, the moderate values obtained for the coefficient of determination (R<sup>2</sup>) across all models, including the best-performing one, reflect the inherent complexity and multifaceted nature of the problem investigated. This suggests the presence of underlying phenomena or intrinsic noise in the data not fully captured by the current modeling frameworks. Such findings align with prevalent observations in the specialized literature, reinforcing the hybrid model’s efficacy as an advanced methodological approach for enhancing predictive quality in systems characterized by substantial complexity and inherent uncertainties.</p>
   <p>The analysis of predicted versus actual temperature values from the models throughout the testing period reveals distinct differences in their predictive behaviors. The hybrid LSTM + PINN (<xref ref-type="fig" rid="fig5">
     Figure 5
    </xref>) model consistently aligns closely with the observed temperature trends, accurately following both gradual and abrupt fluctuations observed in the data. This model effectively captures the peaks, declines, and rapid changes, demonstrating robust adaptability to temporal variations.</p>
   <fig id="fig5" position="float">
    <label>Figure 5</label>
    <caption>
     <title>Figure 5. The LSTM + PINN model accurately capturing temperature fluctuations and peak events.</title>
    </caption>
    <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1733147-rId147.jpeg?20250624022719" />
   </fig>
   <p>In contrast, the CNN + LSTM (<xref ref-type="fig" rid="fig6">
     Figure 6
    </xref>) model exhibits noticeable challenges in tracking temperature variations accurately. Predictions from this model frequently deviate from actual measurements, particularly during periods of sudden or extreme temperature shifts. This results in delayed responses and underestimation of peak temperatures, indicating limited responsiveness and decreased accuracy in capturing dynamic and volatile temperature behaviors.</p>
   <fig id="fig6" position="float">
    <label>Figure 6</label>
    <caption>
     <title>Figure 6. The CNN + LSTM model exhibiting delayed responses and inaccuracies during rapid temperature changes.</title>
    </caption>
    <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1733147-rId148.jpeg?20250624022719" />
   </fig>
   <p>Overall, the hybrid LSTM + PINN model provides a more reliable representation of temperature trends over the entire testing period compared to the CNN + LSTM model.</p>
   <p>Analyze the temporal prediction capability:</p>
   <sec id="s3_1">
    <title>3.1. Analysis of Monthly Peak</title>
    <p>Extreme temperature events in the Catu River are typically characterized by monthly peaks exceeding 21˚C, often associated with seasonal heating and hydrological stress conditions. These events are critical for ecological balance, water quality, and system-level modeling. Therefore, evaluating the model’s capability to predict these upper-bound temperature scenarios is essential.</p>
    <p>The comparison between observed and predicted peak temperatures, as illustrated in <xref ref-type="fig" rid="fig7">
      Figure 7
     </xref>, demonstrates that the PINN + LSTM model is capable of approximating the seasonal dynamics of monthly maxima. The predicted values follow the overall trend of real peaks, particularly during the warmer months when temperature variability is higher. However, systematic deviations are observed in several periods.</p>
    <p>Notably, there is a consistent offset between observed and predicted peaks, with an average deviation of approximately 2˚C. This level of divergence is within the</p>
    <fig id="fig7" position="float">
     <label>Figure 7</label>
     <caption>
      <title>Figure 7. Monthly peak river temperatures (2009-2016): comparison between observed and predicted values using the PINN + LSTM model.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1733147-rId149.jpeg?20250624022720" />
    </fig>
    <p>acceptable range for natural measurement uncertainty in environmental monitoring, especially considering the complexity of river temperature dynamics influenced by meteorological, hydrological, and topographic factors.</p>
    <p>During the summer and late spring months, where extreme peaks are more pronounced, the model reproduces the temperature elevation pattern but tends to slightly underestimate the peak amplitude. In contrast, during cooler months, the difference between prediction and observation is reduced, indicating better alignment in low-variability scenarios.</p>
    <p>The results suggest that while the model captures the general structure of monthly extremes, high-frequency and short-term peak magnitudes remain partially attenuated. This behavior is consistent with temporal smoothing effects induced by the LSTM architecture and the regularization from physics-based constraints.</p>
   </sec>
   <sec id="s3_2">
    <title>3.2. Sensitivity Analysis of Meteorological Variables</title>
    <p>A sensitivity analysis was performed to investigate how variations in individual meteorological inputs affect the LSTM model’s output for river temperature. This analysis was conducted by computing the partial derivatives of the model’s predictions with respect to each input variable using automatic differentiation.</p>
    <p>The results, shown in <xref ref-type="fig" rid="fig8">
      Figure 8
     </xref>, reveal that different variables exhibit distinct levels of influence on the model output. Variables related to atmospheric moisture, such as dew point and humidity, display higher sensitivity, suggesting that the model registers stronger gradients in temperature predictions when these inputs are perturbed. This may be associated with the model’s internal representation of near-surface heat exchange mechanisms.</p>
    <p>Evaporation also demonstrates a measurable impact, indicating a potential role in modulating temperature through latent heat processes. Meanwhile, rainfall and wind speed contribute lower gradient responses, reflecting reduced direct sensitivity</p>
    <fig id="fig8" position="float">
     <label>Figure 8</label>
     <caption>
      <title>Figure 8. Mean sensitivity of meteorological input variables to river temperature prediction, based on gradient analysis of the LSTM model.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1733147-rId150.jpeg?20250624022721" />
    </fig>
    <p>under the current temporal and spatial resolution.</p>
    <p>These sensitivity patterns vary across variables and likely depend on the seasonal dynamics, temporal scale of the input data, and the autoregressive <xref ref-type="bibr" rid="scirp.143484-34">
      [34]
     </xref> nature of the LSTM architecture, which may amplify or dampen certain features based on their historical behavior in the input sequences.</p>
   </sec>
   <sec id="s3_3">
    <title>3.3. Ablation Study of Meteorological Inputs</title>
    <p>To complement the gradient-based sensitivity analysis, an ablation study was conducted to examine the dependency of the model on individual meteorological variables. In this approach, each input feature was systematically removed by zeroing its values in the test set while keeping the remaining variables unchanged. The resulting change in Mean Squared Error (MSE) was computed to quantify the relative importance of each variable to the predictive performance of the model.</p>
    <p>The outcomes of this procedure are illustrated in <xref ref-type="fig" rid="fig9">
      Figure 9
     </xref>. Variables associated with atmospheric moisture-particularly humidity and dew point-produced the largest increases in error when removed, indicating that these features provide essential information for capturing the thermal behavior of the river system. Wind speed and evaporation also led to noticeable error increases, suggesting that they contribute relevant dynamic cues to the model’s internal representation of energy exchange processes.</p>
    <p>Precipitation, on the other hand, showed minimal influence on model performance. Its removal did not result in a meaningful increase in prediction error, and even led to a slight improvement in some cases. This behavior may be explained by the regional climatic characteristics: the study area experiences relatively low rainfall throughout the year, with precipitation concentrated in brief seasonal periods. As a result, the temporal resolution and dynamics of precipitation events may not align strongly with short-term river temperature fluctuations, reducing its predictive</p>
    <fig id="fig9" position="float">
     <label>Figure 9</label>
     <caption>
      <title>Figure 9. Change in prediction error (MSE) after removal of each meteorological input variable. Positive values indicate performance degradation.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1733147-rId151.jpeg?20250624022722" />
    </fig>
    <p>value in this specific configuration.</p>
    <p>The ablation study reveals that meteorological variables such as humidity and dew point play significant roles in river temperature prediction. However, other important drivers, including river discharge, riparian vegetation cover, and riverbed morphology, were not incorporated in this study. Future work should aim to integrate these factors to enhance the model’s predictive capabilities.</p>
   </sec>
  </sec><sec id="s4">
   <title>4. Conclusions and Suggestions</title>
   <p>This study aimed to develop a hybrid modeling approach that combines Physics-Informed Neural Networks (PINNs) with Long-Short-Term Memory (LSTM) networks to predict river water temperature with improved accuracy and physical consistency. Based on the results, the proposed objective was effectively achieved. The model demonstrated the capability to capture both the temporal variability and physical constraints governing thermal behavior in river systems, even under data limitations.</p>
   <p>Regarding the main contributions, the integration of the advection-diffusion-reaction equation within the PINN module allowed for the physical representation of heat exchange processes influenced by meteorological inputs. Combined with the LSTM’s temporal learning ability, the hybrid architecture enhanced the predictive robustness across diverse hydroclimatic conditions. Sensitivity and ablation analyses confirmed that the model effectively learned variable dependencies, highlighting humidity and dew point as primary influencers and confirming the minimal impact of precipitation due to the region’s low rainfall frequency.</p>
   <p>The results support the conclusion that hybrid data-physics-informed models present a viable alternative to purely data-driven or physical models, particularly in scenarios where complex dynamics and limited data coexist. The accurate reproduction of temperature peaks, the alignment with observed seasonal patterns, and the model’s adaptability to extreme events emphasize its suitability for real-world environmental applications.</p>
   <p>While the PINN + LSTM model achieves satisfactory average performance, there is a systematic underestimation of peak river temperatures, as evidenced by the comparison of monthly maximum temperatures. This limitation is crucial for environmental management applications. Future research may address this by applying extreme-focused loss functions or augmentation techniques to better capture critical thermal events.</p>
   <p>Future work may involve expanding the model to incorporate spatial dynamics via distributed sensors, integrating additional hydrological variables such as streamflow and turbidity, and improving the PINN formulation with adaptive weighting between physical and observational losses. Additionally, extending the model to include uncertainty quantification methods may provide more interpretable predictions for decision-making in environmental monitoring and management.</p>
  </sec><sec id="s5">
   <title>Acknowledgements</title>
   <p>This work was supported by CAPES (Coordination for the Improvement of Higher Education Personnel), the State University of Bahia (UNEB), and the SENAI CIMATEC University. The authors thank these institutions for their academic, technical, and financial support throughout the development of this research.</p>
  </sec>
 </body><back>
  <ref-list>
   <title>References</title>
   <ref id="scirp.143484-ref1">
    <label>1</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Zhu, S. and Piotrowski, A.P. (2020) River/Stream Water Temperature Forecasting Using Artificial Intelligence Models: A Systematic Review. Acta Geophysica, 68, 1433-1442. &gt;https://doi.org/10.1007/s11600-020-00480-7
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref2">
    <label>2</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Qiu, R., Wang, Y., Wang, D., Qiu, W., Wu, J. and Tao, Y. (2020) Water Temperature Forecasting Based on Modified Artificial Neural Network Methods: Two Cases of the Yangtze River. Science of The Total Environment, 737, Article ID: 139729. &gt;https://doi.org/10.1016/j.scitotenv.2020.139729
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref3">
    <label>3</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Qiu, R., Wang, Y., Rhoads, B., Wang, D., Qiu, W., Tao, Y., et al. (2021) River Water Temperature Forecasting Using a Deep Learning Method. Journal of Hydrology, 595, Article ID: 126016. &gt;https://doi.org/10.1016/j.jhydrol.2021.126016
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref4">
    <label>4</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Tao, H., Abba, S.I., Al-Areeq, A.M., Tangang, F., Samantaray, S., Sahoo, A., et al. (2024) Hybridized Artificial Intelligence Models with Nature-Inspired Algorithms for River Flow Modeling: A Comprehensive Review, Assessment, and Possible Future Research Directions. Engineering Applications of Artificial Intelligence, 129, Article ID: 107559. &gt;https://doi.org/10.1016/j.engappai.2023.107559
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref5">
    <label>5</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Gresselin, F., Dardaillon, B., Bordier, C., Parais, F. and Kauffmann, F. (2021) Use of Statistical Methods to Characterize the Influence of Groundwater on the Thermal Regime of Rivers in Normandy, France: Comparison between the Highly Permeable, Chalk Catchment of the Touques River and the Low Permeability, Crystalline Rock Catchment of the Orne River. Geological Society, London, Special Publications, 517, 351-378. &gt;https://doi.org/10.1144/sp517-2020-117
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref6">
    <label>6</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Georges, B. (2022) Characterization of the River Thermal Regime in Relation to Its Environment: A Regional Approach Using in Situ Sensors in a Temperate Region (Wallonia, Belgium). &gt;https://hdl.handle.net/2268/266855 
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref7">
    <label>7</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Drainas, K., Kaule, L., Mohr, S., Uniyal, B., Wild, R. and Geist, J. (2023) Predicting Stream Water Temperature with Artificial Neural Networks Based on Open‐Access Data. Hydrological Processes, 37, e14991. &gt;https://doi.org/10.1002/hyp.14991
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref8">
    <label>8</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Almeida, M.C. and Coelho, P.S. (2023) Modeling River Water Temperature with Limiting Forcing Data: Air2stream V1.0.0, Machine Learning and Multiple Regression. Geoscientific Model Development, 16, 4083-4112. &gt;https://doi.org/10.5194/gmd-16-4083-2023
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref9">
    <label>9</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Zhang, W., Zhou, H., Bao, X. and Cui, H. (2023) Outlet Water Temperature Prediction of Energy Pile Based on Spatial-Temporal Feature Extraction through CNN-LSTM Hybrid Model. Energy, 264, Article ID: 126190. &gt;https://doi.org/10.1016/j.energy.2022.126190
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref10">
    <label>10</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Huang, X., Abolt, C.J. and Bennett, K.E. (2023) Brief Communication: Effects of Different Saturation Vapor Pressure Calculations on Simulated Surface-Subsurface Hydrothermal Regimes at a Permafrost Field Site. The Cryosphere Discussions, 1-15. (Preprints) &gt;https://doi.org/10.5194/tc-2023-8
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref11">
    <label>11</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Bazionis, I.K. and Georgilakis, P.S. (2021) Review of Deterministic and Probabilistic Wind Power Forecasting: Models, Methods, and Future Research. Electricity, 2, 13-47. &gt;https://doi.org/10.3390/electricity2010002
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref12">
    <label>12</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Padrón, R.S., Zappa, M., Bernhard, L. and Bogner, K. (2024) Extended Range Forecasting of Stream Water Temperature with Deep Learning Models. EGUsphere, 1-27. ttps://doi.org/10.5194/egusphere-2024-2591-supplement
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref13">
    <label>13</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Oad, S., Imteaz, M.A. and Mekanik, F. (2023) Artificial Neural Network (ANN)-Based Long-Term Streamflow Forecasting Models Using Climate Indices for Three Tributaries of Goulburn River, Australia. Climate, 11, Article 152. &gt;https://doi.org/10.3390/cli11070152
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref14">
    <label>14</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Tran, T.T.K., Bateni, S.M., Ki, S.J. and Vosoughifar, H. (2021) A Review of Neural Networks for Air Temperature Forecasting. Water, 13, Article 1294. &gt;https://doi.org/10.3390/w13091294
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref15">
    <label>15</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Georgescu, P., Moldovanu, S., Iticescu, C., Calmuc, M., Calmuc, V., Topa, C., et al. (2023) Assessing and Forecasting Water Quality in the Danube River by Using Neural Network Approaches. Science of The Total Environment, 879, Article ID: 162998. &gt;https://doi.org/10.1016/j.scitotenv.2023.162998
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref16">
    <label>16</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Cai, S., Mao, Z., Wang, Z., Yin, M. and Karniadakis, G.E. (2021) Physics-Informed Neural Networks (PINNs) for Fluid Mechanics: A Review. Acta Mechanica Sinica, 37, 1727-1738. &gt;https://doi.org/10.1007/s10409-021-01148-1
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref17">
    <label>17</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Nilpueng, K., Kaseethong, P., Mesgarpour, M., Shadloo, M.S. and Wongwises, S. (2022) A Novel Temperature Prediction Method without Using Energy Equation Based on Physics-Informed Neural Network (PINN): A Case Study on Plate-Circular/Square Pin-Fin Heat Sinks. Engineering Analysis with Boundary Elements, 145, 404-417. &gt;https://doi.org/10.1016/j.enganabound.2022.09.032
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref18">
    <label>18</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Liao, S., Xue, T., Jeong, J., Webster, S., Ehmann, K. and Cao, J. (2023) Hybrid Thermal Modeling of Additive Manufacturing Processes Using Physics-Informed Neural Networks for Temperature Prediction and Parameter Identification. Computational Mechanics, 72, 499-512. &gt;https://doi.org/10.1007/s00466-022-02257-9
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref19">
    <label>19</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Gao, W., Gao, J., Yang, L., Wang, M. and Yao, W. (2021) A Novel Modeling Strategy of Weighted Mean Temperature in China Using RNN and LSTM. Remote Sensing, 13, Article 3004. &gt;https://doi.org/10.3390/rs13153004
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref20">
    <label>20</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Hayder, G., Iwan Solihin, M. and Najwa, M.R.N. (2022) Multi-Step-Ahead Prediction of River Flow Using NARX Neural Networks and Deep Learning LSTM. H2Open Journal, 5, 43-60. &gt;https://doi.org/10.2166/h2oj.2022.134
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref21">
    <label>21</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Dehghani, A., Moazam, H.M.Z.H., Mortazavizadeh, F., Ranjbar, V., Mirzaei, M., Mortezavi, S., et al. (2023) Comparative Evaluation of LSTM, CNN, and Convlstm for Hourly Short-Term Streamflow Forecasting Using Deep Learning Approaches. Ecological Informatics, 75, Article ID: 102119. &gt;https://doi.org/10.1016/j.ecoinf.2023.102119
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref22">
    <label>22</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Li, L., Wang, Q., Zhao, Z., Li, C. and Hu, Y. (2024) A Novel Optimal Temporal Lag Air2stream Model Using Dynamic Time Series Matching. Hydrological Sciences Journal, 69, 2278-2292. &gt;https://doi.org/10.1080/02626667.2024.2406311
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref23">
    <label>23</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Feng, D., Tan, Z. and He, Q. (2023) Physics‐Informed Neural Networks of the Saint‐Venant Equations for Downscaling a Large‐Scale River Model. Water Resources Research, 59, e2022WR033168. &gt;https://doi.org/10.1029/2022wr033168
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref24">
    <label>24</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Elbeltagi, A., Pande, C.B., Kumar, M., Tolche, A.D., Singh, S.K., Kumar, A., et al. (2023) Prediction of Meteorological Drought and Standardized Precipitation Index Based on the Random Forest (RF), Random Tree (RT), and Gaussian Process Regression (GPR) Models. Environmental Science and Pollution Research, 30, 43183-43202. &gt;https://doi.org/10.1007/s11356-023-25221-3
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref25">
    <label>25</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Feigl, M., Lebiedzinski, K., Herrnegger, M. and Schulz, K. (2021) Machine-Learning Methods for Stream Water Temperature Prediction. Hydrology and Earth System Sciences, 25, 2951-2977. &gt;https://doi.org/10.5194/hess-25-2951-2021
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref26">
    <label>26</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Heddam, S., Ptak, M. and Zhu, S. (2020) Modelling of Daily Lake Surface Water Temperature from Air Temperature: Extremely Randomized Trees (ERT) versus Air2Water, MARS, M5Tree, RF and MLPNN. Journal of Hydrology, 588, Article ID: 125130. &gt;https://doi.org/10.1016/j.jhydrol.2020.125130
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref27">
    <label>27</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Someetheram, V., Marsani, M.F., Mohd Kasihmuddin, M.S., Mohd Jamaludin, S.Z. and Mansor, M.A. (2024) Double Decomposition with Enhanced Least-Squares Support Vector Machine to Predict Water Level. Journal of Water and Climate Change, 15, 2582-2594. &gt;https://doi.org/10.2166/wcc.2024.558
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref28">
    <label>28</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Usharani, B. (2023) ILF-LSTM: Enhanced Loss Function in LSTM to Predict the Sea Surface Temperature. Soft Computing, 27, 13129-13141. &gt;https://doi.org/10.1007/s00500-022-06899-y
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref29">
    <label>29</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Venkateswarlu, T. and Anmala, J. (2024) Importance of Land Use Factors in the Prediction of Water Quality of the Upper Green River Watershed, Kentucky, USA, Using Random Forest. Environment, Development and Sustainability, 26, 23961-23984. &gt;https://doi.org/10.1007/s10668-023-03630-1
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref30">
    <label>30</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     O’Sullivan, A.M., Devito, K.J., Ogilvie, J., Linnansaari, T., Pronk, T., Allard, S., et al. (2020) Effects of Topographic Resolution and Geologic Setting on Spatial Statistical River Temperature Models. Water Resources Research, 56, e2020WR028122. &gt;https://doi.org/10.1029/2020wr028122
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref31">
    <label>31</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Pero, E.J.I., Georgieff, S.M., Gultemirian, M.d.L., Romero, F., Hankel, G.E. and Domínguez, E. (2020) Ecoregions, Climate, Topography, Physicochemical, or a Combination of All: Which Criteria Are the Best to Define River Types Based on Abiotic Variables and Macroinvertebrates in Neotropical Rivers? Science of The Total Environment, 738, Article ID: 140303. &gt;https://doi.org/10.1016/j.scitotenv.2020.140303
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref32">
    <label>32</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Wan Mohd Jaafar, W.S., Abdul Maulud, K.N., Muhmad Kamarulzaman, A.M., Raihan, A., Md Sah, S., Ahmad, A., et al. (2020) The Influence of Deforestation on Land Surface Temperature—A Case Study of Perak and Kedah, Malaysia. Forests, 11, Article 670. &gt;https://doi.org/10.3390/f11060670
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref33">
    <label>33</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Fuso, F., Stucchi, L., Bonacina, L., Fornaroli, R. and Bocchiola, D. (2023) Evaluation of Water Temperature under Changing Climate and Its Effect on River Habitat in a Regulated Alpine Catchment. Journal of Hydrology, 616, Article ID: 128816. &gt;https://doi.org/10.1016/j.jhydrol.2022.128816
    </mixed-citation>
   </ref>
   <ref id="scirp.143484-ref34">
    <label>34</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Alnahit, A.O., Mishra, A.K. and Khan, A.A. (2022) Stream Water Quality Prediction Using Boosted Regression Tree and Random Forest Models. Stochastic Environmental Research and Risk Assessment, 36, 2661-2680. &gt;https://doi.org/10.1007/s00477-021-02152-4
    </mixed-citation>
   </ref>
  </ref-list>
 </back>
</article>