Introduction

The IoT has increasingly pervaded all forms of technological landscapes, such as agriculture, security, irrigation management, health care, and monitoring. The cloud-centric memory and processing-based IoT structure could calculate the data by way of various sensors with decision-support networking nodes1. On the other hand, with the assistance of intellectually applicabletechnology and rendering solutions in the IoT environment can be fruitful and helpful for the agricultural environment that depends on smart dimensional irrigation2. In the IoT environment, the adoption of intellectual spectral detection methods contributes to a sustainable ecosystem with the usage of machine learning techniques. The water quality management and assessment models require IoT solutions and that become significant with the developments in information and communication technology3. The examination of water quality prediction models is generally executed based on biological, chemical, and physical characteristics. Moreover, the IoT-based water quality estimation strategies conduct water quality parameter checks in order to detect the deviation risks and the continual degradation of water quality. This has been accomplished through the real-time analysis of accumulated data and then suggests the most applicable remedial action4. In addition, the methods for the prediction of water quality play an important role in order to decrease the environmental impact of aquaponics systems. The practitioners can obstruct the additional amount of nutrient discharge by the accurate prediction of water quality into the environment that can tend to the eutrophication of water bodies5.

Advanced monitoring techniques are adopted for the prediction of water quality in aquaponics by anticipating the changes in key water parameters6. The anticipation of parameters includes concentration of dissolved oxygen, level of PH, level of ammonia, nitrate, and nitrite and temperature. The potential issues are prevented by considering the proactive measures and also guaranteeing the overall well-being of the system7. The initial stage detection of smaller deviations from the desired water parameters are the primary objective of the water quality prediction techniques8. Furthermore, it is helpful to rectify the negative impacts on plant health and fish health in the aquaponic system by using these monitoring techniques. One of the examples behind this is, when the pH initiates to drift the optimal range outside, especially to the species of plants and fish in the system, then several adjustments can be made for bringing it back to the desired level. In the same way, when the level of dissolved oxygen drops too low several procedures can be taken for improving the oxygenation and preventing stress on the fish9. The fish feeding regime is adjusted by the practitioners for ensuring that the plants receive the necessary nutrients for their healthy growth by understanding the nutrient levels in the water and nutrient requirements of the plants. This has been accomplished by optimizing nutrient management in aquaponics systems with accurate water quality prediction models10. On the other hand, it prevents nutrient deficiencies and imbalances that lead to an increase the crop quality and productivity. Moreover, the efficiency of the water quality system is highly improved by adjusting the aeration, water flow rate, and filtration systems on the basis of predicted water quality and it guarantees if the system is operated under its peak performance11. The wastage of resources and the consumption of energy are decreased in addition to the improvement in the overall productivity.

There has been a growing fascination with IoT-based harnessing capabilities in recent years for addressing environmental challenges. With the support of Wireless Sensor Networks (WSNs) and IoT, real-time surveillance systems with low cost will promptly send alerts through SMS and email12. Therefore, several approaches have been implemented for monitoring and assessing water quality worldwide including multivariate statistical methods, fuzzy inference and Water Quality Index (WQI)-based methods13. Many water quality variables are observed for assessing the water quality as per the procedures portrayed in the appropriate standards, where the selection of parameters plays a significant role14. In recent days, researchers implemented machine learning-based approaches for monitoring the aquaponic system, which has the ability to analyze a huge volume of data and capture information regarding water nutrients and it is helpful for addressing the complex and large-scale water quality assessment necessities15. The effective patterns from the data are extracted through these machine learning-based approaches during the water quality prediction. The machine learning-based water quality prediction models are utilized in several domains because of their convenient extensibility, flexible customization, and high precision16. Furthermore, the complicated nonlinear relational data are managed easily by machine learning-related techniques and it simplifies the detection process of the fundamental systems. The potentiality of these machine learning-based systems is ensured with respect to incredible adaptability in the engineering domain and environmental science domain in recent times. Hence, highly precise assessment results are awaited by this machine learning-aided IoT-based water quality prediction model of aquaponic fish ponds in spite of the complexity and prediction accuracy. Therefore, we developed an effective water quality prediction scheme for aquaponic fish ponds on the basis of IoT to overcome the challenges in the existing models.

The integration of GRU networks with a multi-scale feature fusion-based convolutional autoencoder is specifically designed to address the unique challenges faced in water quality prediction. The proposed MS-CAGRU captures both short term and long term trends in water parameters and additionally handles temporal dependencies in sequential water quality data. To resolve the overfitting problem, the proposed model introduces dropout layers between major components, L1/L2 regularisation techniques in few of the layers, cross-validation during training and early-stopping based on validation performance. The model utilises advanced mechanisms to identify and analyse relationships between water quality parameters such as pH, dissolved oxygen and temperature. This approach enhances accurate predictions by understanding how one parameter is related to another parameter directly or indirectly influencing other parameters in the aquaponic ponds. Additionally, the model employs a multi-level approach where initial layers capture fundamental patterns in individual parameters, while subsequent parameters combine these patterns into complex relationships. This hierarchical structure enables comprehensive water quality analysis by processing information.

The contributions of the developed IoT-aided deep learning-based water quality prediction model in Aquaponic fish ponds are summarized as follows.

  • To propose a deep learning-aided IoT-assisted water quality prediction model in Aquaponic fish ponds for the determination of quality parameters such as dissolved oxygen rate, level of nitrate, alkalinity, salinity, air temperature, hardness of water and humidity for improving the growth rate of plants and fishes.

  • To implement a RF-MOA for the selection of optimal weights during the extraction of features for maximizing the relief score that provides higher feature dependencies from the raw data.

  • To propose a MS-CAGRU for the detection of water quality in Aquaponic fish ponds, which is constructed using conditional autoencoder and GRU for increasing the accuracy of prediction in order to reduce the death rate of fishes.

  • To validate the efficiency of the developed water quality prediction scheme in Aquaponic fish ponds by analyzing various metrics with the conventional prediction models.

The remaining sections describing the proposed deep learning-based IoT-enabled water quality prediction system in Aquaponic fish ponds is described below. The traditionally used deep learning-aided prediction model for water quality is explained in Part II and their merits and disadvantages are also discussed. In Part III, the general view of the IoT-based water quality prediction system, the dataset description and the structural view of the proposed model are explained. In Part IV, the extraction of features using proposed heuristic and deep learning strategies is explained. In addition, the processing steps of RF-MOA are provided in this Part IV section. The structural illustration of the proposed MS-CAGRU for predicting water quality parameters in Aquaponmic fish ponds is briefly elucidate in Part V. The results and analysis among prior works are explained in Part VI and the summarization of the implemented scheme is elucidated in Part VI.

Literature survey

Related works

In 2023, Nemade and Shah17 developed a farming prediction system for warm-water fish, cold water, plants, and bacteria to enhance the farming business of aquaponics. The IoT sensors were used for the collection of data and then the data cleaning process was carried out. Then, the feature correlation has been performed for removing the unwanted features. Consequently, the imbalanced class problem has been solved and the machine learning classifiers have been used for the multi-model classification of aquaponic ecosystems. The voting mechanism has been utilized to provide the final outcomes. The performance validation has been done with the traditional techniques to validate the effectiveness. By utilising IoT sensors for real-time data collection, the system ensures a reliable, continuous and accurate flow of information, which is essential for managing aquaponic ecosystems. The process of feature correlation ensures removal of unrelated features, improving the model’s performance by focusing only on the most relevant features. The proposed system also addresses the most commonly faced problem of class imbalance in ML.bThe use of a voting mechanism ensures that the model’s performance is accurate by combining the strengths of various ML models. The paper utilises various IoT sensors for collecting data, but the approach used in this study utilises real-time water quality prediction by collecting, analysing and acting upon the data. The proposed approach in this study, involves advanced processing techniques such as handling missing values, normalisation and extracting most relevant features using the various convolutional layers, followed by pooling layers. The paper employs basic architecture, unlike this study which utilises RF-MOA or DBM for extracting features and then those features are fed into the MS-CAGRU for water quality prediction.

In 2021, Cao et al.18 have developed an Attention-based GRU with a Gradient Boost Regression Tree (GBRT) model for the prediction of dissolved oxygen. At first, the prediction of factors affecting the environmental condition due to the distribution of dissolved oxygen was determined using Attention-GRU. The experiment in this paper was carried out based on the data of the crabs pond in the aquaculture farm of Gaoteng Town, Yixing city, Jiangsu Province. Then, the Random Search (RS) algorithm has been utilized for predicting the position of dissolved oxygen. The proposed three-dimensional central point determination aided water quality examination model has been ensured with the conventional models for validating the effectiveness. The use of Attention-based GRU enhances the model’s ability to focus on important time steps in the sequence. By combining GRU with GBRT, the system benefits from both time series forecasting and regression-based optimization, enhancing the accuracy of the predictions. Similarly, the use of the RS algorithm helps in fine-tuning the model efficiently. The approach in this paper focuses mainly on predicting the spatial distribution of dissolved oxygen, rather than predicting the water quality. This may limit the water quality parameters, but the method used in this study targets multiple water quality parameters. The involvement of RF-MOA in this study would ensure that the system self-improves, potentially making accurate predictions.

In 2023, Monirul et al.19 proposed an embedded system with the utilisation of sensors and an Arduino microcontroller. The data related to the sensor were collected using these sensors and stored in an IoT cloud platform as a CSV file. The real time data has been used for the analysis of water and then the machine learning approach has been used for performing the prediction process. The main focus of the algorithm is to decide whether a pond is suitable for cultivating fish or not. The labelled data contains 11 categories of fishes and was analysed using various ML algorithms, including Random Forest, K Nearest Neighbors (K-NN), Logistic Model Tree (LMT), Reduced Error Pruning Tree (REPTree), Jumping Rule Inference with Pruned Search (JRIP), Partial Decision Trees (PART), Decision Table, and Logit boost. The attributes such as “Biochemical Oxygen Demand (BOD), Chemical Oxygen Demand (COD), and Dissolved Oxygen (DO)” were calculated in this system for the experimental analysis. Random Forest achieved the highest accuracy at 94.42%, kappa statistics 93.5% and Avg. TP Rate 94.4%. The study evaluates various ML algorithms, providing broad analysis of classification techniques for determining pond suitability. The model achieved accuracy of 94.42%, showing strong performance in predicting water quality and fish cultivation suitability. The use of an IoT platform enables scalability and centralised data management, allowing for real-time monitoring across multiple locations. The system is focused on determining the suitability of water bodies specifically for water bodies specifically for fish farming, making it less adoptable for aquaponics applications. The approach used in this paper focuses on a limited set of attributes, in comparison, this study uses a broader range of attributes by integrating data from various sensors. The approach used in this study, improves water quality prediction by capturing trends and managing temporal dependencies. It enhances accuracy by analysing key parameters and employing techniques to reduce overfitting.

In 2023, Rodriguez et al.20 implemented a bagging and boosting ensemble approach for managing the aquaponic system. The decision support has been made with the help of the proposed Aquaponic system that depends on Autonomous Smart IIoT for autonomously monitoring, controlling, and managing the collected data. Here, the IIoT with machine learning and artificial intelligence has been integrated into the aqua agriculture system for attaining an efficient outcome. The proposed method in this paper utilises ensemble techniques by utilising the predictive model with Bagging and Boosting ensemble technique. The paper mainly focuses on integrating IIoT with ML and AI, unlike this study which utilises IoT for data acquisition.

In 2019, Karimanzira and Rauschenbach21 have presented a predictive analytics model with the support of IoT by employing Enterprise Resource Planning (ERP), Supervisory Control and Data Acquisition (SCADA), and Manufacturing Execution System (MES). Various geographical locations were considered for the predictive analytics services. From these different locations, the data collection has been carried out. The evaluation of econometric optimization was done based on the robustness of the several approaches with the utilisation of Monte Carlo Simulations and the results revealed the superiority of the IoT-based approaches. The proposed approach combines ERP, SCADA and MES for a comprehensive approach to predictive analytics, various statistical methods are used to optimise predictions and ensure higher accuracy. The system also involves the use of various technologies, instead of focusing on a technology to enhance the accuracy and predictions. The proposed method in this study focuses mainly on demonstrating the efficiency of targeted IoT applications in predicting water-quality accurately.

In 2020, Cao et al.22 have suggested a prediction approach of dissolved oxygen in pond culture with the support of a Gated Recurrent Unit (GRU) neural network and K-means clustering. Initially, the factors that affected the modifications in dissolved oxygen were preferred using “Principal Component Analysis (PCA)”. After, the time series related to the dissolved oxygen was given to K-means clustering, and the prediction approach for the dissolved oxygen was formulated with the support of GRU. The similarity evaluation of the time series has been done to enhance the effect of clustering. The distance related to dynamic time-warping and Euclidean distance has been combined in this model for the analysis of time series data. Finally, the content of dissolved oxygen from the aquaculture water has been predicted over various time intervals based on the demand of real-world scenarios. The prediction accuracy of the proposed scheme was higher when compared to the previous approaches. The proposed approach in the paper primarily focuses on prediction of dissolved oxygen, unlike the proposed approach in this study, which focuses on predicting water quality, rather than limiting its water quality parameters like the proposed approach in the paper. Similarly, the proposed method in the paper relies on single-dimensional data which might affect its accuracy. Unlike this, the proposed method in this study utilises multi-sensor fusion to enhance accuracy. Additionally, the paper is also limited to poond culture rather than aquaponics, used in this study.

In 2023, Ahmed et al.23 have proposed an IoT with a machine learning-based integrated framework for comprehensive water quality analysis and prediction. Totally four modules were presented in the IoT-aided framework: coordinator, data processing, sensing, and decision making. The collected data were preprocessed initially and then analyzed with the usage of machine learning methods for the determination of “Water Quality Class (WQC) and Water Quality Index (WQI)”. The air quality prediction outcomes of the proposed model have been validated over the baseline machine learning approaches to ensure its effectiveness.

In 2021, John et al.24 recommended a nitrate concentration identification model from aquaponic water using a hybrid technique. At first, the collection of the dataset was conducted and then the segmentation of vegetative green pixels was executed in the background. The number of significant features from the dataset has been decreased by the regression tree-based dimensionality reduction approach based on multiple features. From the recurrent neural network model, the total amount of optimal hidden layers was determined using the tool named Multigene Symbolic Regression (MGSR) that functioned based on the derived fitness function. The Genetic Algorithm has been used for optimization purposes. The efficiency of the model has been proven by conducting an experimental analysis of the proposed scheme. The paper mainly focuses on identifying nitrate concentration, unlike this study which focuses on water quality prediction. The proposed method in the paper mainly relies on regression tree-based dimensionality reduction without integrating different sensors, unlike used in this study.

Figure 1. is a pie chart showing the distribution of various methods used in reviewed papers for water quality prediction in aquaponics systems. The most commonly used method is “IoT and Machine Learning” at 20%, followed by “Attention-based GRU and GBRT”, “ERP”, SCADA, MES with Monte Carlo and others, each with smaller shares.

Fig. 1
figure 1

Distribution of method used for Water Quality Prediction in Aquaponics Systems.

Problem statement

Constructing water quality prediction systems in Aquaponics ponds may be expensive due to the costs of sensors, data handling, and servicing. Many deep learning-related approaches have been developed to tackle the issues. The merits and demerits of the existing models are offered in Table 1. XGBoost and the random forest17make it possible to control nutrient concentrations in Aquaponics farms more effectively, guaranteeing that fish and plants get the right ratio of nutrients for healthy growth. However there may be errors in this model because of a variety of things, including dynamic systems, biological relationships, and climate. GBRT and GRU18can increase system effectiveness by regulating factors like pH, temperature, and oxygen concentration by forecasting water quality. However it can be difficult to gather accurate and adequate data for predicting the water quality of Aquaponics pond water, particularly if there are any gaps in surveillance or restricted availability of past data. The embedded model19supports Aquaponics practices that are both ecologically friendly and economical by reducing the possibility of imbalances in nutrients and excessive release into the atmosphere. However, the precision of water quality estimates can be impacted by outside variables such as variations in fish and vegetation populations, temperature swings, and fertilization availability. Bagging and Boosting Ensemble Technique20can assist in lowering losses brought on by illnesses of the fish or plants, increasing the financial viability of Aquaponics activities. However, it became complex to forecast modifications to water quality with accuracy in Aquaponics farms because of the intricate relationships that exist among fish, plants, and microbes. SCADA, ERP and MES21have the potential to simplify the process of monitoring, decreasing the need for manual inspection and enabling operators to concentrate on other elements of system administration. However, it is challenging and laborious to calibrate forecasting models for Aquaponics water from ponds, necessitating substantial data gathering and analysis. GRU and K-Means clustering22enables accurate water control, reducing waste and encouraging effective water usage in Aquaponics systems. However, finding the right algorithms for precise forecasts is difficult because of the absence of established ways of predicting the water quality of Aquaponics pond water. LSTM23can aid in the prevention of infections and illnesses between both organisms in systems for Aquaponics through early detection of water quality variations. But the movements of Aquaponics farms remain under investigation, and forecasts may not be as accurate due to gaps in the understanding of the various components influencing water quality. GA-RNN24 lessens fluctuations and gives both creatures a more constant atmosphere by assisting in the maintenance of predictable circumstances inside the system. But it may have incorrect or erroneous warnings, which could prompt needless actions or system disturbances. Therefore, we developed an effective water quality prediction model for Aquaponic fish ponds based on IoT to overcome the challenges in the previous approaches.

Table 1 Merits and Demerits of the Existing Water Quality Prediction Approaches.

Primary description of proposed deep learning-based water quality prediction model for aquaponic fish ponds using IOT data

IoT-based water quality prediction: needs and processing steps

Aquaponic is generally a system that integrates aquaculture and hydroponics for growing fish and plants simultaneously. In this system, the fish wastes are used as the fertiliser for the growing plants. Moreover, the plants clean the water required for the fish. The quality of water in the Aquaponic system directly affected the growth rate of aquaculture. Hence, the dynamic monitoring of water quality in the Aquaponic system has been needed and also the relevant parameters that affect the quality of water have been required to be determined. In conventional Aquaponic systems, the labour required is high, which increases the overall cost requirement. Furthermore, the constant monitoring of dissolved oxygen, turbidity, temperature, and pH value is difficult, the only solution to solve this issue is IoT-assisted water quality prediction systems. The basic components and functions involved in the IoT-assisted water quality prediction models in Aquaponic systems are explained as follows.

The IoT-Aquaculture systems monitor the microclimate and water quality, and they give early warning functions to increase overall productivity. The real-time data collection has been enabled and then the conditions of the water quality are predicted as well as the parameters are adjusted, monitored, and assessed remotely. The manpower-based aquaculture management requires smart fish management systems and also water quality monitoring and control systems. Multiple sensors like “turbidity sensor, pH sensor, temperature sensor, and dissolved oxygen sensor” are connected with multiple actuators like water pump, heater, windproofing device, limit switch, agitator, Wi-Fi module, smart feeding device and real-time monitoring devices. The required data has been collected using the sensors and then transmitted to the cloud users using the Wi-Fi communication scheme. The features from the data are extracted through artificial intelligence and big data techniques in order to increase productivity. Thermal sensors are used to detect the temperature of the sensors. The dissolved oxygen level in the fish pond is also detected by the use of an agitator. In addition, the water pump is activated when the turbidity and PH value exceeds the threshold level. The growth rate of aquatic creatures is monitored in this system. The detailed preview of the general schematic representation of the water quality prediction scheme in Aquaponic systems is shown in Fig. 2.

Fig. 2
figure 2

IoT-based water quality prediction in Aquaponic ponds.

Collected Data from aquaponic fish ponds

The data needed for the prediction of water quality from the Aquaponic fish ponds on the basis of IoT are collected from the standard dataset of “A Simple Dataset of Aquaponic Fish Pond IoT” and it is obtained from the source link of “https://www.kaggle.com/datasets/bobsis/small-aquaculture-fishpond: access date 2023–11–27”. The IoT sensors and devices provide the measurement of TDS, PH and temperature that are included in this dataset. The measurements are carried out over the aquaculture that consists of pond media has the volume of 1m × 1m × 70cm and also hydroponic media with the addition of the Nutrient film approach. There are two types of data in the dataset, one is raw data and other is filtered data. The filtered data in the dataset is filtered according to optimal recommended value, pH data is in the range of pf 6.5—8.5, TDS data < = 500 mg/L (ppm), water temperature data ranges from 24–27 degrees celsius. The version available in this dataset is pond_iot_2023.csv and pond_iot_2023_raw.csv. The size of the dataset involves 118 k rows with 5 columns. The columns in this dataset are id, created_data, water_pH, TDS and water_temp.

The collected data from the Aquaponic fish ponds is signified by the term \(Fs_v^{inp}\) , where v = 1,2,3...,V indicates the total amount of gathered data.

The integration of IoT devices for remote monitoring in aquaponic systems raises significant ethical concerns, particularly regarding data privacy. The collection and transmission of sensitive information, such as water quality parameters and environmental conditions, can expose personal data to unauthorised access or breaches. It is crucial to implement strong data protection measures, such as encryption and secure access protocols, to safeguard user information. Additionally, transparency in data usage and obtaining informed consent from users is essential to ensure that they are aware that their data will be collected, stored and utilised. Ethical considerations Overall, maintaining ethical standards in data handling is essential to build trust and ensure the responsible use of IoT technology in aquaponic systems.

Data preprocessing in aquaponic systems

Data preprocessing steps are crucial steps to ensure the quality and reliability of the data before it is fed into the predictive models. Handling missing values in aquaponic system data is addressed through a systematic approach, employing techniques such as mean/mode imputation, forward filling, or interpolations based on the nature and extent of the missing data. Normalisation is then applied to scale the water quality parameters to a consistent range, typically between 0 and 1. This step is crucial in ML, as it improves the integration of optimization algorithms and enhances the performance of neural networks.

Min–max normalisation is commonly used, transforming each parameter \(x\) using the formula:

$${x}^{|}=\frac{x-min(X)}{max(X)-min(X)}$$

It ensures that features such as pH, temperature and dissolved oxygen contribute equally to the model’s training. The model utilises various convolutional and pooling layers to extract and enhance relevant features from the preprocessed data. Convolutional layers apply filters to detect patterns and relationships among different water quality parameters, while pooling layers reduce dimensionality and computational complexity. This hierarchical approach allows the model to learn complex relationships within the data effectively.

Fundamental illustration of proposed water quality prediction model

Conventional Aquaculture addresses some problems like many aquatic diseases, backward technology, and low aquatic product output. The determination of water quality is the key to the modern Aquaculture culture management system. If there is such a problem with the water quality and hence, a huge number of fish will die. Therefore, a big data mining-based water quality monitoring model is developed and the concentration of several parameters is analysed to enhance the stability and reliability of the system. A deep learning-based fish feeding system is developed for computing the feed quantity in aquaculture systems. Fuzzy logic control-based pH level monitoring system is designed for both aquarium and hydroponics systems. Energy-saving solutions are also suggested in the Aquaponic system to reduce production costs. Limited works have been implemented for monitoring the water quality, growth rate, and accurate behaviour analysis. The collection of data is a challenging issue in the Aquaponic systems. Therefore, an IoT-integrated deep learning-aided water quality prediction system is developed in Aquaponic systems to enhance the growth rate of plants and fishes. The structural representation of the proposed deep learning-based water quality prediction model is shown in Fig. 3.

Fig. 3
figure 3

Newly developed IoT-integrated deep learning-based water quality prediction scheme in Aquaponic systems.

A new water quality prediction scheme in the Aquaponic system is developed based on IoT with deep learning to monitor the quality of water and provide early warnings to increase the growth rate of plants and fishes. In addition, the quality parameters are also analyzed to provide better water quality management in the Aquaponics system. The IoT-based sensors are utilized for collecting the data from the Aquaponic fish ponds. These data are gathered from the traditional online sources. The developed RF-MOA is adopted to optimally prefer the weights and features from the raw data. These optimized weights are concatenated with the selected features to construct weighted features. The optimal selection of features and multiple weights from the raw data maximizes the relief score and hence the efficacy of the prediction approach is highly improved. The DBN method is used for extracting the deep features from the original data. Then, the MS-CAGRU model is developed for the prediction of water quality in the Aquaponic fish ponds. The weighted features, deep features and the original features are applied as input to the MS-CAGRU. This model is formulated by integrating the multi-scale feature fusion on the convolutional autoencoder with the GRU. The multi-scale feature fusion-based outcome provides enhanced water quality prediction outcomes. The comparative analysis of the implemented scheme is done to validate the performance than the conventional models by concerning several validation metrics.

Extraction of weighted and deep features from the collected data using optimization strategy and deep learning networks

Description of proposed RF-MOA

The RF-MOA algorithm is designed in this approach with the support of mother optimization for improving the prediction of water quality performance in the Aquaponic fish ponds. This RF-MOA is used for preferring the optimal weights and features from the raw data during the feature extraction stage. This extraction of optimal features maximizes the relief score that has the potential to capture the feature dependencies and interactions from the given feature set. The mother optimization strategy is utilized in the proposed RF-MOA for solving the optimization issues. This mother optimization algorithm is very simple to implement. Continuous optimization problems are effectively solved with the help of this mother optimization. The development of multi-objective versions is slightly complex in this algorithm and the convergence speed for attaining the optimal solution is also poor in the mother optimization strategy. To solve this issue, the random variable used in the conventional mother optimization algorithm is updated to attain better optimal solutions. The best and mean fitness values are calculated for updating the random parameter \(\zeta\).In the conventional MOA, this parameter \(\zeta\) is chosen in the interval between (0, 1) in Eq. (2). But, the obtained solution is not effective and hence this is updated, which is expressed in Eq. (1).

(1)

The term \(Best_{fit}\) gives the best fitness and the term \(Mean_{fit}\) gives the mean fitness. The best and mean fitness-based updated parameter provides the best solution in the problem space. Moreover, the convergence speed of attaining the optimal solution is also improved by this proposed RF-MOA.

MOA25: It is a new metaheuristic approach, the human interaction among the children and mother is mimicked in this algorithm, which is the inspiration. The care of the mother to the children is simulated in three stages such as advice, education, and upbringing, which is the real inspiration of the MOA. Mother is considered as the significant educational component in children’s growth and she passes their skills and experiences to her children related to their meaningful life. Children develop their abilities on the basis of their mother’s advice.

MOA solves the optimization issues regarding the iterative process. The population of this algorithm consists of a solution of candidates in the solution space and it is indicated by the vectors. The values of decision variables are estimated based on each member of the population and the optimal solution is attained based on the search power. The installation process is mathematically explained in Eq. (2).

(2)

The term M is considered as the population matrix of MOA, the total number of population count is indicated by the term C, and the decision variables are denoted by m. Here, \(M_g=(m_{g,1},\cdots,m_{g,h},\cdots,m_{g,D})\) is the gth candidate solution and the term mg,h represents the hth variable. The term \(\zeta\) used in the initialization process signifies the random variable generated in the range between (0,1). But, in the proposed RF-MOA, it is evaluated on the basis of best and worst fitness. The lower and upper variables for hth the decision variable are indicated by the terms Prh and Rlh, respectively. The term OBh is considered as the objective function and it is evaluated through the population member of the decision variables. This objective function is helpful for identifying the best as well as the worst population members on the basis of the best and worst values. The position of the population members are required to be upgraded in all iterations therefore, the best member is also required to be upgraded.

Education stage: It is the first stage and it updates the population that is inspired by the education of the children. The exploration capabilities and the global search are increased by making required modifications in the location of the population members. In the MOA, the mother is taken as the best member and her way of behaving in her children is considered as the simulation of this education stage. New position of each member is generated in this phase, which is illustrated in Eq. (3).

(3)
(4)

The hth dimension of the gth population member position is denoted by mg,h, the hth dimension of the mother’s position is signified as Dh, and the new position estimated for the gth member of the population is denoted by \(M_g^{Q1}\) . Moreover, \(m_{g,h}^{Q1}\) is represented as the hth dimension, \(OB_g^{Q1}\) is indicated as the objective function and the term ϑ represents the random number chosen in the interval between (1, 2).

Advice stage: The misbehaving activities of the children are avoided by providing counselling in raising their children. This counselling is considered for employing the second stage of updating the population in MOA. This stage improves the capability of MOA in the global search as well as exploration based on the adjustment in the position of population members. The deviant behaviour is avoided in this phase, in which the bad behaviour is identified by comparing it with the objective function that is mathematically shown in Eq. (5).

(5)
(6)
(7)

The selected bad behaviour of the gth member of the population is signified as Sbadg,h and the bad behaviour of the gth member of the population is indicated as Badg the estimated new position for the gth member of the population is denoted as \(M_g^{Q2}\) and the term \(m_{g,h}^{Q2}\) indicates the hth dimension. Moreover, the fitness function is indicated by \(OB_g^{Q2}\) and the term ϑ represents the random number chosen in the interval between (1, 2).

Upbringing stage: Various forms of encouraging process are utilized by the mothers to improve the skills of the children in the education process. The ability of exploitation and the local search are increased by the upbringing stage by making some adjustments in the population member’s location. Here, a new position is generated for the position of all members on the basis of modeling the children’s personality development, which is the simulation of the upbringing phase. The position replacement process is elucidated in Eq. (8).

(8)
(9)

The estimated new position for the gth member of the population is denoted as \(M_g^{Q3}\) and the term \(m_{g,h}^{Q3}\) indicates the hth dimension. In addition, the fitness function is indicated by the term \(OB_g^{Q3}\) and the term \(\zeta\)(0.1) represents the random number chosen in the interval between (0.1).

Algorithm 1
figure z

Implemented RF-MOA

Weighted feature extraction using RF-MOA

The collected raw data \(Fs_v^{inp}\) are applied to the weighted feature extraction stage for attaining the most relevant features. This would be accomplished with the help of the proposed RF-MOA. The optimal selection of features and weights from the data maximizes the relief score during the feature extraction. The computationally intractable problems in the larger feature spaces are effectively handled with the help of these optimized weights and features. The prediction accuracy of the proposed scheme is enhanced by the preference of optimal features and weights. The fitness function of the developed scheme is to enhance the accuracy, which is given in Eq. (10).

(10)

The term Rlfscore indicates the maximized relief score during the extraction of features and the term \(Wt_b^{Sit}\) denotes the optimal selection of weights by using the proposed RF-MOA. The misclassified prediction results are highly minimized by the selection of optimal weights through RF-MOA. The relief score is used for providing rank to the extracted features. The feature score is measured based on the nearest neighborhood instant pair value between the same classes and different classes. The mathematical expression for calculating the relief score is provided in Eq. (11).

(11)

The weight vectors of the data are indicated by Wtb and the feature vectors are denoted by Fsb. The nearest same class instance is indicated by NRHitb and the closest instance for different classes is indicated as NRMisssb. The Euclidean distance between the same class and feature vectors as well as the different class and feature vectors are calculated to determine the relief score. The extracted weighted features are denoted by \(EF_b^{opt}\) . The schematic representation of optimal weighted feature extraction is shown in Fig. 4.

Fig. 4
figure 4

Structural depiction of optimal weighted feature extraction.

Deep feature extraction using DBN

The gathered data from the IoT devices \(Fs_v^{inp}\) are given to the deep feature extraction stage, where the DBN method is adopted for attaining the deep features. The amount of redundant data from the dataset is decreased by the extraction of deep features. The machine effort has been decreased with the support of this feature extraction.

DBN 26: The learning modules based on the generative neural networks are used for the construction of DBN, each of which is a Restricted Boltzmann Machine (RBM). The RBM contains the input and the hidden layer, where the input layer is helpful for receiving the data and the hidden layer is helpful for extracting the features in order to capture the input data’s higher-order correlations. The symmetrically weighted connection matrix, weight between the hidden-hidden and visible-visible connections is used for providing the connection between two RBM layers. The hidden units are made conditionally independent by this restriction. For the hidden unit h and the input unit r, the combined formulation of the energy is estimated and it is expressed in Eq. (12).

(12)

The weights between the visible and hidden units are indicated by the term ϖnm, the term φ is mathematically expressed as φ = (em, dnϖnm) the bias term of visible units is indicated by dn and the bias term of the hidden unit is indicated by em. The below Eq. (13) depicts the joint distribution.

(13)

The normalizing constant is indicated by the term NR(φ). For each input vector, the probabilistic value is assigned based on \(EN(r,h,\varphi)\) in the network. The conditional probability distribution is given in Eq. (14).

(14)
(15)

The standard deviation of the Gaussian variable is indicated by ϑ and the Gaussian distribution is indicated by the term F().The contrastive divergence is used for the learning of weights and this is updated based on Eq. (16).

(16)

The term χ represents the learning rate, rn is the input unit, and hn is the hidden unit. The RBM’s strength is estimated based on the original information’s restoration. The parameters to be learned are assumed as efficient when the model regains the original information. Enough information on the raw data has been preserved by the hidden units. For extracting the most relevant features, a single hidden layer is not enough in this DBN network. Hence, the RBM layer is also used as a feature extraction layer in DBN. From the final output layer of DBN, the features are extracted. The extracted features are indicated by \(EF_{d}^{Dp}\) . The DBN-based deep feature extraction process is illustrated in Fig. 5.

Fig. 5
figure 5

DBN-based extraction of deep features.

Advanced deep learning network for the prediction of water quality for aquaponic fish ponds

Convolutional autoencoder model

The water quality of the Aquaponic systems is effectively predicted with the support of the proposed MSCA-GRU model. Here, the multi-scale feature fusion network is integrated with the convolutional autoencoder and GRU for constructing MSCA-GRU. The description of the convolutional autoencoder is summarised as follows.

The benefits of unsupervised pre-training in autoencoders and convolutional filtering of CNNs are combined in the convolutional autoencoder27. The fully connected layers are replaced from the basic autoencoder and instead of convolutional layers and the deconvolutional layers are placed in the decoder section. The unpooling layer follows the deconvolutional layer, where two functions are carried out. During pooling, the location of the maximum values is stored and these locations are preserved during unspooling. The incorporation of convolution operation preserves the spatial locality at each neuron. The operation of the encoder is given in Eq. (12).

The input vector given to the encoder is indicated by H, the 2D convolutional operation is indicated by*, the activation function is signified by υ, the mth convolutional filter is signified by Gm and the encoder bias is signified as Bias. The zero padding is subjected to the input matrix H in order to retain the spatial resolution. The reconstruction factor is attained using the Eq. (12).

The reconstruction factor for mth input is indicated by the term Rcs, mth the convolutional filter in the decoder is indicated as \(\widetilde{G}^{m}\) , and the decoder bias is represented as \(\widetilde{B}ias\) . The minimization of loss function by applying unsupervised pretraining in the network is represented in Eq. (12).

After applying unsupervised pretraining to the unspooling and deconvolutional layers, the decoder network is replaced and the softmax classifier as well as the fully connected layers is included at the end of the network. The basic network structure of the convolutional autoencoder is depicted in Fig. 6.

Fig. 6
figure 6

Schematic representation of convolutional autoencoder.

Basic GRU

The GRU network is also utilized in the proposed deep learning-assisted water quality prediction scheme to provide efficient results during the detection of IoT data. In GRU28, the hidden layers present in the structure are connected at multiple times. The duplicate modules are presented in each recurrent neural network. The update as well as the reset gates is the two input gates present in the GRU model. The update gate is represented by the term UPsand the reset gate is denoted as Res The extent of information from the prior hidden states into the current state is controlled with the support of this update gate. Moreover, the extent of ignoring information from the prior states is controlled with the help of a reset gate in GRU. The reset gates are frequently activated to capture the short term and the update gates are frequently activated to accompany the long term dependencies in GRU. The functions to be performed in the GRU are given in the following expressions.

The term Res indicates the reset gate function, Ups represents the update gate function, \(\widetilde{h}id_s\) denotes the hidden layer representation and the term Ops indicates the representation of the output layer. The logistic sigmoid function used in the GRU is denoted by \(\xi\). The weight matrices learned from the reset, update and hidden state and output state are indicated by the terms wtRe, wtUp, \(wt_{\widetilde{h}id}\) and wto, respectively. The interconnected vectors in GRU are denoted by [] and the multiplication factor used in between the matrix elements is denoted as*. Finally, it produces the detection score for the water quality based on some observation metrics. The basic diagram of GRU is illustrated in Fig. 7.

Fig. 7
figure 7

Basic structural description of basic GRU model.

Proposed MS-CAGRU-based water quality prediction

For determining the water quality in Aquaponic fish ponds, the deep learning network named as MS-CAGRU is proposed that gives higher detection outcomes. The multi-scale fusion process is carried out in the network initially and then the convolutional autoencoder, as well as GRU, are integrated to provide the detection of attributes such as “dissolved oxygen, pH, temperature and humidity”. In addition, the level of nitrification, alkalinity, water hardness level, salinity, total dissolved solids, and light intensity are required to be determined for improving the growth rate of plants and fishes in the Aquaponic systems. These determinations of information are gathered through the usage of IoT-based sensors in the proposed model. On the basis of the predicted outcome of the level of water quality, alarm warnings are provided and control strategies are suggested to take immediate action in the Aquaponic fish ponds.

In this MS-CAGRU, the extracted weighted features using the proposed RF-MO \(EF_b^{opt}\) , extracted deep features from DBN \(EF_d^{Dp}\) and the original data \(Fs_v^{inp}\) are given as input. The weighted features are given to the first scale convolution process for the autoencoder, the extracted deep features are given as the second scale convolution in the autoencoder, and the raw data are subjected to perform the third scale convolution in the autoencoder. The feature obtained after the first scale convolution is signified as \(f1_{b*}^{en}\) the feature obtained from the second scale convolution is indicated by \(f2_{b*}^{en}\) and the feature achieved from the third scale convolution is noted by\(f3_{b*}^{en}\) . These features extracted from the encoder section of the autoencoder are concatenated to get the fused features. The fully connected layer of the autoencoder is replaced with the GRU for getting the improved prediction outcome. The fused features are further processed with the remaining layers of GRU. Finally, the prediction score is accomplished from the output gate of GRU. The multi-scale feature fusion gives a balanced outcome between speed and accuracy. The complex patterns are effectively identified through this proposed model. The schematic representation of the MS-CAGRU-based water quality prediction model in Aquaponic fish ponds is depicted in Fig. 8.

Fig. 8
figure 8

Prediction of water quality in Aquaponic fish ponds through proposed MS-CAGRU model.

Results and discussion

Experimental setup

Python software was used for designing the proposed water quality prediction model in Aquaponic fish ponds. The experimentation has been done for ensuring the performance of the implemented water quality prediction scheme among the previous works while analysing it with some evaluation measures. The maximum number of iterations to be taken was 50 and the count of population to be assumed for performing the experiment was 10, correspondingly. In addition, the chromosome length to be taken was the same as that of the number of features to be considered. The previously utilised algorithms like Eurasian Oystercatcher Optimization (EOO)29,, Water Strider Algorithm (WSA)30, Garter Snake Optimization (GSO)31, and MOA25were taken for the experimentation of the proposed scheme over the conventional works. The previously developed water quality prediction models like RNN24, LSTM23, Conditional Autoencoder CA27, and GRU28 were considered for the evaluation of performance.

Performance validation in terms of cost function

The water quality prediction outcome of the proposed model in Aquaponic fish ponds is validated in terms of cost function, which is shown in Fig. 9. The prediction outcomes prove that the cost function of the proposed RF-MOA-aided water quality prediction model has been attained with minimised cost function value of 6.54% than EOO, 5.66% than WSA, 3.84% than GSO and 2.91% than MOA for taking the number of iteration as 10. The lowest cost function ensures that the convergence of the proposed model is highly improved in the developed deep learning-based water quality prediction scheme than prior heuristic algorithms.

Fig. 9
figure 9

Comparative analysis of the proposed water quality prediction model among the conventional algorithms in terms of cost function.

Figure 9. illustrates a comparative analysis of the proposed work among the conventional algorithms in terms of cost function. It shows that the EOO algorithm starts with a higher cost function value of above 6.0 and drops significantly in the first 10 iterations to stabilise around 5.3 and then slowly drops to 5.1, becoming constant after 20 iterations. The WSA algorithm slowly starts with 5.5 and drops to 5.3 and becomes constant after 10 iterations. Similarly, the GSO algorithm starts with 6.4 and slowly drops to 5.6 and then finally becomes constant at 5.1 after 20 iterations. Furthermore, the MOA algorithm initially starts with a value above 7.0, gradually drops to 5.3 after 10 iterations and finally drops to 5.1 by around the 50th iteration.

The proposed RF-MOA water prediction model shows a minimised cost function, starting with a value of more than 7.0, gradually dropping to 5.4 by 10 iterations and finally reaches the minimised value which is around 5.0 and becomes constant. It exhibits exceptional performance, achieving higher accuracy in predicting the water quality.

ROC validation among prior works

The efficacy of the implemented deep learning-aided water quality prediction model has been analysed in accordance with the ROC curve provided in Fig. 10. The ROC validation has been conducted on the basis of metrics like true positive rate and true negative rate. The analysis outcome shows that the ROC of the suggested water quality prediction model has been attained with 8.33% than RNN, 6.25% than LSTM, 5.21% than CA and 2.08% than GRU for the true positive rate of 0.1. The improved ROC results describe that the accuracy is highly improved than the prior works.

Fig. 10
figure 10

ROC curve evaluation of the suggested IoT-aided water quality prediction scheme in Aquaponic fish ponds among conventional models.

Figure 10. presents a comparative analysis of the proposed water quality prediction model against conventional models. The CA model achieved an Area Under the Curve (AUC) value of around 0.93—0.94. The GRU model exhibited AUC value of around 0.92—0.93. Similarly, the LSTM model achieves the AUC value of around 0.91—0.92. Furthermore, the RNN model showed AUC value of around 0.90—0.91.

The proposed water quality prediction model exhibits strong performance with the highest AUC value of 0.94—0.95 in comparison with conventional models. It demonstrates steep vertical rise in the 0.01 false positive range. Similarly, it achieves approximately 0.85—0.90 true positive rate with only about 0.1 false positive rate. This indicates strong confidence in positive predictions with minimum false alarms. In the low FPR region, the proposed model shows strong performance with high precision, in the middle range region, steady improvement is shown. Finally, in the high FPR region, well calibrated predictions are demonstrated. Overall, the proposed water quality prediction model is efficient in handling sequential data with better feature extraction and attention mechanisms.

Performance analysis of water quality prediction outcomes

Several positive and negative measures are taken for the computation of effectiveness over the previously developed water quality prediction models in Aquaponic fish ponds are showcased in Fig. 11. The comparative examination is done in terms of K-fold for differentiating the models very effectively. The precision rate of the proposed water quality prediction model has been greatly enhanced with 2.53% than RNN, 3.53% than LSTM, 1.52% than CA, and 1.21% than GRU for taking the K-fold value as 1. The entire validation measures pose an improved prediction rate than the baseline works while detecting the water quality in Aquaponic systems.

Fig. 11
figure 11figure 11

Performance evaluation of the proposed IoT-aided water quality prediction scheme in Aquaponic fish ponds among conventional models (a) Accuracy (b) F1-score (c) FNR (d) NPV (e) FPR (f) MCC (g) Recall (h) Specificity (i) FDR (j) Precision.

Performance comparison of RF-MOA with other optimization algorithms using convergence speed metrics

The RF-MOA can be effectively compared to other optimization algorithms by assessing its convergence speed through two key metrics, one is Iterations to Convergence and Time to Convergence. Table 2 provides performance comparison of optimization algorithms in terms of convergence RF-MOA achieves convergence in an average of 30 iterations within a threshold of 0.01, due to its flexible search strategy. In contrast, the Genetic Algorithm (GA) typically requires 50 iterations, while Particle Swarm Optimization (PSO) takes about 45 iterations and can struggle with local minima. Ant Colony Optimization (ACO) averages around 40 iterations, and Differential Evolution (DE) needs about 35 iterations, whereas Simulated Annealing (SA) often requires 60 iterations. In terms of time, RF-MOA reaches optimal solutions in an average of 12 s, showcasing its efficiency. In contrast, GA typically takes 25 s, PSA requires about 20 s, ACO averages 30 s, DE takes 22 s and SA has an average convergence time of 28 s.

Table 2 Performance Comparison of Optimization Algorithms in terms of Convergence.

Performance computation in terms of various metrics

The performance of the water quality prediction scheme is validated with respect to several validation metrics among the previous models are given in numerical form in Table 3. The recall measure of the implemented water quality prediction scheme in Aquaponic systems is improved by 4.23% to RNN, 5.83% to LSTM, 2.73% to CA and 2.44% to GRU. Overall prediction outcome of the implemented scheme is highly enhanced than the previous algorithms.

Table 3 Optimal weighted feature selection performance of the implemented scheme in aquaponic Fish Ponds among conventional algorithms.

Performance of weighted features among conventional algorithms

The following Table 4 shows the evaluation outcomes of the optimal weighted feature selection using RF-MOA in Aquaponic ponds when compared to the conventional heuristic strategies. This optimal selection improves the relief score during the selection of features and hence the prediction effectiveness of the implemented scheme is highly improved. The MCC of the developed quality prediction model has been attained with a greater value of 12.43% than EOO, 9.84% than WSA, 9.56% than GSO and 4.49% than MOA. The analysis results show that the performance of the water quality prediction outcome is greatly enhanced.

Table 4 Statistical Validation of the Proposed Model in Aquaponic Fish Ponds Among Baseline Research Works.

Statistical analysis of various algorithms

A statistical report of the proposed water quality prediction model is illustrated in Table 5. The mean value of the developed quality prediction model has been attained with 3.86% improved than EOO, 1.37% progressed than WSA, 0.62% greater than GSO and 0.79% improved than MOA. The statistical report proves that the prediction efficacy of the implemented scheme is highly enriched than the traditional heuristic strategies.

Table 5 Water Quality Prediction Performance of the Proposed Model in Aquaponic Fish Ponds Among Baseline Research Works .

The RF-MOA and MS-CAGRU offer several advantages over the existing approaches, RF-MOA optimises the model more efficiently by balancing exploration and exploitation, enhancing its ability to escape local optima and achieve global integration, this results in improved optimised precision. Similarly, the MS-CAGRU integrates a GRU architecture with a multi-scale feature fusion-based convolutional autoencoder (MFFCA). This combination allows it to capture complex temporal dependencies in sequential data and model both short-term and long-term trends. This overcomes limitations in conventional models, which struggle with temporal complexity. Additionally, the model incorporates L1,L2 regularisation, dropout layers and cross-validation techniques to prevent overfitting even on small datasets, by controlling model complexity and improving generalisation. This ensures more stable and accurate predictions in scenarios with limited data, making it well suited for real world, noisy data.

Despite the promising performance and enhanced accuracy of the water quality prediction model, it faced challenges in few cases in certain cases. For instance, the model was trained on specific aquaponic systems particularly water quality parameters such as pH, dissolved oxygen and temperature. While the model outperforms the conventional algorithms, its ability to generalise to different aquaponic systems with different environmental conditions, crop types and water management techniques is a challenge. The integration of GRU networks with MFFCA increases the computational load. The model demands substantial computational resources, including high memory and processing power, particularly for training on time-series data. The computational cost or complexity can be challenging factors to address.

Conclusion

A new water quality prediction system in Aquaponic fish ponds has been developed using IoT integrated deep learning strategy to determine the water quality attributes to improve the growth rate of plants and fishes. The IoT-based sensors were used for the collection of datasets from the Aquaponic fish ponds. These acquired data were subjected to the retrieval of features, where the weighted features were attained through proposed RF-MOA and the deep features were attained through DBN. These extracted features along with the raw data were given to the prediction stage, where the MSCA-GRU model was used for the water quality prediction. The rate of dissolved oxygen, temperature, humidity and pH level were estimated for predicting the quality of water. This might improve the growth rate and hence, the computation cost required for the system was greatly minimised. The prediction outcome obtained from the model has been verified by performing the experimental analysis and the results were demonstrated that the accuracy measure of the implemented water quality prediction scheme in Aquaponic systems was improved with 4.25% than RNN, 5.83% than LSTM, 2.73% than CA and 2.45% than GRU. The quality of the water has been effectively predicted by this proposed scheme by analysing the feature dependencies from the given data.