<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xml:lang="EN" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Sustain. Resour. Manag.</journal-id>
<journal-title>Frontiers in Sustainable Resource Management</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Sustain. Resour. Manag.</abbrev-journal-title>
<issn pub-type="epub">2813-3005</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/fsrma.2024.1363914</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Sustainable Resource Management</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>IoT and machine learning approach for the determination of optimal freshwater replenishment rate in aquaponics system</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name><surname>Chandramenon</surname> <given-names>Praveen</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<xref ref-type="corresp" rid="c001"><sup>&#x0002A;</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/2618071/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/conceptualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/data-curation/"/>
<role content-type="https://credit.niso.org/contributor-roles/formal-analysis/"/>
<role content-type="https://credit.niso.org/contributor-roles/investigation/"/>
<role content-type="https://credit.niso.org/contributor-roles/methodology/"/>
<role content-type="https://credit.niso.org/contributor-roles/resources/"/>
<role content-type="https://credit.niso.org/contributor-roles/software/"/>
<role content-type="https://credit.niso.org/contributor-roles/visualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Gascoyne</surname> <given-names>Andrew</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/2711021/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/supervision/"/>
<role content-type="https://credit.niso.org/contributor-roles/validation/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
<contrib contrib-type="author" corresp="yes">
<name><surname>Tchuenbou-Magaia</surname> <given-names>Fideline</given-names></name>
<xref ref-type="aff" rid="aff2"><sup>2</sup></xref>
<xref ref-type="corresp" rid="c002"><sup>&#x0002A;</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/2717114/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/funding-acquisition/"/>
<role content-type="https://credit.niso.org/contributor-roles/investigation/"/>
<role content-type="https://credit.niso.org/contributor-roles/project-administration/"/>
<role content-type="https://credit.niso.org/contributor-roles/supervision/"/>
<role content-type="https://credit.niso.org/contributor-roles/validation/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
</contrib-group>
<aff id="aff1"><sup>1</sup><institution>Department of Mathematics and Computer Science, University of Wolverhampton</institution>, <addr-line>Wolverhampton</addr-line>, <country>United Kingdom</country></aff>
<aff id="aff2"><sup>2</sup><institution>Department of Engineering, University of Wolverhampton</institution>, <addr-line>Wolverhampton</addr-line>, <country>United Kingdom</country></aff>
<author-notes>
<fn fn-type="edited-by"><p>Edited by: Amy Quandt, San Diego State University, United States</p></fn>
<fn fn-type="edited-by"><p>Reviewed by: Ali Sadiq, Nottingham Trent University, United Kingdom</p>
<p>Lalu Seban, National Institute of Technology, Silchar, India</p>
<p>Paul B. Brown, Purdue University, United States</p></fn>
<corresp id="c001">&#x0002A;Correspondence: Praveen Chandramenon <email>p.c.menon&#x00040;wlv.ac.uk</email></corresp>
<corresp id="c002">Fideline Tchuenbou-Magaia <email>f.tchuenbou-magaia&#x00040;wlv.ac.uk</email></corresp>
</author-notes>
<pub-date pub-type="epub">
<day>06</day>
<month>05</month>
<year>2024</year>
</pub-date>
<pub-date pub-type="collection">
<year>2024</year>
</pub-date>
<volume>3</volume>
<elocation-id>1363914</elocation-id>
<history>
<date date-type="received">
<day>15</day>
<month>01</month>
<year>2024</year>
</date>
<date date-type="accepted">
<day>17</day>
<month>04</month>
<year>2024</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2024 Chandramenon, Gascoyne and Tchuenbou-Magaia.</copyright-statement>
<copyright-year>2024</copyright-year>
<copyright-holder>Chandramenon, Gascoyne and Tchuenbou-Magaia</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p></license>
</permissions>
<abstract>
<p>Conventional aquaponics conserve water used in aquaponics whereas the literature suggests a certain level of freshwater replenishment or freshwater exchange for good water quality, fish and plant wellbeing, and the overall productivity of the system. This paper deals with the determination of an optimal freshwater replenishment rate for a standard aquaponics system. IoT devices and sensors were used for this project data collection. This paper used linear regressions and ensemble methods to determine the optimal rate of periodic water replenishment to maintain the water quality parameters that determine the yield and productivity of aquaponics systems. Cubic spline and Lagrange interpolation were applied to raw and simulated data. Results were evaluated and compared using statistical error estimation approaches. The best model amongst the investigated machine learning models was gradient boost with an optimal replenishment rate of 19L per week and a water quality of 4.86 for an aquaponic tank of 100 L capacity. The error estimations were a Mean Squared Error of 0.0224, Mean Absolute Error of 0.1137, Root Mean Squared Error of 0.1499, and <italic>R</italic><sup>2</sup> of 0.7208. This was within 1% of the value obtained from raw and interpolated data using a polynomial regression. These findings suggest that the water quality of an aquaponics system can be maintained at the desired optimal level with a weekly 19% water replenishment, thereby contributing to the improvement of productivity and resource efficiency.</p></abstract>
<kwd-group>
<kwd>Internet of things (IoT)</kwd>
<kwd>aquaponics</kwd>
<kwd>water quality</kwd>
<kwd>water replenishment</kwd>
<kwd>machine learning</kwd>
</kwd-group>
<counts>
<fig-count count="7"/>
<table-count count="4"/>
<equation-count count="5"/>
<ref-count count="20"/>
<page-count count="11"/>
<word-count count="6143"/>
</counts>
<custom-meta-wrap>
<custom-meta>
<meta-name>section-at-acceptance</meta-name>
<meta-value>Natural Resources</meta-value>
</custom-meta>
</custom-meta-wrap>
</article-meta>
</front>
<body>
<sec sec-type="intro" id="s1">
<title>1 Introduction</title>
<p>The apparent fast growth of the world population and ever-increasing need for food alongside pressure to achieve sustainable goals has driven changes from conventional farming approaches to sustainable agriculture ones. Aquaponics is an agricultural approach that combines fish and soilless plant production in a recirculating ecosystem where natural bacteria convert fish waste into plant nutrients (Delaide et al., <xref ref-type="bibr" rid="B4">2017</xref>). A coupled aquaponic system contains aquatic organisms, bacteria, and plants that benefit from each other in a closed recirculated water body (Goddek et al., <xref ref-type="bibr" rid="B7">2019</xref>). That is, fish and plants are grown together in a closed system with a regular water recirculation between plants growbed and the fishtank. In a standard coupled aquaponics system, generally, the plants are grown on a growbed media and the fishtank is kept under the plants growbed Fish water is nutrient rich, and the plants take up these nutrients from the water to grow whilst purifying the water which returns to the fish tank. All toxic chemicals accumulated in the water, which are dangerous for the fish life, would be removed when the water is passed over the plants growbed. The quality of water that circulates between the fish tank and the plant determines the productivity of the aquaponics system. Conventional aquaponics conserves the water and the replenishment of water, which consists in exchanging fish water with the same amount of fresh water is somehow empirical. Indeed, water is generally topped up when the water level is decreased due to evaporation or evapotranspiration whilst the literature shows a broad range of water replenishment from 1% to 100%. A study on different aquaculture systems found that a rapid flow of water causes rapid flushing of waste from water which could be beneficial in waste and solid disposal from fish water (Ebeling and Timmons, <xref ref-type="bibr" rid="B5">2007</xref>). A water exchange of 5&#x02013;10% has been reported to be beneficial for recirculating aquaponics (Gnanasagar et al., <xref ref-type="bibr" rid="B6">2020</xref>) whereas another research suggested that a 3.6% daily water replenishment caused massive nutrient loss when investigating nutrient balances and plant and fish growth performance (Delaide et al., <xref ref-type="bibr" rid="B4">2017</xref>). A project performed a 70% daily water exchange in their aquaponic system during their study on the economic viability of aquaponics systems (Bich et al., <xref ref-type="bibr" rid="B2">2020</xref>). They found that their aquaponics with 70% daily water exchanged have a reduced NH<sub>3</sub> level by five times when compared to a standard aquaponic system. An article studied the water level management using bell-siphons in aquaponics and found that water replenishment helps maintain levels of dissolved oxygen between 5 and 10 which is within that acceptable range for good performance (Romano et al., <xref ref-type="bibr" rid="B14">2023</xref>). The range of acceptable values is shown in <xref ref-type="table" rid="T1">Table 1</xref>. Another research analyzed that the energy and water usage of a raft aquaponics and found about 1% water loss per day and an average of 35,950 L for replenishment per year to cope with this water loss (Love et al., <xref ref-type="bibr" rid="B9">2015</xref>). They applied a maximum of 10% water replenishment only to cope with the water loss. They also used chemical combinations to maintain the water quality. A study reported that higher feeding rates and lower water replenishment may cause nitrite and other toxic chemicals to accumulate in fish water quickly (Rakocy et al., <xref ref-type="bibr" rid="B12">2004</xref>). Another experiment replenished 6.3% of water in their study on tomato production in aquaponics systems where manual methods were used to monitor water quality (Suhl et al., <xref ref-type="bibr" rid="B18">2016</xref>) whereas 9% replenishment of fish water was used by other authors during their study on nutrient recycling from fish water (Graber and Junge, <xref ref-type="bibr" rid="B8">2009</xref>). Moreover, it has been found through a predictive modeling of pH using different regression analyses that pH levels drop over time and chemicals must be applied to maintain good water quality (Mori et al., <xref ref-type="bibr" rid="B10">2021</xref>). The impact of low and high rates of water replenishment is summarized in <xref ref-type="fig" rid="F1">Figure 1</xref>.</p>
<table-wrap position="float" id="T1">
<label>Table 1</label>
<caption><p>Aquaponics water quality parameters with their acceptable limits (adapted from Nhan et al., <xref ref-type="bibr" rid="B11">2019</xref>; Bich et al., <xref ref-type="bibr" rid="B2">2020</xref>; Sallenave, <xref ref-type="bibr" rid="B15">2022</xref>).</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Parameter</bold></th>
<th valign="top" align="center"><bold>Acceptable range</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">pH</td>
<td valign="top" align="center">6.4&#x02013;7.4</td>
</tr> <tr>
<td valign="top" align="left">Dissolved oxygen</td>
<td valign="top" align="center">&#x0003E;5</td>
</tr> <tr>
<td valign="top" align="left">Total ammonia nitrogen</td>
<td valign="top" align="center">&#x0003C;1 ppm</td>
</tr> <tr>
<td valign="top" align="left">Nitrates</td>
<td valign="top" align="center">5-150 ppm</td>
</tr> <tr>
<td valign="top" align="left">Nitrites</td>
<td valign="top" align="center">&#x0003C;1 ppm</td>
</tr> <tr>
<td valign="top" align="left">Water temperature</td>
<td valign="top" align="center">65&#x02013;85&#x000B0;F</td>
</tr> <tr>
<td valign="top" align="left">Water hardness (CaCO3)</td>
<td valign="top" align="center">0-75 ppm</td>
</tr> <tr>
<td valign="top" align="left">Turbidity</td>
<td valign="top" align="center">&#x0003E;5 NTU</td>
</tr></tbody>
</table>
</table-wrap>
<fig id="F1" position="float">
<label>Figure 1</label>
<caption><p>Schematic diagram of the effect of water replenishment on aquaponics system. <bold>(A)</bold> Effect of high and low replenishment rate; <bold>(B)</bold> Benefits of optimal water replenishment.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fsrma-03-1363914-g0001.tif"/>
</fig>
<p>The current literature thus reveals that most of the aquaponics systems have either no daily water replenishment or water replenishment values ranging from as low as below 10% (Graber and Junge, <xref ref-type="bibr" rid="B8">2009</xref>; Suhl et al., <xref ref-type="bibr" rid="B18">2016</xref>; Blanchard et al., <xref ref-type="bibr" rid="B3">2020</xref>; Rakocy et al., <xref ref-type="bibr" rid="B13">2022</xref>; Shaw et al., <xref ref-type="bibr" rid="B16">2022</xref>) to complete or 100% water replenishment (Nhan et al., <xref ref-type="bibr" rid="B11">2019</xref>). Moreover, water replenishment has not been applied intentionally in any system or any fixed rate of replenishment identified for a defined amount of fish water. Also, a very little or no explanation were evident in current literature regarding the replenishment rate used or regarding its impacts. Understanding the effect of a regular and fixed rate of water replenishment on an aquaponics system is important for the growth of the plants and fish and thus, needs a deeper analysis, which is currently missing in the literature. Similarly, very limited studies focus on the application of machine learning to analyse and control water quality and the impacts of water replenishment on fish and plants. Therefore, the main research problem addressed on this paper is the determination of the optimal water replenishment rate for an aquaponics system. This was achieved by estimating the water quality index from the data collected through sensors and IoT devices followed by the application of statistical approaches and machine learning algorithms to identify the best water replenishment rate. The words water replenishment, water exchange and flush rate have been used interchangeably, in this article.</p>
</sec>
<sec id="s2">
<title>2 Research methodology</title>
<sec>
<title>2.1 Testbed specification</title>
<p>The experiment was done in an indoor aquaponics system installed at the University of Wolverhampton, England. This aquaponic testbed is of dimensions 2 m high by 1 m width and 0.5 m thick. The testbed consists of three sections of which the first shelf from the top has the growbed with clay balls. The lower shelf is used to keep the fish tank at 100 Liters capacity. The middle shelf is used to keep sensors and IoT devices (<xref ref-type="fig" rid="F2">Figure 2</xref>). The system also has an automatic fish feeder (Smart Feeder-AF-2019B) and artificial lighting (LikeSun LED Grow Light). Six Swiss chard (Beta Vulgaris var. cicla) and 6 Cold water Carp fish of 0.127 meters (5 inches) long, were used as initial growing materials. The weight of each fish was total density of the fish were 25 grams and 0.15 kg/m<sup>3</sup>, respectively The ratio between fish and plants used in this experiment was 1:1, that is the test bed contains 6 plants and 6 fish. Timers were used for water recirculation and LED lighting in a way that water was recirculated for 15 min every 30 min with a flow rate of 350 L/h maximum. The LED lighting was turned on from 6 pm to 6 am, every day. A fish feeder dispersing 12 grams of Walters Nutrimix (2 grams per fish) was used to feed the fish around 1 pm every day. The feed quantity was calculated to meet the fish feed requirement according to their biomass.</p>
<fig id="F2" position="float">
<label>Figure 2</label>
<caption><p>IoT communication system for this project. Sensor data collected is transmitted to a PC through an Arduino UNO microcontroller and is processed in a PC. Data is stored in ThingSpeak cloud and in the PC.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fsrma-03-1363914-g0002.tif"/>
</fig>
</sec>
<sec>
<title>2.2 Sensors and IoT devices</title>
<p>The main sensors used in the aquaponics system include sensors for: water temperature (DFROBOT DS18B20 digital), water pH (DFROBOT Gravity Analog-SEN0161), water turbidity (DFROBOT Analog), dissolved oxygen (DFROBOT Analog DO), total dissolved solids (DFROBOT Analog TDS), CO<sub>2</sub> (DFROBOT Infrared). These sensors were connected to the fish water tank for data collection. The sensors were attached to the Arduino UNO Microcontroller and an ESP8266 Wi-Fi module which is connected to a standard PC. The data collection, analysis, and processing were done on the local computer. All these sensors and IoT were operated on the USB power from the connected PC. Ammonium strips were used to collect the Nitrate and Nitrite values. The DO and pH sensors were calibrated at 25&#x000B0;C before use. Calibrating solutions were used according to the manufacturer&#x00027;s specifications. All sensors were from DFRobot Gravity manufacturer (<ext-link ext-link-type="uri" xlink:href="http://www.dfrobot.com">www.dfrobot.com</ext-link>). ESP 8266 module was used to send the sensor data directly to the cloud server (<ext-link ext-link-type="uri" xlink:href="http://www.thingSpeak.com">www.thingSpeak.com</ext-link>). The sensor data was also downloaded locally to the computer as a backup plan. <xref ref-type="fig" rid="F2">Figure 2</xref> shows the IoT communication setup.</p>
</sec>
<sec>
<title>2.3 Experiment process</title>
<p>The replenishment was done once every 7 days. The 7-day interval was planned to ensure that any fluctuation in water quality parameters due to precedent water replenishment has faded out and the equilibrium is reached before a new replenishment has been applied. Water replenishment was planned with 6%,10%,14%,18%, and 22% of the total volume of the fish water, which is 100 L in the current study. The selection of this replenishment range was based on the literature and consultation with aquaponics farmers, based in Ipswich (<ext-link ext-link-type="uri" xlink:href="http://www.aquapona.com">www.aquapona.com</ext-link>) and Chester (<ext-link ext-link-type="uri" xlink:href="http://www.urbanag.uk">www.urbanag.uk</ext-link>) in England. Also, preliminary experimentations with 5% replenishment showed little or no changes in the water quality. Too much water replenishment can be detrimental to the system (Bich et al., <xref ref-type="bibr" rid="B2">2020</xref>). Water quality data such as pH, DO, TAN, nitrites, nitrates, carbonate root, free chlorine, water hardness, electrical conductivity, total dissolved solids, and water temperature were collected every 7 days. Environmental parameters such as humidity, room temperature, and CO<sub>2</sub> values were also recorded. Three sets of water quality data were collected during the experimentation. In dataset 1, the water quality data was collected from the freshwater to be used for replenishment, and dataset 2 was collected from the fish water before its replenishment. Dataset 3 was collected from fish water after the replenishment was completed. Water replenishment was repeated, and data was collected once every 7 days. Fresh water was used from the same source during the entire experiment. Freshwater was pre-processed and dechlorinated to ensure safe use for the fish. <xref ref-type="fig" rid="F3">Figure 3</xref> shows images of the testbed and the data collection process.</p>
<fig id="F3" position="float">
<label>Figure 3</label>
<caption><p><bold>(A)</bold> Aquaponic testbed. <bold>(B)</bold> During data collection. <bold>(C)</bold> Sensors collecting water data.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fsrma-03-1363914-g0003.tif"/>
</fig>
</sec>
<sec>
<title>2.4 Data collection and processing</title>
<p><xref ref-type="fig" rid="F4">Figure 4</xref> is a schematic diagram of the data processing. This includes data preparation, data analysis, and data validation. Data preparation comprised data collection and outlier analysis as part of data refinement. Data normalization, correlation and regression analysis form part of the data analysis step. The results were then evaluated and compared using statistical error estimation approaches in Python.</p>
<fig id="F4" position="float">
<label>Figure 4</label>
<caption><p>Schematic diagram of data preparation, analysis, and results validation.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fsrma-03-1363914-g0004.tif"/>
</fig>
<sec>
<title>2.4.1 Data collection</title>
<p>The data collected for the optimal replenishment rate calculation was done from June 2022 to June 2023. More than 1,800 data were collected for processing, including the 11 water quality values and environmental parameters.</p>
</sec>
<sec>
<title>2.4.2 Outlier analysis</title>
<p>The z-score method was used to detect outliers of the data values and the boxplot was used to visualize the analyzed results. Boxplot analysis showed the values deemed as outliers. For example, the threshold value of turbidity was 0.3 and some outliers were detected as 5, which was far different from the normal threshold. The outlier values of 5 were replaced with a threshold value of 0.3. It identified that the wrong value of 5 has been sensed by the sensor probably due to foam in the water surface affecting the turbidity sensor reading. The same approach was used for all other parameter values to clean data before the analysis.</p>
</sec>
<sec>
<title>2.4.3 Data analysis</title>
<sec>
<title>2.4.3.1 Water quality index (WQI)</title>
<p>The optimal rate of freshwater replenishment determination requires the calculation of the water quality value of the fish tank at different levels or percentages of water replenishment. A water quality index is a significant numerical value that represents the total water quality. The water quality index (WQI) model is a well-recognized tool for water quality evaluation especially in many fields based on local water quality criteria and has been used since its development in the 1960s (Uddin et al., <xref ref-type="bibr" rid="B19">2021</xref>). WQI models generally consist of four consecutive stages: (1) selection of the water quality parameters, (2) generation of sub-indices for each parameter (3) calculation of the parameter weighting values, and (4) aggregation of sub-indices to compute the overall water quality index. The optimal water replenishment rate can then be obtained by applying the machine learning algorithms between different replenishment rates and corresponding water quality indices to generate a singular quality value that represents the overall fish water quality. The water quality index can be calculated using <xref ref-type="disp-formula" rid="E1">Equation (1)</xref> (Ahmed et al., <xref ref-type="bibr" rid="B1">2019</xref>; Srivastava and Kumar, <xref ref-type="bibr" rid="B17">2023</xref>; Water Quality Indices, <xref ref-type="bibr" rid="B20">2023</xref>).</p>
<disp-formula id="E1"><label>(1)</label><mml:math id="M1"><mml:mtable class="eqnarray" columnalign="center"><mml:mtr><mml:mtd><mml:mi>W</mml:mi><mml:mi>Q</mml:mi><mml:mi>I</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>Q</mml:mi></mml:mrow><mml:mrow><mml:mi>v</mml:mi><mml:mi>a</mml:mi><mml:mi>l</mml:mi><mml:mi>u</mml:mi><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>&#x000D7;</mml:mo><mml:mi>&#x003B2;</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>Where <italic>Q</italic><sub><italic>value</italic></sub> is the quality value corresponding to the water quality parameter and &#x003B2; is the <italic>Weighting factors</italic> of different water parameters as shown in <xref ref-type="table" rid="T2">Table 2</xref> (Ahmed et al., <xref ref-type="bibr" rid="B1">2019</xref>; Srivastava and Kumar, <xref ref-type="bibr" rid="B17">2023</xref>; Water Quality Indices, <xref ref-type="bibr" rid="B20">2023</xref>).</p>
<table-wrap position="float" id="T2">
<label>Table 2</label>
<caption><p>Parameters and weighting factors to calculate quality index.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Parameter</bold></th>
<th valign="top" align="center"><bold>Weighting factor (&#x003B2;)</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">pH</td>
<td valign="top" align="center">0.11</td>
</tr> <tr>
<td valign="top" align="left">Temperature</td>
<td valign="top" align="center">0.10</td>
</tr> <tr>
<td valign="top" align="left">Dissolved oxygen</td>
<td valign="top" align="center">0.17</td>
</tr> <tr>
<td valign="top" align="left">Turbidity</td>
<td valign="top" align="center">0.08</td>
</tr> <tr>
<td valign="top" align="left">Total ammonia and nitrates</td>
<td valign="top" align="center">0.10</td>
</tr></tbody>
</table>
</table-wrap>
<p><xref ref-type="fig" rid="F5">Figure 5</xref> shows a correlation between <italic>Q</italic><sub><italic>value</italic></sub> and parameters such as pH, Dissolved Oxygen, Total Ammonia and Nitrogen (TAN), Temperature change, and Turbidity which uses the optimal water quality parameters ranges as discussed in <xref ref-type="table" rid="T1">Table 1</xref>, and quality indices are generated according to <xref ref-type="disp-formula" rid="E1">Equation (1)</xref> (Ahmed et al., <xref ref-type="bibr" rid="B1">2019</xref>; Srivastava and Kumar, <xref ref-type="bibr" rid="B17">2023</xref>; Water Quality Indices, <xref ref-type="bibr" rid="B20">2023</xref>).</p>
<fig id="F5" position="float">
<label>Figure 5</label>
<caption><p>Graphs representing the correlation between water quality values and <bold>(A)</bold> pH, <bold>(B)</bold> Nitrate, <bold>(C)</bold> Turbidity, <bold>(D)</bold> Dissolved Oxygen, and <bold>(E)</bold> Temperature Change. Graphs represent water quality indices of these parameters within a given range. In all graphs, the X-axis gives the water parameter, and the Y-axis is the corresponding quality index.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fsrma-03-1363914-g0005.tif"/>
</fig>
</sec>
<sec>
<title>2.4.3.2 Min-Max normalization</title>
<p>Once the water quality index has been calculated for a set of data values of a particular parameter, the resulting WQIs are normalized using Min-Max normalization. This normalization approach standardizes the values using <xref ref-type="disp-formula" rid="E2">Equation (2)</xref>.</p>
<disp-formula id="E2"><label>(2)</label><mml:math id="M2"><mml:mtable class="eqnarray" columnalign="center"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>X</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi><mml:mi>c</mml:mi><mml:mi>a</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mi>X</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>X</mml:mi></mml:mrow><mml:mrow><mml:mo class="qopname">min</mml:mo></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>X</mml:mi></mml:mrow><mml:mrow><mml:mo class="qopname">max</mml:mo></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>X</mml:mi></mml:mrow><mml:mrow><mml:mo class="qopname">min</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>Where <italic>X</italic><sub><italic>scaled</italic></sub> is the normalized value, <italic>X</italic><sub>min</sub> is the minimum value in the list and <italic>X</italic><sub>max</sub> is the maximum value in the list. Min-max normalization was applied to all quality indices calculated for all water quality parameters so that all WQIs were standardized to a value between 0 and 1. That means the lowest quality index will be 0 and the highest index will be 1. For example, if the pH value read from the sensor is 4.2, then, the corresponding <italic>Q</italic><sub><italic>value</italic></sub> will be multiplied by the pH weighting factor 0.11 to get a WQI of 1.21 for the sensor read pH of 4.2. The minimum WQI and maximum WQI were determined when all WQIs were calculated. In the sample data, the minimum WQI is 0 and the maximum WQI is 10.12. Therefore, for the pH parameter,</p>
<disp-formula id="E3a"><mml:math id="M3"><mml:mtable columnalign="center"><mml:mtr><mml:mtd><mml:mi>p</mml:mi><mml:msub><mml:mrow><mml:mi>H</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi><mml:mi>c</mml:mi><mml:mi>a</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn><mml:mo>.</mml:mo><mml:mn>21</mml:mn><mml:mo>-</mml:mo><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:mn>10</mml:mn><mml:mo>.</mml:mo><mml:mn>12</mml:mn><mml:mo>-</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mn>0</mml:mn><mml:mo>.</mml:mo><mml:mn>119</mml:mn><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>which is the normalized WQI for pH 4.2. This calculation was applied to all the collected data. Finally, all the collected data were used to determine the corresponding WQI using <xref ref-type="disp-formula" rid="E1">Equation (1)</xref> and normalized using <xref ref-type="disp-formula" rid="E2">Equation (2)</xref>.</p>
</sec>
<sec>
<title>2.4.3.3 Interpolation</title>
<p>The obtained values of WQIs for different replenishment rates from 6% to 22 % were used to predict the WQIs and missing replenishment rates. That is, WQIs were measured for 6,10,14,18, and 22L multiple times, and resulting data was used to determine WQIs for 7,8,9,11,12,13,15,17,19,20, and 21L.</p>
</sec>
<sec>
<title>2.4.3.4 Correlation analysis</title>
<p>Water temperature, pH, Dissolved Oxygen, TDS, and CO<sub>2</sub> data were chosen to perform the correlation analysis using Python.</p>
</sec>
<sec>
<title>2.4.3.5 WQI calculation for replenishment rates</title>
<p>The water quality index of a particular water replenishment rate was calculated by adding up the individual WQIs of the five parameters such as Turbidity, temperature, DO, pH and TAN using <xref ref-type="disp-formula" rid="E1">Equation (1)</xref> to get an aggregate WQI out of five parameters using the <xref ref-type="disp-formula" rid="E3">Equation (3)</xref>.</p>
<disp-formula id="E3"><label>(3)</label><mml:math id="M4"><mml:mtable class="eqnarray" columnalign="center"><mml:mtr><mml:mtd><mml:mi>&#x003B1;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>T</mml:mi><mml:mi>o</mml:mi><mml:mi>t</mml:mi><mml:mi>a</mml:mi><mml:mi>l</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mi>&#x003B1;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mi>H</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003B1;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>D</mml:mi><mml:mi>O</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003B1;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>T</mml:mi><mml:mi>A</mml:mi><mml:mi>N</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003B1;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi><mml:mi>e</mml:mi><mml:mi>m</mml:mi><mml:mi>p</mml:mi><mml:mi>e</mml:mi><mml:mi>r</mml:mi><mml:mi>a</mml:mi><mml:mi>t</mml:mi><mml:mi>u</mml:mi><mml:mi>r</mml:mi><mml:mi>e</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003B1;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi><mml:mi>u</mml:mi><mml:mi>r</mml:mi><mml:mi>b</mml:mi><mml:mi>i</mml:mi><mml:mi>d</mml:mi><mml:mi>i</mml:mi><mml:mi>t</mml:mi><mml:mi>y</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where &#x003B1; is the Water Quality Index (WQI).</p>
<p>For example, when 6% of the total fish water was used, that is 6 L was replaced with 6 L of fresh water, and the parameter readings were taken before and after the replenishment, WQI of 6% was calculated using <xref ref-type="disp-formula" rid="E3">Equation (3)</xref>. The process is repeated for 10%,14% 18%, and 22%. The replenishments and WQI calculations were done every week. The impact of replenishment on the water quality parameters was analyzed before the next replenishment was done, ensuring that previous replenishment had not influenced the water quality measures.</p>
<p>The sensor data analysis showed that there was no considerable change in TDS and CO<sub>2</sub> values with respect to the water replenishment. Therefore, TDS was not considered for the WQI calculation.</p>
</sec>
</sec>
</sec>
<sec>
<title>2.5 Regression analysis</title>
<p>Three standard regression models such as polynomial regression, multiple linear regression, Ridge regression and three ensemble approaches, decision tree regression, random forest regression, and gradient boosting were chosen for regression analysis. While standard models give predictions with a single estimator, ensemble models combine mutiple estimators to perform predictions. Ensemble models were included to avoid any potential bias, low accuracy or high variance in standard models. The literature suggests that the chosen models are the best for water quality predictions (Ahmed et al., <xref ref-type="bibr" rid="B1">2019</xref>). Machine learning algorithm-based regression analysis was applied to the entire data set to find out the optimal freshwater replenishment rate that gives the best water quality index. Standard regressions such as polynomial regression, multiple linear regression, Ridge regression, and Ensemble methods such as Decision Tree regression, Random Forest regression, and Gradient boosting were selected to perform regression analysis. Linear regression shows the linear relationship between between input values and output values. Random forest is a decision-tree-based approach that uses the subset of a given data set to make decisions. Gradient boosting is an efficient optimization approach that uses a stage-wise boosting method to optimize a differentiable loss function (Ahmed et al., <xref ref-type="bibr" rid="B1">2019</xref>; Water Quality Indices, <xref ref-type="bibr" rid="B20">2023</xref>).</p>
</sec>
<sec>
<title>2.6 Algorithm design</title>
<p>Python was used to perform the regression analysis, plotting resultant graphs, and evaluation of the results. Sklearn library was used to implement the regressions in the code. A learning rate of 0.1 was used for Gradient boosting and polynomial of degree 2 was applied for polynomial regression. The algorithm received the input as a CSV file that contains quality values and percentages. First, the raw data without interpolation was input. Then the interpolated data was input to the algorithm and finally, simulated data was given as input. Regressions were applied in these three results with error estimations. Mean Square Estimations (MSE), Mean Absolute Estimation (MAE), Random mean square estimations (RMVE), and <italic>R</italic><sup>2</sup> estimations were used for validations.</p>
</sec>
</sec>
<sec id="s3">
<title>3 Result and discussion</title>
<sec>
<title>3.1 Water quality indices as function of replenishment rate</title>
<p>The Water Quality Index was generated using <xref ref-type="disp-formula" rid="E3">Equation (3)</xref> for every replenishment as described in the method section. WQI represented the quality of water for each replenishment. Data was plotted and it was decided to apply standard as well as ensemble regressions. Cubic spline as well as Lagrange interpolation and regressions were applied to the correlation between WQI, and the corresponding replenishment rate. Results were obtained based on the optimized quality for a given replenishment.</p>
</sec>
<sec>
<title>3.2 Correlation between different water quality parameters</title>
<p><xref ref-type="table" rid="T3">Table 3</xref> shows the correlation between different water quality parameters investigated. A correlation of 1 in the table shows the strongest correlation and 0 is assumed to be the weakest correlation. A positive turbidity correlation was observed between water and temperature whereas a negative correlation was observed between turbidity, DO, CO<sub>2</sub>, and pH. Temperature positively correlated with TDS and CO<sub>2</sub> while negatively correlated with DO and pH. TDS positively correlates with turbidity and temperature while negatively correlates with DO and CO<sub>2</sub>. DO negatively correlated with all other parameters CO<sub>2</sub> positively correlated with temperature and pH while negatively correlated with turbidity, TDS, and DO. pH positively correlated with TDS and CO<sub>2</sub> while negatively correlated with turbidity, temperature, and DO.</p>
<table-wrap position="float" id="T3">
<label>Table 3</label>
<caption><p>Correlation matrix of water quality parameters.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th/>
<th valign="top" align="center"><bold>Turbidity</bold></th>
<th valign="top" align="center"><bold>Temperature</bold></th>
<th valign="top" align="center"><bold>TDS</bold></th>
<th valign="top" align="center"><bold>DO</bold></th>
<th valign="top" align="center"><bold>CO<sub>2</sub></bold></th>
<th valign="top" align="center"><bold>pH</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Turbidity</td>
<td valign="top" align="center">1.000000</td>
<td valign="top" align="center">0.112173</td>
<td valign="top" align="center">0.146905</td>
<td valign="top" align="center">&#x02212;0.043757</td>
<td valign="top" align="center">&#x02212;0.091589</td>
<td valign="top" align="center">&#x02212;0.010261</td>
</tr> <tr>
<td valign="top" align="left">Temperature</td>
<td valign="top" align="center">0.112173</td>
<td valign="top" align="center">1.000000</td>
<td valign="top" align="center">0.059646</td>
<td valign="top" align="center">&#x02212;0.006122</td>
<td valign="top" align="center">0.069645</td>
<td valign="top" align="center">&#x02212;0.086606</td>
</tr> <tr>
<td valign="top" align="left">TDS</td>
<td valign="top" align="center">0.146905</td>
<td valign="top" align="center">0.059646</td>
<td valign="top" align="center">1.000000</td>
<td valign="top" align="center">&#x02212;0.213239</td>
<td valign="top" align="center">&#x02212;0.028291</td>
<td valign="top" align="center">0.127810</td>
</tr> <tr>
<td valign="top" align="left">DO</td>
<td valign="top" align="center">&#x02212;0.043757</td>
<td valign="top" align="center">&#x02212;0.006122</td>
<td valign="top" align="center">&#x02212;0.213239</td>
<td valign="top" align="center">1.000000</td>
<td valign="top" align="center">&#x02212;0.144879</td>
<td valign="top" align="center">&#x02212;0.087965</td>
</tr> <tr>
<td valign="top" align="left">CO<sub>2</sub></td>
<td valign="top" align="center">&#x02212;0.091589</td>
<td valign="top" align="center">0.069645</td>
<td valign="top" align="center">&#x02212;0.028291</td>
<td valign="top" align="center">&#x02212;0.144879</td>
<td valign="top" align="center">1.000000</td>
<td valign="top" align="center">0.064920</td>
</tr> <tr>
<td valign="top" align="left">pH</td>
<td valign="top" align="center">&#x02212;0.010261</td>
<td valign="top" align="center">&#x02212;0.086606</td>
<td valign="top" align="center">0.127810</td>
<td valign="top" align="center">&#x02212;0.087965</td>
<td valign="top" align="center">0.064920</td>
<td valign="top" align="center">1.000000</td>
</tr></tbody>
</table>
</table-wrap>
</sec>
<sec>
<title>3.3 Algorithm design for interpolation</title>
<p><xref ref-type="fig" rid="F6">Figure 6</xref> shows the interpolation results with the raw data, means values, Cubic spline and Lagrange interpolation curves, simulated data, and the correlation between variance in quality values with percentage of water replenishment. These results were obtained from data that were sorted according to the percentage values. Then the means and variances were calculated for quality parameter values (Sallenave, <xref ref-type="bibr" rid="B15">2022</xref>) before applying the interpolation between 0 and 23 values since the data ranges from 5 to 22. The interpolation intervals were set as 1 and 10 simulated quality values were generated for each percentage value from 5 to 22. The algorithm generated the sorted simulated data for the corresponding raw. Both interpolations showed that the variance in quality tends to decline as the percentage of replenishment values increases.</p>
<fig id="F6" position="float">
<label>Figure 6</label>
<caption><p>Water quality as a function of percentage of water replenishment. <bold>(A)</bold> Cubic spline and Lagrange interpolation were applied to Raw and Simulated data. <bold>(B)</bold> Variance declines for both interpolations. Interpolation details and data chosen are also shown inside the graphs.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fsrma-03-1363914-g0006.tif"/>
</fig>
</sec>
<sec>
<title>3.4 Determination of the optimal water replenishment rates</title>
<p><xref ref-type="fig" rid="F7">Figure 7</xref> shows a plot of various regressions applied to the data. Ahmed et al. (<xref ref-type="bibr" rid="B1">2019</xref>) used various regression models to find out water quality indices and Gradient Boost with a learning rate of 0.1 and polynomial regression with a degree of two appeared to be the best machine learning approaches to predict the water quality indices (WQIs). In this research data, regressions performed on raw data showed polynomial regression as the model that gives the best water quality of 4.91 with an optimal water replenishment of 18 liters per week per 100 L aquaponics system. The error estimations were 0.0181 (MSE), 0.1061 (MAE) 0.1346 (RMSE), and 0.6589 (<italic>R</italic><sup>2</sup> score). When the interpolated data values were given as input, again Polynomial Regression appeared as the best model with the same water quality of 4.91 and optimal water replenishment value of 18 L. The error scores were 0.0109 (MSE), 0.07213 (MAE), 0.1046 (RMSE), and 0.7175 (<italic>R</italic><sup>2</sup>). However, when the simulated data was applied, results showed 19 L as the optimal water replenishment per week. percentage with the best quality of 4.86. Error scores for simulated data were 0.0224 (MSE), 0.1137 (MAE) 0.1499 (RMSE), and 0.7208 (<italic>R</italic><sup>2</sup>). It was evident that the gradient boost regression model generated better results. <xref ref-type="table" rid="T4">Table 4</xref> shows the best water quality and water replenishment percentage values and the corresponding error estimates. <italic>R</italic><sup>2</sup>value close to 1 generally shows a better fit of the model to the data. The <italic>R</italic><sup>2</sup> value from the regression using raw data was 0.6589 which can be inferred as around 65.89% variability observed in the water quality explained by the model <italic>R</italic><sup>2</sup>value for the interpolated data, 0.7175 shows a better fit for the model with 71.75% variability on the replenishment rate. When simulated data is used, a value of 0.7271 was resulted which shows the best fit among all <italic>R</italic><sup>2</sup>values received.</p>
<fig id="F7" position="float">
<label>Figure 7</label>
<caption><p>Resultant graph plots of all regressions on <bold>(A)</bold> raw data <bold>(B)</bold> interpolated data and <bold>(C)</bold> simulated data. In all graphs, the x-axis shows the percentage of replenishment, and y-axis has the corresponding water quality. Names of the regressions applied are shown inside the graphs.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fsrma-03-1363914-g0007.tif"/>
</fig>
<table-wrap position="float" id="T4">
<label>Table 4</label>
<caption><p>Regression results with error estimations.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Data used</bold></th>
<th valign="top" align="left"><bold>Best regression</bold></th>
<th valign="top" align="center"><bold>Best quality</bold></th>
<th valign="top" align="center"><bold>Optimal percentage</bold></th>
<th valign="top" align="center"><bold>MSE</bold></th>
<th valign="top" align="center"><bold>MAE</bold></th>
<th valign="top" align="center"><bold>RMSE</bold></th>
<th valign="top" align="center"><bold>R squared</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Raw data</td>
<td valign="top" align="left">Polynomial regression</td>
<td valign="top" align="center">4.91</td>
<td valign="top" align="center">18</td>
<td valign="top" align="center">0.0181</td>
<td valign="top" align="center">0.1061</td>
<td valign="top" align="center">0.1346</td>
<td valign="top" align="center">0.6589</td>
</tr> <tr>
<td valign="top" align="left">Interpolated data</td>
<td valign="top" align="left">Polynomial regression</td>
<td valign="top" align="center">4.91</td>
<td valign="top" align="center">18</td>
<td valign="top" align="center">0.0109</td>
<td valign="top" align="center">0.07213</td>
<td valign="top" align="center">0.1046</td>
<td valign="top" align="center">0.7175</td>
</tr> <tr>
<td valign="top" align="left">Simulated data</td>
<td valign="top" align="left">Gradient boost</td>
<td valign="top" align="center">4.86</td>
<td valign="top" align="center">19</td>
<td valign="top" align="center">0.0224</td>
<td valign="top" align="center">0.1137</td>
<td valign="top" align="center">0.1499</td>
<td valign="top" align="center">0.7208</td>
</tr></tbody>
</table>
</table-wrap>
<p>Results showed that when the raw data, that is the data received from the experimentation directly as well as the interpolated data were used, 18 L was the optimal replenishment rate for a 100 L fish tank with the best water quality of 4.91 obtained from a polynomial regression as the best model. However, when simulation was performed and regression applied to simulated data, the optimal rate changed to 19 L with a best quality of 4.86. The result with simulated data is assumed to be more precise since more data points were generated and hence precision of the result is improved. Nevertheless, the values of the replenishment rate obtained from both models are very close with a difference of 1 L/100 L system which only corresponds to 1% and a 1% error is reasonably acceptable. It should be noted that the results showed exact integer values of replenishment rates such as 18 or 19 because the algorithm was designed to perform with an interval of 1 in the x-axis values, which represents the replenishment rates. This decision was made as variations of less than a percentage point would not have an impact on the water quality maintenance. Moreover, During the experimentation, the change in water quality parameter values was recorded before and after every replenishment and the change <italic>x</italic> was non-linear. That is, <italic>x</italic> and corresponding WQIs have shown different values for the same replenishment rate which was repeated. Hence, it was decided to use machine learning to find out the optimal replenishment rate.</p>
</sec>
<sec>
<title>3.5 Limitation and sensitivity of the research</title>
<p>The data and results could be influenced by the number and types of fish and plants grown as well as the environmental conditions. The type of aquaponics used could be another influencing factor in optimal replenishment rate calculation. This project is carried out in a standard indoor coupled aquaponics system within a controlled environment. The results discussed above were generated with the data collected from a specific aquaponics system as described in the method section. However, the outcome of this research may open a new avenue for potential research aspects in aquaponics water replenishment and could inform water quality optimisation of aquaponics systems at an industrial scale. The replenishment rate calculated in the project was sensitive to the aquaponics tank capacity used. This project used a 100 L water tank and optimal rate, and water quality was calculated accordingly. The experimentation was carried out inside a closed room where artificial lighting was provided. Results may have an impact on the room environment, especially when environmental parameters such as humidity, room temperature, and carbon dioxide levels are used in correlation analysis for the water quality index calculation. Artificial light operation timing, water recirculation timing, feed timing, and feed quantity may influence the results obtained. The formula to calculate the water quality index was adapted from a study that computed the water quality index of river water. This might be an influencing factor on the results.</p>
</sec>
</sec>
<sec id="s4">
<title>4 Conclusion and future work</title>
<p>Water quality data of indoor recirculated aquaponics have been collected by sensors and IoT devices. Important water quality parameters were then chosen to estimate the water quality indices corresponding to various rates of water replenishment. Various regression algorithms were applied to determine the optimal replenishment rate that gives the best water quality index as well as the best regression model that was validated using the error estimations for raw data, interpolated data, and simulated data sets. Both polynomial regression and gradient boost models look promising for estimating the optimal replenishment rate and water quality of an aquaponics system. The present study showed an optimal water replenishment value of 18% per week with the best water quality of 4.9 when using raw data and interpolated data whereas the gradient boost model generated an optimal replenishment rate of 19% with the best quality of 4.86 using simulated data. The difference between the simulated and the experimental data is only 1%. Therefore, this paper proposes an innovative way of estimating the optimal replenishment rate and water quality index of aquaponic water using sensors, IoT, and machine learning, avoiding time-consuming laboratory water analysis. Additionally, no chemicals were used to stabilize the pH levels other than adding water to the tank which is an improvement to the conventional approach.</p>
<p>This research could be further expanded by applying the same approach to other types of aquaponics systems including semi-closed, decoupled, or outdoor systems, with different environmental and water conditions to investigate any variability in the optimal water replenishment and their impact on aquaponic water quality and to further validate the proposed method. Different machine learning or deep learning approaches can be applied other than what have been used in this project, to find out if the results are affected. Studies on fish and plant health before and after water replenishment may be further explored.</p>
</sec>
<sec sec-type="data-availability" id="s5">
<title>Data availability statement</title>
<p>The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.</p>
</sec>
<sec sec-type="ethics-statement" id="s6">
<title>Ethics statement</title>
<p>The animal study was approved by Faculty of Science and Engineering Ethics Committee, University of Wolverhampton. The study was conducted in accordance with the local legislation and institutional requirements.</p>
</sec>
<sec sec-type="author-contributions" id="s7">
<title>Author contributions</title>
<p>PC: Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Resources, Software, Visualization, Writing&#x02014;original draft. AG: Supervision, Validation, Writing&#x02014;review &#x00026; editing. FT-M: Funding acquisition, Investigation, Project administration, Supervision, Validation, Writing&#x02014;review &#x00026; editing.</p>
</sec>
</body>
<back>
<sec sec-type="funding-information" id="s8">
<title>Funding</title>
<p>The author(s) declare financial support was received for the research, authorship, and/or publication of this article. This project has been partially internally funded by the School of Engineering, Computing, and Mathematical Sciences at the University of Wolverhampton and supported by the EU Horizon 2020 MSCA RISE Project ReACTIVE Too, Grant Agreement No 871163.</p>
</sec>
<sec sec-type="COI-statement" id="conf1">
<title>Conflict of interest</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec sec-type="disclaimer" id="s9">
<title>Publisher&#x00027;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ahmed</surname> <given-names>U.</given-names></name> <name><surname>Mumtaz</surname> <given-names>R.</given-names></name> <name><surname>Anwar</surname> <given-names>H.</given-names></name> <name><surname>Shah</surname> <given-names>A. A.</given-names></name> <name><surname>Irfan</surname> <given-names>R.</given-names></name> <name><surname>Garc&#x000ED;a-Nieto</surname> <given-names>J.</given-names></name></person-group> (<year>2019</year>). <article-title>Efficient water quality prediction using supervised machine learning</article-title>. <source>Water</source> <volume>11</volume>:<fpage>2210</fpage>. <pub-id pub-id-type="doi">10.3390/w11112210</pub-id></citation>
</ref>
<ref id="B2">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bich</surname> <given-names>T. T. N.</given-names></name> <name><surname>Tri</surname> <given-names>D. Q.</given-names></name> <name><surname>Yi-Ching</surname> <given-names>C.</given-names></name> <name><surname>Khoa</surname> <given-names>H. D.</given-names></name></person-group> (<year>2020</year>). <article-title>Productivity and economic viability of snakehead Channa striata culture using an aquaponics approach</article-title>. <source>Aquac. Eng</source>. <volume>89</volume>:<fpage>2020</fpage>. <pub-id pub-id-type="doi">10.1016/j.aquaeng.2020.102057</pub-id></citation>
</ref>
<ref id="B3">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Blanchard</surname> <given-names>C.</given-names></name> <name><surname>Wells</surname> <given-names>D. E.</given-names></name> <name><surname>Pickens</surname> <given-names>J. M.</given-names></name> <name><surname>Blersch</surname> <given-names>D. M.</given-names></name></person-group> (<year>2020</year>). <article-title>Effect of pH on cucumber growth and nutrient availability in a decoupled aquaponic system with minimal solids removal</article-title>. <source>Horticulturae</source> <volume>6</volume>:<fpage>10</fpage>. <pub-id pub-id-type="doi">10.3390/horticulturae6010010</pub-id></citation>
</ref>
<ref id="B4">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Delaide</surname> <given-names>B.</given-names></name> <name><surname>Delhaye</surname> <given-names>G.</given-names></name> <name><surname>Dermience</surname> <given-names>M.</given-names></name> <name><surname>Gott</surname> <given-names>J.</given-names></name> <name><surname>Soyeurt</surname> <given-names>H.</given-names></name> <name><surname>Jijakli</surname> <given-names>M. H.</given-names></name></person-group> (<year>2017</year>). <article-title>Plant and fish production performance, nutrient mass balances, energy and water use of the PAFF Box, a small-scale aquaponic system</article-title>. <source>Aquac. Eng</source>. <volume>78</volume>, <fpage>130</fpage>&#x02013;<lpage>139</lpage>. <pub-id pub-id-type="doi">10.1016/j.aquaeng.2017.06.002</pub-id></citation>
</ref>
<ref id="B5">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>Ebeling</surname> <given-names>J. M.</given-names></name> <name><surname>Timmons</surname> <given-names>M. B.</given-names></name></person-group> (<year>2007</year>). <source>Recirculating Aquaculture Systems</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="https://www.sidalc.net/search/Record/KOHA-OAI-UAAAN:31728/Description">https://www.sidalc.net/search/Record/KOHA-OAI-UAAAN:31728/Description</ext-link></citation>
</ref>
<ref id="B6">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Gnanasagar</surname> <given-names>V.</given-names></name> <name><surname>Vivek</surname> <given-names>M.</given-names></name> <name><surname>Rajaraman</surname> <given-names>J.</given-names></name></person-group> (<year>2020</year>). <article-title>Study on control actions in a recirculating aquaponics system</article-title>. <source>AIP Conf. Proc</source>. <volume>2240</volume>:<fpage>100002</fpage>. <pub-id pub-id-type="doi">10.1063/5.0011022</pub-id></citation>
</ref>
<ref id="B7">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Goddek</surname> <given-names>S.</given-names></name> <name><surname>Joyce</surname> <given-names>A.</given-names></name> <name><surname>Kotzen</surname> <given-names>B. M. G.</given-names></name></person-group> (<year>2019</year>). <article-title>Aquaponics food production systems</article-title>, in <source>Aquaponics Food Production Systems</source>, 619, 2019.</citation>
</ref>
<ref id="B8">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Graber</surname> <given-names>A.</given-names></name> <name><surname>Junge</surname> <given-names>R.</given-names></name></person-group> (<year>2009</year>). <article-title>Aquaponic systems: nutrient recycling from fish wastewater by vegetable production</article-title>. <source>Desalination</source> <volume>246</volume>, <fpage>147</fpage>&#x02013;<lpage>156</lpage>. <pub-id pub-id-type="doi">10.1016/j.desal.2008.03.048</pub-id></citation>
</ref>
<ref id="B9">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Love</surname> <given-names>D. C.</given-names></name> <name><surname>Uhl</surname> <given-names>M. S.</given-names></name> <name><surname>Genello</surname> <given-names>L.</given-names></name></person-group> (<year>2015</year>). <article-title>Energy and water use of a small-scale raft aquaponics system in Baltimore, Maryland, United States</article-title>. <source>Aquac Eng</source>. <volume>68</volume>, <fpage>19</fpage>&#x02013;<lpage>27</lpage>. <pub-id pub-id-type="doi">10.1016/j.aquaeng.2015.07.003</pub-id></citation>
</ref>
<ref id="B10">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Mori</surname> <given-names>J.</given-names></name> <name><surname>Erickson</surname> <given-names>K.</given-names></name> <name><surname>Smith</surname> <given-names>R. L.</given-names></name></person-group> (<year>2021</year>). <article-title>Predictive modeling of pH in an aquaponics system using Bayesian and non-Bayesian linear regression to inform system maintenance</article-title>. <source>ACS Agricult. Sci. Technol.</source> <volume>1</volume>, <fpage>400</fpage>&#x02013;<lpage>406</lpage>. <pub-id pub-id-type="doi">10.1021/acsagscitech.1c00112</pub-id></citation>
</ref>
<ref id="B11">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Nhan</surname> <given-names>H. T.</given-names></name> <name><surname>Tai</surname> <given-names>N. T.</given-names></name> <name><surname>Liem</surname> <given-names>P. T.</given-names></name> <name><surname>Ut</surname> <given-names>V. N.</given-names></name> <name><surname>Ako</surname> <given-names>H.</given-names></name></person-group> (<year>2019</year>). <article-title>Effects of different stocking densities on growth performance of Asian swamp eel Monopterus albus, water quality and plant growth of watercress Nasturtium officinale in an aquaponic recirculating system</article-title>. <source>Aquaculture</source> <volume>503</volume>, <fpage>96</fpage>&#x02013;<lpage>104</lpage>. <pub-id pub-id-type="doi">10.1016/j.aquaculture.2018.12.067</pub-id></citation>
</ref>
<ref id="B12">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>Rakocy</surname> <given-names>J. E.</given-names></name> <name><surname>Bailey</surname> <given-names>D. S.</given-names></name> <name><surname>Shultz</surname> <given-names>R. C.</given-names></name> <name><surname>Thoman</surname> <given-names>E. S.</given-names></name></person-group> (<year>2004</year>). <source>Update On Tilapia And Vegetable Production In The Uvi Aquaponic System</source>. <publisher-name>College of Agriculture, Life and Environmental Sciences</publisher-name>. Available online at: <ext-link ext-link-type="uri" xlink:href="https://ag.arizona.edu/">https://ag.arizona.edu/</ext-link></citation>
</ref>
<ref id="B13">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>Rakocy</surname> <given-names>J. E.</given-names></name> <name><surname>Masser</surname> <given-names>M. P.</given-names></name> <name><surname>Losordo</surname> <given-names>T. M.</given-names></name></person-group> (<year>2022</year>). <source>Recirculating Aquaculture Tank Production Systems: Aquaponics-Integrating Fish and Plant Culture</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="http://osufacts.okstate.edu">http://osufacts.okstate.edu</ext-link> (accessed April 3, 2022).</citation></ref>
<ref id="B14">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Romano</surname> <given-names>N.</given-names></name> <name><surname>Islam</surname> <given-names>S.</given-names></name> <name><surname>Fischer</surname> <given-names>H.</given-names></name></person-group> (<year>2023</year>). <article-title>Ebb and flow versus constant water level on the sweet banana chili pepper (<italic>Capsicum annuum</italic>) production in an aquaponic system</article-title>. <source>Aquac. Eng</source>. <volume>102</volume>:<fpage>102340</fpage>. <pub-id pub-id-type="doi">10.1016/j.aquaeng.2023.102340</pub-id></citation>
</ref>
<ref id="B15">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>Sallenave</surname> <given-names>R.</given-names></name></person-group> (<year>2022</year>). <source>NMSU: Important Water Quality Parameters in Aquaponics Systems</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="https://aces.nmsu.edu/pubs/_circulars/CR680/welcome.html">https://aces.nmsu.edu/pubs/_circulars/CR680/welcome.html</ext-link> (accessed March 22, 2022).</citation>
</ref>
<ref id="B16">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Shaw</surname> <given-names>C.</given-names></name> <name><surname>Knopf</surname> <given-names>K.</given-names></name> <name><surname>Kloas</surname> <given-names>W.</given-names></name></person-group> (<year>2022</year>). <article-title>Fish feeds in aquaponics and beyond: a novel concept to evaluate protein sources in diets for circular multitrophic food production systems</article-title>. <source>Sustainability</source> <volume>14</volume>:<fpage>4064</fpage>. <pub-id pub-id-type="doi">10.3390/su14074064</pub-id></citation>
</ref>
<ref id="B17">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>Srivastava</surname> <given-names>G.</given-names></name> <name><surname>Kumar</surname> <given-names>P.</given-names></name></person-group> (<year>2023</year>). <article-title>Water quality index with missing parameters</article-title>, in <source>IJRET</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="http://www.ijret.org">http://www.ijret.org</ext-link> (accessed June 12, 2023).</citation>
</ref>
<ref id="B18">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Suhl</surname> <given-names>J.</given-names></name> <name><surname>Dannehl</surname> <given-names>D.</given-names></name> <name><surname>Kloas</surname> <given-names>W.</given-names></name> <name><surname>Baganz</surname> <given-names>D.</given-names></name> <name><surname>Jabs</surname> <given-names>S.</given-names></name> <name><surname>Scheibe</surname> <given-names>G.</given-names></name> <etal/></person-group>. (<year>2016</year>). <article-title>Advanced aquaponics: evaluation of intensive tomato production in aquaponics vs. conventional hydroponics</article-title>. <source>Agric. Water Manag</source>. <volume>178</volume>, <fpage>335</fpage>&#x02013;<lpage>344</lpage>. <pub-id pub-id-type="doi">10.1016/j.agwat.2016.10.013</pub-id></citation>
</ref>
<ref id="B19">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Uddin</surname> <given-names>M. G.</given-names></name> <name><surname>Nash</surname> <given-names>S.</given-names></name> <name><surname>Olbert</surname> <given-names>A. I.</given-names></name></person-group> (<year>2021</year>). <article-title>A review of water quality index models and their use for assessing surface water quality</article-title>. <source>Ecol. Indic</source> <volume>122</volume>:<fpage>107218</fpage>. <pub-id pub-id-type="doi">10.1016/j.ecolind.2020.107218</pub-id></citation>
</ref>
<ref id="B20">
<citation citation-type="web"><person-group person-group-type="author"><collab>Water Quality Indices</collab></person-group> (<year>2023</year>). Available online at: <ext-link ext-link-type="uri" xlink:href="https://www.researchgate.net/publication/257650627_Water_Quality_Indices&#x00023;fullTextFileContent">https://www.researchgate.net/publication/257650627_Water_Quality_Indices&#x00023;fullTextFileContent</ext-link> (accessed June 12, 2023).</citation>
</ref>
</ref-list>
</back>
</article>