An Intelligent-IoT-Based Data Analytics for Freshwater Recirculating Aquaculture System

Implementing innovative farming practices becomes imperative for a country whose economy relies heavily on agricultural products. Over recent years, the swift process of urbanization and the depletion of forests have influenced farmers. Due to the lack of rainwater harvesting and changing weather patterns, many crop failure cases have been registered in the last few years. To prevent loss of annual crop production, many researchers propose the technology-driven smart farming method. Smart agriculture involves utilizing technology to create a controlled environment for the management of the crops. Smart farming increases crop production and provides small farmers with an alternative income source. The government initiated many pilot projects to promote smart agriculture in India. Yet, the absence of technological assistance and skilled procedures poses a challenge for most farmers aiming to thrive in this industry. This paper introduces a smart freshwater recirculating aquaculture system based on IoT technology. The proposed system has integrated sensors and actuators. The sensor system monitors the water parameters, and actuators maintain the aquaculture environment. An intelligent data analytics algorithm played a significant role in monitoring and maintaining the freshwater aquaculture environment. The analytics derived the relationship between the water parameters and identified the relative change. From the experimental evaluation, we have identified that the M5 model tree algorithm has the highest accuracy for monitoring the relative change in water parameters.

An Intelligent-IoT-Based Data Analytics for Freshwater Recirculating Aquaculture System Munesh Singh , Senior Member, IEEE, Kshira Sagar Sahoo , Senior Member, IEEE, and Amir H. Gandomi , Senior Member, IEEE However, smart farming is still tricky for many unskilled farmers [3].In India, 70% population directly or indirectly depends on agriculture.Indian agriculture has a significant contribution to the Indian economy [3].Over the past few years, the changing weather patterns and global warming have significantly impacted annual crop production [2].A substantial number of farmers are affected by the loss of annual crop production.To cut short their loss and provide an alternative source of income, the Indian government initiated many pilot projects to promote integrated aquaculture-based farming.India has 2.36 million hectares of ponds and tanks, which offers immense opportunities for aquaculture.Aquaculture is the mean of livelihood for 28 million people in India.Unlike other aquaculture, freshwater pearl cultivation is the most profitable business in current scenarios.In 2020, India imported 1.59 trillion rupees worth of pearls, precious and semi-precious stones.To make India self-reliant on pearl production, the Indian government supports the farmers through subsidies and free training programs.Despite government efforts, the annual pearl production has not made significant progress.The lack of technological intervention and skill-oriented manual operation is the primary cause of poor production.In India, freshwater aquaculture-based farming is still operated manually.Aquaculture farming is very new to most farmers in India.This article presents a smart IoT-based freshwater recirculating aquaculture system.The proposed system smartly manages the optimal requirement for aquaculture.The system has three significant designs: 1) physical; 2) network; and 3) logical.In physical configuration, we have edge devices integrated with sensors and actuators.The sensors monitor the water parameters, and actuators control the habitable aquaculture environment.The communication network between the physical devices manages data and control flow.The network design has an integrated network between the edge, fog, and gateway devices.The gateway operates the virtual private network (VPN) servers for secure communication in the public network.At the same time, the network between the edge node and fog node communicates using a socket.In logical design, we have an abstract representation of entities and processes.The logical design included a front-end data visualization and interactive control utility provided through the Danjgo Web framework.At the back-end, we have a relational database for managing the data.A data analytics algorithm utilizes the relational data for forecasting the change in the water parameters and control for the actuators.The whole operation for monitoring and management is scheduled through a real-time clock (RTC).The model selected for data analytics is a nonlinear decision tree-based model random forest (RF), M5 Model tree, and gradient boosting machine (GBM).
The proposed system has the following main contribution.1) An intelligent-IoT-driven monitoring and management of freshwater pearl farming.2) An inexpensive regent replacement-based sensor system designed for ammonia testing.3) A relational data analytics to forecast problem, sensor fault detection, and inexpensive monitoring and management.The remainder of this article is organized as follows.Section II presents the related work.Section III presents the baseline data.Section IV presents the components of the proposed IoT system for aquaculture management and presents the aquaculture management using data analytics.Section V presents the experiments and results.Finally, Section VI presents the conclusion.

II. RELATED WORK
The rapid expansion of the IoT brought ubiquitous networked devices and sensors integration in a variety of intelligent applications [4], [5].The generated data from these devices requires computational intelligence to extract the knowledge from the data [6].We have identified a few research works centered around water quality monitoring in the literature review.Most research works focus on water quality monitoring rather than system affordability.It is worth noting that the adoption of technology-driven control farming remains costly for many farmers.Using relational data analytics techniques, researchers forecast the change in water parameters relative to some know parameters.This technique keeps the system in a stable state with minimal hardware requirements.
Gao et al. [7] proposed an intelligent-IoT-based control and traceability system to forecast and maintain water quality for freshwater fish farming.The whole system is divided into two modules, i.e., an intelligent module and tracking module.The intelligent management module includes the integrated sensor assembly [pH, water, temperature, dissolved oxygen (DO), and turbidity], data acquisition, data analysis, and database management.The tracking module includes the data visualization, chart, and data presentations.The intelligent module processes the fish pond monitoring data and forecasts the change in the water parameters.The alterations in water parameters empower farmers with the ability to oversee and manually regulate conditions using actuators.The system suggested by Gao et al. [7] manages water quality factors and offers farmers visual depictions to facilitate manual intervention.
Zhu et al. [8] introduced a wireless network to oversee the water quality in fish cultivation.Their proposed method employs ANN to conduct a predictive analysis of water quality.The intelligent module of the system employs key variables like water temperature, pH, and salinity as benchmarks to predict the forthcoming patterns in dissolved oxygen levels.
Zhu et al. [8] system tackles the measurement and control of water parameters.
Simbeye et al. [9] developed a wireless sensor network (WSN)-based mechanism for monitoring aquaculture.The collected water quality information from the sensors is transmitted to a nearby server through a gateway.Afterwards, the data is displayed through a graphical user interface (GUI) via a local server.The primary focus of the study was on enhancing aquaculture management, optimizing power usage, and improving network efficiency.Simbeye et al. [9] devised the approach to oversee aquaculture within the confines of a personal area network.
Dabrowski et al. [10] proposed a machine-learning approach to predict the DO using pH and water temperature.The data collected from the aquaculture prawn ponds was used for this study.Dabrowski et al. [10] analyzed the accuracy of DO prediction using long short-term memory (LSTM), linear regression (LR), ANN, and LDs.The experimental results show that the LSTM algorithm produces the optimum results with minimum normalized root mean-squared error (NRMSE).Dabrowski et al. [10] research show the accuracy of the machine learning approach for water quality forecast.
Chen et al. [11] introduced a system equipped with water quality sensors.The sensor captures data from a fish pond and forwards it via zigbee to a microcontroller.The processed data is sent to a terminal device through a wirless interface.This terminal device empowers the user to monitor the agricultural.A graphical user interface (GUI) enables the data visualization.Chen et al. [11] provided a comprehensive description of a system that functions within a confined network.Mahfuz et al. [12] introduced an aquaculture monitoring system driven by a smart microcontroller.A user-friendly mobile application is employed to display the sensor-acquired data.The system is linked to a solar power setup to ensure continuous power supply.Any alteration in water parameters prompts notifications in the form of straightforward text messages.The suggested system required a manual intervention to manage the aquaculture.
Vernandhes et al. [13] presented aquaponics monitoring system that utilizes the Internet of Things (IoT) paradigm.The application interface provides an end user remote access to individual physical components of the system.The proposed system consists of sensors, actuator, relay, Ethernet, and router.The aquaphonic system integrated actuators and sensor maintain the control environment for better growth of the plant.The proposed system in future plan to extend for indoor farming of other crops The work in [14] used the multivariate LR and ANN to forecast the DO relative to pH, water temperature, and electrical conductivity (EC).Similar work extends in [10] and shows the comparative performance of ANN and LR with support vector machine (SVM).All the competing models have shown a significant accurate forecast of DO.However, these model accuracy of forecast relies on short interval high amount of historical data.Currently, we have identified various ANN models, such as LSTM and deep belief networks  [32] that are considered to be an appropriate to solve the forecast problem [15], [16].
Recently, certain studies have explored comprehensive water quality monitoring and management systems utilizing cultural knowledge models and forecasting models [17], [18], [19], [20], [21], [22], [24], [26].Nevertheless, these systems did not specifically target the current requirement for developing a fully automated aquaculture setup.Moreover, their setups failed to attain the intended real-time data exchange and control, thereby affecting both water quality and aquaculture production.
This paper introduces an Internet of Things (IoT) system that effectively manages freshwater aquaculture.The system is developed for freshwater pearls aquaculture, which considers the distinct water quality and management prerequisites.The proposed system can also dynamically accommodate the needs of other freshwater culture breeds.

III. BASELINE DATA
We have collected the baseline data from the Central Institute of Freshwater Aquaculture Bhubaneswar (CIFA Bhubaneswar) [32].Table I illustrates the Optimal water conditions for pearl farming aquaculture.In an aquaculture, the primary focus should be monitoring the alkalinity and hardness of water parameters.The regional water bodies in different states have different alkalinity and hardness.Alkalinity is the indicator of resistance to acidification.Water bodies that have good alkalinity can prevent the sudden change in pH.Alkalinity indicates acid resistance, with higher alkalinity in water bodies helping prevent abrupt pH fluctuations.The connection between alkalinity and hardness is noteworthy, as total hardness is linked to calcium and divalent magnesium ions.The optimal water conditions for pearl farming recommends an alkalinity level of 100 PPM and a hardness level of 60 PPM.Research has shown that hard water proves more advantageous for productivity than soft water, although soft water is more conducive to the enhanced production of freshwater mussels.Alkalinity, a variable influenced by time, correlates with pH and temperature.Mornings typically see elevated pH levels along with moderate to high alkalinity.The intricate interplay between temperature and various biological and chemical reactions is evident, as warmer water hampers the solubility of atmospheric dissolved oxygen.Mussels inhabiting warmer waters necessitate a more excellent supply of dissolved oxygen.Likewise, DO is important in assessing water quality.Adequate oxygen levels are imperative for the well-being of pearl-farming mussels within the aquatic environment.However, in stagnant water, the diffusion of atmospheric oxygen is notably lower.To address this, we employ an oxygen pump and agitation to directly infuse atmospheric air into the water, augmenting the essential DO levels.photosynthetic activity in aquatic plants constitutes another source of dissolved oxygen.In the context of pearl farming, mussels feed on plankton.The presence of uneaten plankton further influences the habitable under water conditions.During daylight hours, these algae consume CO and release Oxygen.Consequently, DO levels experience an increase during the day, followed by a decrease at night and on heavily cloudy days.During nighttime hours and mainly overcast days, algae consume oxygen for respiration.Consequently, an abundance of algae growth leads to an elevation in the biological oxygen demand (BOD).The BOD is increased by mixing the ample nutrients in the pond.It also has a relation to time and temperature.During the night, the plankton algae consume the DO rapidly.The plankton density has a relation with DO and pH.However, the pH also has a relation to total alkalinity.The fluctuations in pH are less common in higher alkalinity.Similarly, carbon dioxide also has an ill impact on mussels.The higher concentration of carbon dioxide fluctuates the pH.However, the rate of change in pH is relatively less at higher total alkalinity.Carbon dioxide (CO2) concentration increases due to lack of photosynthesis and die-off of phytoplankton.There is a significant need to monitor the pond's DO concentration to minimize the impact of carbon dioxide.Similarly, ammonia concentration is highly lethal for aquatic animals.Ammonia has a relation with DO, pH, and carbon dioxide.The ammonia increases, often decreasing the DO and increasing CO2.Ammonia toxicity is more pronounced at elevated pH levels.The primary sources of ammonia are the excretions of aquatic animals and the decomposition of organic matter.Maintaining control over ammonia levels is of utmost importance for optimal growth.Table II summarizes some of the recent available literature on the topic.Although some intelligent aquaculture systems have been proposed in the literature, more work needs to be done to integrate the factors that accurately determine the water quality, fault behavior analysis, optimal schedule for feeding, and fault-tolerant monitoring and management.Moreover, the existing systems cannot analyze and interpret real-time data rather monitor through some Web application.Still, much work needs to address for real-time control of the system parameters and intelligent data analytics integration at the edge devices or fog devices.As a result, the gap addressed in this article is relevant to the study.

IV. COMPONENT OF PROPOSED IOT SYSTEM
FOR AQUACULTURE MANAGEMENT This section introduces the proposed smart IoT-based system for managing the aquaculture.The comprehensive system is organized into four distinct phases of development: 1) physical design; 2) network design; 3) logical design; 4) intelligent forecasting models.Fig. 1 illustrates the conceptual layout of a smart aquaculture system based on IoT.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

A. Physical Design
The physical layer is responsible for collecting the data from the sensors.System-integrated sensors gather the water quality parameters, and actuators manage the water quality parameters.The sensing nodes in the proposed system are integrated with analogue base DO, pH, Electric conductivity (EC), RTC Fig. 2. Edge node integrated sensors and actuators (adapted from [32]).timer, and temperature sensors, as shown in Fig. 2.These sensor assemblies are kept outside the aquaculture tanks, as shown in Fig. 3. To accurately measure the change from the sensor data, we have integrated the edge node with ADS1115 16bit precision analog-to-digital converter (ADC) [26].Through the I2C interface, ADS1115 ADC communicates the sensor data to the edge node.The 1-wire DS18B20 temperature sensor directly interfaces with the edge node.For edge computation and networking, we have selected the Beagle-bone Black.The Beagle-bone black has a variety of general-purpose input-output ports, which allows interaction with various communication interface protocols.The onboard 4-GB internal flash memory provides sufficient space to organize the data in the relational data model.The board has a 1-GHz ARM cortex processor, consuming less power and providing adequate processing capability.We have employed actuators such as aerator, submersible pumps, bio-filters, heaters, and valves to maintain a habitable aquaculture environment.The direct current (DC) operated actuators are connected through the L293 driver.The alternate current (AC) ran actuators are connected through relays.The proposed system has the following subsystem for aquaculture management: 1) test setup; 2) regent replacement-based ammonia sensor system; 3) power management; 4) automated smart feeder; 5) RAS. 1) Test Setup: In the proposed system design, we have an edge node equipped with temperature sensors (DS18B20), pH sensor (DFRobot Gravity, model SEN0161), and DO (DFRobot Gravity model no: DFR1628), ammonia sensor, and water EC sensor.Similarly, we equipped the edge node with actuators like water pumps, aerators, feeders, biofilters, water heaters, and solenoid valves.Except for the temperature sensor, all the sensors are kept outside the main harvesting tank, as shown in Fig. 3.This arrangement prevents the sensor monitoring tip from corrosion and extends their lifetime.The integrated actuator, comprising a submersible pump and valve, facilitates water transfer from the main tank to the test setup.After the water quality assessment, the valve attached to conical funnel releases the water.A non-contact water level sensor is employed to regulate the activation and deactivation of the valve and submersible pump to manage the water overflow in the conical funnel.After each water quality assessment, the distilled water is pumped to clean the sensor probe.The water quality assessment is scheduled through a RTC.Our experimental investigation determined that water quality within the culture pond does not change abruptly.Numerous factors, such as water temperature, weather conditions, feeding, and the discharge of by-products, influence water quality parameters.These parameters often exhibit inconsistency multiple times throughout the day.After analyzing a month's recorded data, we have established an optimal schedule for managing the freshwater pearl aquaculture system.
2) Regent Replacement-Based Ammonia Sensor System: Ammonia is directly toxic to culture breeds in the unionized form, which is favored at high temperatures and pH.It also reduces the ability of culture breeds to utilize oxygen.Ammonia gets introduced into the water through excreted metabolic waste and the decomposition of organic matter.We have designed an inexpensive regent replacementbased ammonia sensor system to automate ammonia testing.The regent replacement-based ammonia sensor system automates manual regent-based ammonia testing.In the regent replacement-based ammonia sensor system, we have used the water level sensor, drop counter, and color sensor.Similarly, we have used the actuators like water pump, overhead steerer, check valve, and solenoid valve, as shown in Fig. 4. The scheduled set for water quality monitoring activates the ammonia sensor system.At the scheduled time, the edge not integrated DC submersible pump and solenoid valve start their operation to carry the water for quality test.The noncontact water level sensor immediately closes the solenoid valve and pumps when the required amount of water is in the conical funnel.Ammonia testing regent is available in the burette, which is controlled through a check valve.The overhead stepper motor pushes the check valve to make an air entry, resulting in ammonia regent drop released into the conical funnel.To manage the required amount of regent drop, we have a drop counter which signals to the stepper motor and closes the check valve.The drop counter is designed through an optical QRD 114 proximity sensor, invert Schmitt trigger (SN74HC14N), and OR gate (MN4072B IC).The regent in conical funnel mixes with overhead stirrer motor.The test result is recorded through an RGB color sensor and translated into the corresponding numeric PPM value.The test water in the conical funnel is released through the solenoid valve.After the test experiment, we pump the distilled water to clean the testing site for the next test.The filtered water is adequately mixed with the overhead stirrer motor and released from the solenoid valve.
3) Power System: In the power subsystem design, we have implemented using a 160-W, 12-V mono-crystalline solar panel, a 24-V 30 Amp solar controller, 12-V lead-acid batteries, a 12-V relay, a 200-W AC inverter, and a 12-V DC-DC buck converter to ensure an uninterrupted power supply, as depicted in Fig. 5.The proposed strategy for overseeing and managing the aquaculture system is synchronized via an RTC lock.The absence of a proper schedule could impact the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.productivity of aquaculture.Water parameters exhibit inconsistency and undergo multiple fluctuations throughout each day.Consequently, maintaining a consistent and well-monitored schedule for the aquaculture system is paramount.Therefore, missing a schedule monitoring and management may impact aquaculture productivity.The proposed power subsystem operates the DC and AC devices.A DC-DC buck converter supplies the required power to the DC-operated overhead stirrer, solenoid valve, and stepper motor.Similarly, the AC inverter operates the 20-W submersible pump, 15-W air pump, and 50-W water heater.
4) Automated Smart Feeder: A crucial aspect of the aquaculture system is the necessity for accurate monitoring of mussel feeding.Neglecting proper feed management can have multifaceted effects on the overall well-being of the mussels.Overfeeding, for instance, results in not only the loss of mussel life but also exacerbates the levels of food-based pollutants within the water [15] [31].This overfeeding further amplifies the presence of excreted by-products in the water, subsequently elevating the concentrations of harmful ammonia and nitrate.Both ammonia and nitrate pose significant threats to the mussels' health.At night, uneaten algae consume dissolved oxygen while introducing increased carbon dioxide (CO 2 ) into the aquatic environment.Conversely, similar algae release the DO as a by-product of photosynthesis during daylight hours.
For the equilibrium of the aquaculture ecosystem, it is imperative to uphold an appropriate feed.The repercussions of overfeeding and the prolonged presence of residual matter in the water can profoundly affect the quality of the water.Green algae are water-soluble and readily consumable by mussels and play a vital role in their diet.As demonstrated in Fig. 6, the smart feeder system comprises a submersible pump and agitator.These agitators effectively blend the solution of green algae, which is then transported to the harvesting tank by the submersible pump.The RAS is responsible for purifying the cultured water, subsequently re-utilizing it after appropriate treatment.This recirculating system effectively channels the water through bio-filters, which serve to eliminate by-products from aquatic organisms and decomposing residues present within the water.The absence of technological support hampers aquaculture farmers in their efforts to oversee and sustain water quality manually.In open pond aquaculture, the water is polluted with diverse waste materials.These waste components undergo decomposition, thereby exerting an influence on the overall quality of the water.
This RAS configuration transfers water from the harvesting tanks to the bio-filter chamber via pumps, as shown in Fig. 7. Subsequently, the purified water is directed back into the main tank.This recirculating procedure is initiated after each feeding cycle.The innovative RAS design effectively addresses the primary issue of ammonia concentration and regulates pH levels.

B. Network Design
The network design incorporates a communication framework connecting sensing, fog, and gateway nodes, as illustrated in Fig. 8.The socket communication API facilitates sensor data and controls communication between the edge and fog nodes.The gateway is the mediator of this communication between private and public networks.In the proposed network design, fog node placement is essential for data analysis and control.Fog nodes have local databases and analytics algorithms to process the data.The time scheduled monitoring and management are controlled by the fog node.However, the Amazon Web Services (AWS) EC2 infrastructure-as-aservice also runs an identical Web server.Data processing near the sensing node offers the benefit of maintaining the system optimally, ensuring adherence to scheduled monitoring and management tasks.The existing capacity of the public cloud needs to be improved to effectively address challenges such as latency and bandwidth constraints [31].Relying solely on the cloud server for comprehensive analysis and control could yield undesirable outcomes.The potential for interruptions in connectivity between the sensing node and cloud servers raises the risk of timely scheduled operations being compromised at the sensing node.To mitigate these concerns, we have strategically positioned cloud analysis closer to the sensing node through fog nodes, thus averting disruptions to scheduled data analysis and control.However, the fog nodes primarily serve as data processing and storage intermediaries.The responsibility of managing scalable storage and processing of sensor data remains within the purview of the public cloud.The Rest API serves as the web server's communication channel for data and control.Encoding of both data and control information is carried out using the base64 format.Furthermore, a combination of MQTT and RestAPI protocols is utilized to facilitate the communication between the nodes.The local network between the nodes communicate to Amazon cloud EC2 instance via gateway router, as depicted in Fig. 9.We have employed the TP-link router for this gateway setup.This router features dual bands: IEEE 802.11ac/n/a at 5 GHz and IEEE 802.11n/b/g at 2.4 GHz, offering bandwidths of 450 Mbps and 1300 Mbps, respectively.We harnessed supplementary router capabilities such as the virtual private network (VPN) and Network Address Translation (NAT) features to enhance security and functionality.Notably, the VPN server integrated within the router furnishes a safe network environment for remote access from the public network.The secure tunnel also provides remote users to monitor and manage aquaculture operations.

C. Logical Design
In a Data Processing layer, we have composed distinct functional components, each contributing to functions like data visualization, control, command, and processing.We have used the Python web framework for the front-end aspect.The graphical user interface (GUI) on the front end offers an array of functions, as illustrated in Fig. 10.The graphical user interface (GUI) was created using the technology stack of JQuery, Chart.js,CSS, and HTML5.The back-end is constructed using the MYSQL database.The web server is deployed at Amazon cloud EC2 instance and at fog node within the network.To streamline cloud-based data analytic,  we have implemented visualization using docker containers.This approach simplifies the challenges inherent in application development.Container-based visualizations require the application and its associated binaries and libraries.The isolation of containers occurs at the kernel level, eliminating the need for a separate guest operating system and minimizing resource duplication.Each container runs isolated data analytic models, enabling seamless scaling or updating of micro-services without disrupting other application functionalities, as depicted in Fig. 11.It is a swift, low-cost, and elegant isolation framework.The isolated containers forecast the change in water parameters through different nonlinear decision tree-based models.The IoT dashboard has additional features like recalibration, fault detection, and status monitoring of sensors and actuators.The data analytics visualize the forecasted data along with actual data.This feature lets us know the difference between real sensor data and analyticsdriven predicted data.In order to safeguard the identity of each device, a distinct and random API key has been employed.This key is specific to each device within the network.The API key is unique to every device in a network.The customer signs up and changes the API key.The remote login to the edge device is protected through a VPN server running the TP-link AC1750 wireless dual-band gigabit gateway router.

D. Intelligent Forecasting Models
We have adopted a data analytic approach to manage aquaculture operations.The predictive model analyses the change in water parameters and effectively operates the actuators.In this study, we analyze the feasibility of the tree-based model to Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE III COMPARISON OF FORECASTING MODELS
forecast the water parameter in the presence of a low amount of data.We focus on two main scenarios: 1) estimating water parameters based on the relative change in other parameters and 2) predict alterations in water conditions using historical data.Besides, we also compare the performance of the tree-based model with existing multivariate LR and ANN.The prime focus of this study is to analyze the DO forecast relative to pH, water temperature, and TDS.
The most common approaches for water quality prediction in aquaculture include the following: 1) autoregressive moving average (ARMA); 2) autoregressive integrated moving average (ARIMA); 3) Markov model; 4) support vector regression (SVR).These models are inappropriate for prediction in aquaculture water quality parameters as they only consider the linear relationship.The water quality parameters are inconsistent due to various environmental factors; hence linear prediction models are inefficient in correlating the relationships between multiple predictors and their respective variables.These models also take a long prediction time, making them unsuitable for predicting the nonlinear relationship [25], [27].Deep learning models like LSTM may need to be more stable for predicting all real-time dynamics.The predictive processes can be linear to a single target quality parameter and its dynamics over time between multiple predictors and their respective variables.LSTM and gated recurrent unit (GRU) are flexible in capturing the nonlinear relationship in water quality parameters [28].Due to its outstanding results in timeseries prediction, LSTM is the most popular forecasting DL technique.For time-series prediction, LSTM and GRU models could be better at keeping long-term memory, especially for extended sequences.In time-series forecasting, historical observations influence the prediction value at the present step.In certain circumstances, the observation step that had a significant impact may have appeared long before the current step.Recent research has shown that the ability of LSTM models to extract information about long-term relationships from historical observations remains a crucial performance constraint.Theoretically, it has been demonstrated that ordinary LSTM lacks long memory from a statistical standpoint [29].Compared to Naive Bayes, K Nearest Neighbors, and SVM, decision tree learning and neural networks result in better and more consistent performance.Known as KIG-ELM, the hybrid DO prediction model combines K-means, enhanced genetic algorithms (IGAs), and extreme learning machines (ELMs) and is based on edge computing architecture.This model distributes data acquisition, processing, and DO prediction among sensing nodes, routing nodes, and servers.For DO prediction, an ELM is implemented.Because of the unstable prediction performance constraint, it takes a lot of time to obtain high precision using the multiscale decomposition method.Multiparameter methods, which use several related parameters as input and the DO content as an output to forecast future DO, still have some significant issues, such as insufficiently processing DO data effectively and failing to recognize the characteristics of DO content changing.The DO time-series data is volatile.During sunrises and sunsets, forecast accuracy typically drops off quickly [30].In our proposed method, we have compared the accuracy of models like ANN, GBM, RF, and M5 model trees.We have chosen the models mentioned above due to certain advantages of these models.Table III summarizes the befits and limitations of the selected models.
For designing a predictive model, we employ a model tree (M5) and benchmark its performance against a GBM, RF, and artificial neural network (ANN).Unlike linear models, treebased models accommodate non-linear relationships, making them apt for monitoring real shifts in water parameters [27].Random forest comprises multiple individual random decision trees functioning as an ensemble, with each tree acting as an independent predictor.The ensemble predictions, formed from low-correlation individual trees, surpass the accuracy of solitary predictions.Optimal RF predictions require careful feature vector selection instead of random sampling, aiming for low correlation within the distinct decision trees.Similarly, Fig. 12. Aquaculture main harvesting tank [32].gradient boosting progressively enhances the performance of the CART algorithm.Initially assigning equal weights during decision tree training, subsequent modifications refine prediction quality.Weight adjustments focus on harder-toclassify instances, strengthening their influence, while easingto-classify ones see reduced weight.Subsequent trees yield improved forecasts over their predecessors.The ultimate prediction rests upon an ensemble's weighted sum of prior tree predictions.Furthermore, model tree-based predictive analysis forms a decision tree hierarchy using elementary models like linear regression, logistic regression etc.Initially, the given feature vector is fitted with a linear model.Later, the error is estimated between the actual target and predicted values.The least error features are chosen as the conditional branch of the decision tree.The subsequent split goes until the leaf node has an optimized linear model fitted on the partial feature vector.The trained model tree effectively forecasts the change in water quality parameters.The recursive optimization of the decision tree may lead to an overfitting problem.To deal with the overfitting problem, we have used the prepruning method to filter out the anomalies in the data set using the local outlier factor (LOF) [32].Similarly, we have applied the post-pruning method to prevent the decision tree growth to its full depth.The post-pruning method simplifies the model tree and optimizes the prediction accuracy.Similarly, the ANN models are the conventional approach for time-series forecasting.However, unlike the tree-based model, ANN-based models need a larger data set for training and testing, and it is not easy to interpret the information from the trained model.We analyze the performance of the multilayer perception ANN model with a ReLu activation function.

A. Experimental Setup and Control System
We have used the glass aquarium for freshwater pearl farming.The Lammelidens marginalis mussel species is used for pearl production, as shown in Fig. 12.Each mussel is implanted with two designed, crafted mussel shell nuclei.In the implantation process, each mussel passes through a surgical procedure.After successful implantation, each mussel is placed within tanks dedicated to post-operative care, where antibiotics and an oxygen pump are administered.Some mussels might reject the implanted foreign particles and die, while others accept them.Those mussels that accept the foreign particles are transferred from the post-operative care tanks to the primary harvesting tank.Maintaining a controlled environment is imperative to ensure optimal pearl production.The proposed system has sensors and actuators that manage the habitable underwater environment [31].
In the initial stages of data processing, we investigated how temperature influences biological and chemical reactions.The fluctuation in temperature notably impacts water parameters over an entire day.Hence, we've established five distinct time intervals for data acquisition.The first acquisition, scheduled at 6:00 AM, coincides with the lowest temperature and DO levels, alongside the highest pH and moderate alkalinity.The second interval, at 10:00 AM, aligns with the initiation of the smart feeder system and aeration.At 3:00 PM, the third acquisition takes place, coinciding with peak temperature, pH, and DO levels.The fourth instance, at 10:00 PM, corresponds to the commencement of the recirculating aquaculture system.This system involves water passing through a bio-filter to eliminate residual plankton feed, as nocturnal plankton consumption affects dissolved oxygen.Analytical algorithms oversee DO changes and aeration operation.The fifth interval, at 1:00 PM, analyzes aeration requirements through data analysis.RTC control manages system operations.We validate the control system by simulating changes in water parameters to observe system behavior [31].The smart data analytics algorithm schedule the requirement for aquaculture management based on the change in the water parameters.The intelligent data analytics algorithm schedules the requirement for aquaculture management based on the change in the water parameters.

B. Data Preprocessing
The sensing node simplifies raw sensor data for processing.In some initial data, sensor data may be missing, potentially leading to erroneous predictive analysis.To address this, data imputation is executed at the fog node due to sensing node constraints.The sensing node aggregates sensor data using base64 encoding, forwarding it to the fog node.Upon receipt, the fog node decodes and validates the data before predictive analysis.For missing sensor values, the fog node employs data processing to determine correlations between historical and current data.Scheduled RTC data acquisition simplifies correlating current and similar-timestamp historical data.Utilizing the KD tree, the missing sensor feed is imputed by analyzing non-missing neighbouring sensor data.The Kd tree searches the nearest neighbor of similar timestamps from the historical n proximity sensors and imputes the missing sensor feed by reading the nearest neighbors' sensor feeds.Subsequently, the sensor data undergoes pre-processing to identify anomalies.Anomalies within the dataset are eliminated by applying the LOF, made by Singh et al. [32].This technique identifies aberrant data points by assessing their local deviation compared to neighbouring points.The resulting LoF score is then utilized to ascertain the presence of outliers in the data ⎧ ⎨ ⎩ LOF(k) ∼ 1 data point in a same cluster LOF(k) < 1 data point is Inlier LOF(k) > 1 data point is outlinear.
In the equation above, the variable "k" denotes the locality concerning its kth neighbours.To assess the efficiency of LOF, we introduced an additional outlier data point into the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

C. Aquaculture Control System
The actuators respond to control signals generated by the data analytic algorithm.This algorithm utilizes past data to predict shifts in DO levels, taking into account correlated water parameters like temperature and pH.Relying solely on sensor data for system operation can lead to imprecise monitoring.Prolonged usage of sensors often introduces inaccuracies in measurements.Despite any discrepancies in sensor measurements, we counteract deviations from the desired state by considering the historical data recorded at similar time instances.We have considered the water temperature, EC, and relative pH parameters for predicting DO levels.Likewise, we have considered the interdependent parameters of DO, electrical conductivity (EC), and water temperature for predicting pH values.To evaluate the precision of the DO sensor data, we compare the pH and water temperature data with historical records from similar time intervals.We have integrated a K-D tree to improve the search procedure, as depicted in Fig. 15.
The predicted DO values, and those extracted from historical records might display either close resemblances or notable disparities.Should the relative variation remain below 0.5 parts per million (PPM) between the predicted and retrieved DO  [32] values, the system functions smoothly without sensor malfunctions, adhering to a schedule derived from the analytic process.Conversely, suppose the relative divergence surpasses 0.5 PPM.In that case, it triggers a re-calibration of the sensors, resulting in an adjusted schedule based on other correlated parameters such as EC and water temperature.A combination of multiple temperature probes and EC sensors is employed to ensure precise prediction as they are robust and cost-effective relative indicators for forecasting DO and pH levels.Likewise, the relationship between pH and DO is influenced by various factors.pH fluctuations are attributed to changes in water ion composition, which can be readily deduced through the EC sensor.In cases where the pH sensor produces inaccurate readings, the EC sensor is employed to stabilize both DO and pH variations.An absolute difference exceeding 1 part per million (PPM) prompts a system alert, indicating a potential sensor malfunction, prompting a transition to alternative parameters (EC and water temperature).Enhanced precision in prediction is achieved through the combined utilization of correlated relative parameters.Our initial investigation encompasses pH, DO, EC, and water temperature as interconnected parameters for comprehensive water quality analysis.Integrating multiple relevant sensor inputs contributes to the refined forecast.
The incorporation of the actuator system is designed in response to variations in the target water parameters, as outlined in Table I.The gathered data orchestrate diverse actuator actions through the Real-Time Clock (RTC).Overnight accumulation of by-products and leftover feed leads to alterations in pH and DO levels within the water, which are normalized through the operation of the Recirculating Aquaculture System (RAS) and the aerator system, scheduled at 6 A.M. Later at 10 A.M., smart feeder system pumps the plankton algae mixture into the harvesting tank and operates the aerator to supplement desired to DO requirement.The third sensor measurement time was set to 3 P.M. when mussels excreted by-product, and temperature variation may fluctuate the DO and pH.To balance the DO and pH, the proposed system, based on the requirement, may operate the RAS system and aerator.At 10 P.M., scheduled actuator operation, we balance the DO and pH through RAS and aerator.Similarly, at the 1 P.M. overnight schedule, the proposed system analyzes the DO requirement and accordingly operates the aerator.We adjust the water parameters to validate the functionality of the control system.The intelligent data analytics algorithm schedules the aquaculture management requirement based on the water parameters.

D. Performance Evaluation for Predictive Analysis
The cleaned data serves as input for predictive analysis.Initially, we computed bilateral Pearson correlations among    The comparative performance analysis obtained the lowest MAE of 0.963 from the M5 model tree.The model performance is validated using the new data set from the sensors.Similarly, we have evaluated the model performance for pH prediction using a training sample containing DO, pH, and temperature water parameters.Table VI shows the comparative performance of the model tree for pH prediction with other nonlinear decision tree-based predictors.
Figs. 17 and 18 display the correlation outcomes of the M5 model tree for pH and DO, comparing actual and predicted values.The correlation between predicted and actual DO values stands at 0.8775, accompanied by a satisfactory MAE of 0.963.Similarly, the pH prediction yields a high correlation of 0.974, alongside a minimal MAE of 0.01239.The experimental evaluation shows that the M5 model tree algorithm can predict the changing water parameters better than other RF, ANN, and GBM nonlinear predictors.In the comparative study, we found M5 model tree is slightly better than other nonlinear RF, GBM, and ANN models.Despite less training data, we obtain a better result with the M5 model tree due to its inherent features of grouping the high correlations data for constructing the M5-model tree.
The employed M5 model tree performs the group analyses of relative water parameters.We adopt the pruning methods for the model to generalize well to unseen data.The pruning method optimizes the tree structure without affecting the classification accuracy.The REP algorithm pruned the growing tree and used the information gained as the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
branching criteria.Redundant subtrees were pruned to solve the overfitting problem and maximize the forecasting accuracy.

VI. CONCLUSION
This article introduces a holistic Internet of Things (IoT) system designed to oversee and uphold aquaculture operations.The proposed system design has a physical, network, and logical design.The physical design provided the hardware configuration details.In contrast, the network design shows the communication network between the physical devices.In this design, we have addressed the requirement of a fog node for intelligent data analytics and control.In the logical design, we have discussed the front-end and back-end implementation details.It also highlighted the importance of container-based virtualization and the various design features.This article also discusses the importance of the core intelligent analytics algorithm for monitoring and managing aquaculture.The closed-loop control system ran through intelligent nonlinear decision tree-based models.This article shows the comparative performance of the M5 model tree, RF, ANN, and GBM.The experimental evaluation found that the M5 model tree has the highest prediction accuracy for DO prediction with a correlation of 0.877 with an MAE of 0.963.Similarly, the M5 model tree outperforms PH prediction with a correlation of 0.975 and an MAE of 0.0123.
Future research in this direction includes more robust relative water sensors to make the system more affordable and accurate.In future research, we also include analyzing and developing a more accurate forecasting model.

Fig. 9 .
Fig. 9. Logical representation of the network configuration between the nodes.

Fig. 15 .
Fig. 15.Aquaculture control system.dataset.The experimental findings indicate that LOF proficiently identifies outliers within the dataset, as Figs.13 and 14 illustrate.

Fig. 16 .
Fig. 16.Generated model tree with maximum depth = 4.TABLE V RESULT OF DO PREDICTED FROM NONLINEAR FORECASTING MODELS

TABLE I IDEAL
WATER PARAMETERS FOR FRESHWATER PEARL FARMING

TABLE IV PEARSON
CORRELATION ANALYSIS RESULTS

TABLE VI RESULT
OF PH PREDICTED FROM NONLINEAR FORECASTING MODELS