Prediction and Control of Water Quality in Recirculating Aquaculture System
Prediction and Control of Water Quality in Recirculating Aquaculture System
1. Introduction range of water treatment units. RAS not only has the advantages of
water saving, land saving, energy saving and emission reduction, but
Aquaculture products are popular among consumers because of also driven by the intelligent of aquaculture equipments and the refined
their low fat content, tender meat and various nutrients (such as development of aquaculture models (Peng et al., 2022b). RAS can break
protein, phosphorus, vitamins and inorganic salts). This situation has through geographical and climatic restrictions, and greatly improve
driven the rapid development of the global aquaculture industry (Li the production and supply capacity of high-quality fresh aquaculture
et al., 2022). However, with the strategic needs for efficient supply
products, which meet the growing demand of the people for safe,
of high-quality protein and food safety in the world. The traditional
healthy and high-quality protein. In addition, it can also provide a
aquaculture model (an extensive aquaculture model that relies on
stable, reliable, comfortable and high-quality living environment for
manpower) cannot meet this demand Peng et al. (2022a). Fortunately,
aquaculture organisms. Although RAS is more efficient, energy-saving,
Recirculating Aquaculture Systems (RAS) are being promoted (Munubi
et al., 2022) and developed on a large scale. As RAS is suitable for the environmentally friendly and safe, there are still some problems that
concept of sustainable and healthy development of modern fisheries. cannot be ignored (Zhao et al., 2022).
The RAS is a new type of aquaculture mode, in which the sewage from One of the biggest factors affecting the effect of aquaculture is the
the tanks is treated (Calderini et al., 2021) and re-circulated with a water quality (Zhang et al., 2011; Crouse et al., 2022), which affects the
∗ Corresponding author.
E-mail addresses: [email protected] (J. Yang), [email protected] (L. Jia), [email protected] (Z. Guo), [email protected] (Y. Shen),
[email protected] (X. Li), [email protected] (Z. Mou), [email protected] (K. Yu), [email protected] (J.C.-W. Lin).
https://doi.org/10.1016/j.engappai.2023.106002
Received 14 September 2022; Received in revised form 30 January 2023; Accepted 13 February 2023
Available online 1 March 2023
0952-1976/© 2023 Elsevier Ltd. All rights reserved.
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
growth and development of aquaculture objects. Recirculating aquacul- prediction effect. This enables the advantages of a single model to
ture tailrace belongs to micro-pollution wastewater. Tailrace treatment be fully exploited. Zhang et al. (2022) coupled an empirical mode
requires the design of a series of operating units including physical and decomposition (EMD)-centred pre-processing module with an LSTM. An
biological filtration (Munubi et al., 2022), comprehensive treatment integrated EMD-LSTM model is proposed to increase the accuracy of
of air flotation, sterilization, aeration etc. It is difficult to work in the testing method. Barzegar et al. (2021) used a variety of methods to
the water treatment (Holan et al., 2020) phase because of the diverse pre-process the data and used a combined CNN and LSTM model, which
and interrelated processes of the water treatment units. In the actual improved the prediction performance of Lake Michigan and Lake On-
aquaculture process, equipment for direct monitoring of water quality tario WLs. Guo et al. proposed a prediction and control framework (Guo
is expensive. The manual testing method (Wawrzyniak et al., 2021) not et al., 2020) combining CNN and Recurrent Neural Network (RNN) to
only takes a long time to detect, but also produces pollution during predict wastewater treatment process (WTR). It is proposed to connect
the testing process. When adverse changes in water quality are found, several forecasting models to form a hybrid model. Pan et al. predict
traditional mechanical models are used to make response strategies. the water level of the Yangtze River using a CNN-GRU model (Pan
The method increases the complexity of aquaculture water treatment et al., 2020). Marjani et al. Faraji et al. (2022) proposed a predictive
by involving humans in the modelling and calculations (Chen et al.,
model combining a three-dimensional CNN and a GRU (3D CNN-GRU).
2022). Also, the lack of timely water treatment affects the culture-
This model is used to predict the hourly and daily time intervals of
cycle and aquaculture results, and the aquaculture cost is increased.
new PM2.5 concentrations with good results. The results show that the
RAS technology at current stage is required to be improved due to
combined model is significantly better than CNN or GRU model.
the development of society and green aquaculture. Therefore, water
Although the combined model solves the problem that a single
treatment technology also needs to be improved and innovated (Ren
model has limitations in improving the prediction effect, some com-
et al., 2020). As the timeliness and efficiency of traditional aquaculture
technologies are not strong, RAS needs to intervene in advance in the bined models can only make reasonable predictions in the short term
water treatment stage. That is, to predict the water quality and perform (Guo et al., 2022b). If the prediction time is long, the connections
the control process in time. In this paper, we control and regulate between neurons become weaker due to the long interval, which results
the water quality by predicting the water quality, so as to achieve poor prediction. Moreover, some research only starts from microor-
the timely regulation of the water quality in the aquaculture process, ganisms, organic matter or chemical elements. The control difficulty
which finally improve the timeliness and efficiency of aquaculture. The of the control unit will be increased. More importantly, most of the
realization of this purpose requires the use of intelligent methods and existing research (Wang et al., 2022; Grbčić et al., 2022; Bi et al.,
models (Ta and Wei, 2018) to obtain the ideal prediction results, so 2021) on the combined model covers sewage treatment and urban
as to quickly and accurately control and adjust the water quality of water treatment, and has not been applied to new RAS. And these
recirculating aquaculture. studies only predict the indicators of pH, temperature, and dissolved
With the development of new technologies, researchers have ex- oxygen (DO), and do not associate the relevant parameters with each
plored the artificial intelligence (AI) (Crafts, 2021). Researchers have other. The prediction results are not convincing in RAS. Most of RAS
integrated intelligent models and methods into traditional industries, is used for high-density aquaculture, and the quality of water quality
further promoting the development. The deep learning approach used is particularly important. Moreover, the various technical units of RAS
in AI is able to discover correlations and characteristic points from large will interact, it is difficult to control water quality. Many factors such
amounts of data. This extracted information enables the prediction of as changes in equipment, technology and water quality over a period
future changes in the data (Li et al., 2021) for industrial applications. of time need to be considered. When the water quality changes, the
For RAS, the deep learning method can better extract features from circulating water flow, circulating water velocity and water level are
a large variety of aquaculture water quality data. Aquaculture water adjusted according to the trend of water quality changes in the next
bodies can also be more easily monitored. time period. Moreover, the method of multi-parameter prediction of
Since the concept of data prediction was put forward, many re- water quality is challenging. Therefore, when we predict the water
searchers have tried various methods to predict data. The prediction of quality of RAS, factors such as the complexity of the model, the number
various marine water quality parameters using Wavelet Neural Network of data features, and the time series need to be considered.
(WNN) and Artificial Neural Network (ANN) (Alizadeh and Kavianpour, To address this issue, this study attempts to extract the data features
2015) was applied by Mohamad et al. Liu et al. proposed an integrated
of the data collated from previous water quality of RAS. Then the
Auto Regressive (AR) prediction model (Liu et al., 2021) which was
characteristics of each parameter are combined with the overall state
built on Markov switching (MS) strategy and Improved Crow Search
of the system to achieve the precise prediction of water quality in RAS.
Algorithm (ICSA) to predict changes in 𝐶𝑂𝐷𝑀𝑛 (permanganate index)
A prediction and control framework with the mixture of CNN, GRU
in the Yongding River in northern China. Krzysztof and Maciej (Zarzy-
and Attention (PC-CGA) is presented in this paper. The first part of the
cki and Ławryńczuk, 2022) proposed a model predictive control (MPC)
hybrid model is CNN. CNN contains convolutional layers and pooling
algorithm, which uses Long Short-Term Memory (LSTM) and Gated
layers. Since this paper relates multiple parameters to each other for
Recurrent Unit (GRU) for prediction (Guo et al., 2022a). In the end,
prediction, a CNN model needs to be added to process and extract the
they also proposed a simpler GRU network. Jiang et al. (2021) use a
deep learning approach to study the influence of multi-source of urban features in the data. This can better discover the correlation between
data on water quality prediction in sewage networks. The results show these parameters, so as to predict different parameter information.
that GRU has better predictive power and a faster learning curve for When predicting the data of the next timestamp based on the data of
water chemistry indicators. Hu et al. proposed an LSTM-based water the previous period of time, GRU is used to process the time series
quality prediction model (Hu et al., 2019) for predicting pH and water factors of the data. The feature vectors processed by CNN are input
temperature. Optimization of the LSTM was implemented by Song et al. to the GRU for sequential representation to better predict the water
The best working conditions and parameters for the LSTM were found quality parameters of the next time stamp. Attention (Lv et al., 2022)
using the model (Song et al., 2021). Adaryani et al. (2022) compared is responsible for focusing on more critical information, solving the
the performance of three rainfall prediction methods, including PSO problem of information overload, and improving the efficiency and
support vector regression (PSO-SVR), LSTM, and convolutional neural accuracy of predictions. Finally, the forecasting results obtained and
networks (CNN). However, there are still limitations to the improved analysed to assess the stability and validity of the predicting model
single prediction model in effect of improving predictions. Researchers developed. The main contributions of this paper are summarized as
have tried to mix multiple prediction models to improve the model follows:
2
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
• A recirculating aquaculture system with intelligent control is pre- The biofilter achieves ‘‘microfiltration-nitrification-denitrification’’ of
sented in this paper, in which precise oxygen control, intelligent nitrogen in RAS, and solves the problem of denitrification of aquacul-
feeding, and water quality control are implemented based on ture recirculated water with high DO and low carbon nitrogen ratio.
multi-source sensor data. To achieve the objective of the pre- The final ozone-disinfected (Schroeder et al., 2011) recycled water is
cise water quality control, a water quality prediction model is circulated into the aquaculture tanks. The RAS is capable of maintain-
proposed. ing stable and good water quality in aquaculture. The probe used for
• Considering the temporal characteristics of water quality param- water quality testing can continuously monitor the water quality of
eters in RAS, a hybrid neural network with the mixture of CNN, aquaculture and display it on the Liquid Crystal Display (LCD) screen.
GRU and Attention (PC-CGA) is proposed, which can automati- Bottom aeration is selected as the aeration method of the tanks to
cally predict the processing results according to the water quality provide the oxygen demand of the fish (Yang et al., 2022). In this
parameters from sensors. RAS, we make accurate predictions of aquaculture water quality. To
• In order to evaluate the stability and effectiveness of the proposed guarantee that the system is able to make timely adjustments when
hybrid neural network, we have conducted numerous experi- changes occur in the aquaculture water.
ments based on the actual data obtained from a medium-size RAS
built by our research group. 2.2. Problem statement
The rest of paper is organized as follows. Section 2 is an introduction To achieving stable growth of fish in a RAS, the aquaculture envi-
to RAS and a statement of the research problem. Section 3 provides ronment is an object that cannot be ignored. Among them, the water
the theoretical explanation of the proposed method. In Section 4, we quality of aquaculture is a factor that directly affects the aquaculture
conduct multiple sets of experiments to compare with baselines and objects. Therefore, the conditions of the aquaculture water bodies are
individually test the prediction effect of the proposed model on the data predicted. As the RAS is a continuous cycle of recirculating water,
set. Finally, a conclusion is made to summary the whole paper. each parameters of water quality in different tanks, without major
differences. So small that we can assume by default that the water
2. Overview quality is the same in all tanks. There are many factors that affect
water quality. This paper determines the status of the aquaculture
2.1. Recirculating aquaculture systems water by monitoring several parameters: nitrite nitrogen (NO2 − ), ni-
trate nitrogen (NO3 − ), pH, Total Nitrogen (TN), temperature, Dissolved
The data used in the experiments in this paper are all from the Oxygen (DO), Chemical Oxygen Demand (COD) and ammonia nitrogen
laboratory medium RAS. The main process chart of the RAS is shown (NH3 -N) . Among them, NH3 -N and COD are important indicators to
in Fig. 1. Most of units can be controlled through the total system. determine the quality of aquaculture water quality, and also directly
Aquaculture water is continuously recirculated in the system with a affect the growth status of aquaculture objects. So with these data
certain flow rate. The aquaculture water flows from the aquaculture available, NO3 − , NO2 − , pH, temperature, TN and DO are selected to
tank to the microfilter (Fernandes et al., 2015), which removes the predict the values of NH3 -N and COD. To achieving rapid and accurate
larger suspended and floating materials from recirculated water. After prediction of water quality for RAS. A timely adjustment in the event of
the first treatment, the recirculated water enters the regulating tanks. abnormal water quality. Under the conditions of ensuring the normal
The regulating tanks play the role of regulating water volume, balanc- operation of RAS physical and biological filtration units. It is regulated
ing water quality and pre-treatment. The function of the circulating by intelligent control of the recirculating water flow rate, recirculating
pump is to ensure the proper circulation of the recirculated water. The water exchange rate and water level to ensure the safe survival of
recirculating water is then pumped into the biofilter, which uses a new the aquaculture objects. This study has given a new idea to the RAS
aerobic PPC (Poly propylene carbonate)-filled Moving Bed Biological water quality treatment problem, and makes new contributions to the
Reactor (MBBR) (Xue et al., 2022) to treat the recycled water quality. intelligent control of RAS.
3
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
4
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
( [ ]) ∑
𝑟𝑡 = 𝜎 𝑊𝑟 ∙ ℎ𝑡−1 , 𝑝𝑡 (5) 𝑐𝑡 = 𝛼𝑡𝑠 ℎ𝑠 (10)
𝑠
where, 𝜎 is the sigmoid function, this function allows the data to be
converted to a value in the range 0 ∼ 1, thus acting as a gating signal. Final calculation of the Attention vector:
𝑊𝑡 , 𝑊𝑟 represents the weight, and ∙ is the element-wise multiplication. ( ) ( [ ])
𝑎𝑡 = 𝑓 𝑐𝑡 , ℎ𝑡 = tanh 𝑊𝑐 𝑐𝑡 ; ℎ𝑡 (11)
𝑧𝑡 is the update gate, the range is 0 ∼ 1. When the gating signal
tends to 1, it means that long-term dependence always exists. And The above equation describes the process of combining 𝑐𝑡 with ℎ𝑡 .
when it tends to 0, it means that some unimportant information in These correspond to the processes of combining C1 with H7 and C2
the hidden message is forgotten. 𝑟𝑡 is the reset gate, which is used to with H8 in Fig. 4. From the above four formulas, we can find that
determine whether the candidate activation should drop the previous the hidden state in the decoder is used twice. The first time is used
activation ℎ𝑡 . When 𝑟𝑡 approaches 0, the model will discard the hidden in finding the weight 𝛼𝑡𝑠 , and the second time is used in the step of
information in the past, leaving only the current input information. combining with 𝑐𝑡 to generate 𝑎𝑡 .
When 𝑟𝑡 approaches 1, the past information is considered useful and
added to the current information. 3.4. CNN-GRU-attention model
Reset gate candidate hidden layer state:
( [ ]) In this paper, the framework of the PC-CGA established is shown
̃
ℎ𝑡 = tanh 𝑊 𝑝𝑡 ∙ 𝑟𝑡 ∗ ℎ𝑡−1 , 𝑝𝑡 (6) in Fig. 5. The 𝑡th timestamp, the water quality parameter input 𝑋𝑖,𝑗
where ℎ𝑡−1 contains past information, ∗ indicates multiplication, and (𝑖 = 1, 2, 3, 4, 5, 6, 7, 8) represents one of the water quality parameters in
𝑊 indicates weighting. each group, and 𝑗 (𝑗 = 0, 1, 2, 3 ⋯ 𝑛) represents the group. The feature
Update gate final hidden state: matrix 𝑋 (𝑡) is the total set of this 𝑋𝑖𝑗 , and will be fed into the prediction
( ) framework. The CNN model is first implied for feature extraction, and
ℎ𝑡 = 1 − 𝑧𝑡 ∗ ℎ𝑡−1 + 𝑧𝑡 ∗ ̃ ℎ𝑡 (7) the extracted feature matrix is noted as 𝑃 (𝑡). Then the matrix 𝑃 (𝑡) is
[ ] used as the input of the GRU model. ℎ (𝑡) as the state vector is the result
̃
[ ℎ𝑡 receives
] 𝑝𝑡 , ℎ𝑡−1 , ℎ𝑡 is the hidden layer of the GRU and receives
of the GRU unifying the internal state vector with the output vector.
ℎ𝑡−1 , ̃
ℎ𝑡 . Then hidden layer vector ℎ (𝑡) is entered into Attention. The Attention
passes all the hidden states from the encoder into the decoder after
3.3. Attention mechanism the weighted summation, focusing on the more critical information
and improving the efficiency and accuracy of the prediction. The final
Attention mechanisms originated from RNN models applied to Natu- output is noted as 𝑅 (𝑡). Through the above process of deep learning,
ral Language Processing (NLP). Attention Mechanism can give different the PC-CGA model was trained. When a new timestamp is entered for
weights to each section of the input model, extracting the key and vital the aquaculture water quality, the model will automatically predict the
information (Tian et al., 2022). While the model makes more accurate water quality result 𝑅 (𝑡) for the next timestamp.
judgments, the calculation and memory of the model have no greater A combined CNN-GRU-Attention model was selected for training
cost. of water quality parameters with time series, which is important for
It is noteworthy that attention requires all the hidden states in the achieving water quality prediction and control. Firstly, the features of
encoder to be passed into the decoder. In this paper, when the decoder data is extracted by CNN. In this paper, we uses the convolutional and
predicts the 𝑖th data of the 𝑗th group in the sequence. It is necessary pooling layers of CNN. Convolutional layers enable neural networks to
to calculate the hidden state of the 𝑖th data in the decoder and the share weights, be able to sense locally, and begin to abstractly under-
hidden state of each encoder. A set of score is calculated (the score is stand the data hierarchically. The role of the pooling layer is to choose
a vector and should be the same length as the number of hidden states features within the network and decrease as many features as possible,
5
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
thereby cutting down on the amount of parameters and computational improvement of water quality cannot be completely solved by replacing
cost. Each channel of the feature matrix is worked on independently the water volume. And due to the recycling of aquaculture water, the
by the pooling operation, giving a reduction to all feature matrix size. water quality are basically the same from tank to tank, and the error is
Because water quality parameters are data with long time series, a GRU within the permissible range. Therefore, our prediction of water quality
is used to catch dependencies with large intervals over time sequences. is a prediction of the overall situation, and the regulation based on the
The structure of GRU is relatively simple, which can better capture prediction results is also an overall regulation.
deep connections and improve the problem of gradient disappearance. To achieving stable prediction results, we conducted a large num-
Then, we choose the Attention mechanism to focus on more critical ber of experiments, which lasted 61 days. As RAS is generally more
information. Attention mechanism can redistribute weights according stable than other aquaculture models. Apart from system failures, the
to the significance of features in long sequences. A correlation is found aquaculture units do not change drastically within a short period of
according to the raw data and then certain important features are time. Therefore, we take 72 water sample results every day and retain
focused, ignore unimportant features, and improve the efficiency and the water samples, which are used for manual verification when the
stability of model prediction. experimental data are significantly different. For example, the water
quality results are extracted and saved every 20 min, with a total of
4. Evaluations and analysis 4392 samples of data.
There are a variety of indicator parameters for water quality, and
4.1. Data pre-processing only a selection of representative parameters are used as data sets
in this paper. There are 8 parameters in total, namely NH3 -N, NO3 − ,
The water quality of RAS is one of the key factors which directly NO2 − , pH, temperature, COD, TN and DO. We have separately inte-
affect the aquaculture effect. Although the RAS is in a continuous grated each set of data into a dataset, applying mean complements to
circulation mode, in order to ensure the quality of aquaculture, the missing data. Since COD and NH3 -N are the key parameters to observe
recirculating water volume cannot be too large or too small. So the the quality of water quality, we mainly predict COD and NH3 -N. We
6
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
7
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
Table 1
The Performance of COD Prediction with different learning rate.
Learning rate PC-CGA LSTM GRU
MAE MSE RMSE MAE MSE RMSE MAE MSE RMSE
0.001 0.2405 0.1218 0.3491 1.1848 3.8998 1.9747 10.4255 200.9332 14.1751
0.0005 1.9400 10.7550 3.2794 29.7452 1121.9956 33.4962 10.8377 216.4317 14.7116
0.0001 2.4445 12.4781 3.5324 2.1255 46.2819 6.8030 11.0688 232.5479 15.2495
0.00001 9.9580 199.1972 14.1137 29.7400 1121.9956 33.4962 15.5785 445.5094 21.1071
Table 2
The Performance of NH3 -N Prediction with different learning rate.
Learning rate PC-CGA LSTM GRU
MAE MSE RMSE MAE MSE RMSE MAE MSE RMSE
0.001 0.2405 0.1218 0.3491 1.1848 3.8998 1.9747 10.4255 200.9332 14.1751
0.0005 1.9400 10.7550 3.2794 29.7452 1121.9956 33.4962 10.8377 216.4317 14.7116
0.0001 2.4445 12.4781 3.5324 2.1255 46.2819 6.8030 11.0688 232.5479 15.2495
0.00001 9.9580 199.1972 14.1137 29.7400 1121.9956 33.4962 15.5785 445.5094 21.1071
Fig. 8. The Performances of COD prediction with different learning rate: (a) 0.001, (b) 0.0005, (c) 0.0001, (d) 0.00001.
expression. Thirdly, the Attention mechanism focuses on more critical continues to outperform both baselines when changing the proportion
information, which improves the efficiency and accuracy of prediction. of the training set.
Thus, the group of experiments showed the superiority of the mixture To better compare the performance of several models, Figs. 10 and
of CNN, GRU and Attention. 11 show the performance of PC-CGA with different proportions of the
After setting the parameters, learning rate and batch size to values, training set (60%, 70%, 80% and 90%). It shows that the performance
the proportions of the training set is set to 60%, 70%, 80% and of the three methods is generally stable in this set of experiments.
90%, respectively. Tables 3 and 4 present the performance of PC-CGA, Apart from that, the proposed PC-CGA still outperforms the baseline
LSTM and GRU under different proportions of the training set. Among, regardless of the scale setting of the training set. As an example, observe
Table 3 shows the performance of COD prediction, and Table 4 shows the value of the RMSE for predicting NH3 -N. The proposed PC-CGA has
the performance of NH3 -N prediction. Comparing the evaluation results the best RMSE of 0.0176, the LSTM has the best RMSE of 0.3719, and
in Tables 3 and 4, it is easy to see that the performance of PC-CGA the GRU has the best RMSE of 3.1342. The above results show that the
8
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
Fig. 9. The Performances of NH3 -N prediction with different learning rate: (a) 0.001, (b) 0.0005, (c) 0.0001, (d) 0.00001.
Table 3
The Performances of COD prediction with different proportions of training set.
Training data proportion PC-CGA LSTM GRU
MAE MSE RMSE MAE MSE RMSE MAE MSE RMSE
90% 0.0571 0.0054 0.0741 11.2309 237.6829 15.4169 10.6838 211.0322 14.5269
80% 0.0332 0.0025 0.0509 1.3703 10.7758 3.2826 10.7166 212.1833 14.5665
70% 0.2405 0.1218 0.3491 1.1848 3.8998 1.9747 10.4255 200.9332 14.1751
60% 0.3066 0.1708 0.4133 5.0458 83.7240 9.1500 10.7160 211.7130 14.5504
Table 4
The Performances of NH3 -N prediction with different proportions of training set.
Training data proportion PC-CGA LSTM GRU
MAE MSE RMSE MAE MSE RMSE MAE MSE RMSE
90% 0.0115 0.0003 0.0176 0.2213 0.1383 0.3719 0.7607 9.8239 3.1343
80% 0.6538 8.1714 2.8585 0.7987 10.7837 3.2838 0.7289 9.8311 3.1355
70% 0.0091 0.0003 0.0189 0.2453 0.1393 0.3733 0.7612 9.8232 3.1342
60% 0.0868 0.0225 0.1501 0.2360 0.1682 0.4101 0.7297 9.8248 3.1345
proposed PC-CGA has little difference in predicting COD and NH3 -N. In focuses on more critical features. This comprehensive construction of
addition, when PC-CGA predicts COD, the prediction effect is best when the feature space makes it robust to different scenarios. It may also be
the proportion of training set is set to 80%. The values of MAE and that the prediction of COD and NH3 -N with six sets of parameters is
RMSE are 0.0332 and 0.0509, respectively. Similarly, when predicting reliable and accurate in predicting both parameters.
NH3 -N, the model prediction effect is best when the proportion of To demonstrate the parameter sensitivity of the PC-CGA framework
training set is set to 70%, The values of MAE and RMSE are 0.0091 proposed in this paper. Experiments were carried out on the PC-CGA
and 0.0189, respectively. This shows that PC-CGA is set to different alone. Without comparison with other baselines, by modifying the
proportion of training set, and the prediction results of COD and NH3 - parameters several times. Figs. 12 and 14 show the MAE results and
N can be the best. But looking closely at Figs. 10 and 11, when the RMSE results of PC-CGA prediction of COD under different parameters.
proportion of the training set is set to 90%, the prediction effect of Figs. 13 and 15 show MAE and RMSE of PC-CGA for NH3 -N prediction
COD and NH3 -N is very good. This may be due to the fact that the with different parameters. These four general figures all contain three
proposed PC-CGA considers both the local and global feature space and subfigures. The subfigures correspond to the results of the combination
9
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
Fig. 10. The Performances of COD prediction with different proportions of training set: (a) 80%, (b) 60%, (c) 70%, (d) 90%.
Fig. 11. The Performances of NH3 -N prediction with different proportions of training set: (a) 70%, (b) 60%, (c) 80%, (d) 90%.
10
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
Fig. 12. MAE of PC-CGA for COD prediction with different parameters: (a) change of learning rate and training data proportion, (b) change of batch size and training data
proportion, (c) change of batch size and learning rate.
Fig. 13. MAE of PC-CGA for NH3 -N prediction with different parameters: (a) change of learning rate and training data proportion, (b) change of batch size and training data
proportion, (c) change of batch size and learning rate.
Fig. 14. RMSE of PC-CGA with COD prediction with different parameters: (a) change of learning rate and training data proportion, (b) change of batch size and training data
proportion, (c) change of batch size and learning rate.
Fig. 15. RMSE of PC-CGA for NH3 -N prediction with different parameters: (a) change of learning rate and training data proportion, (b) change of batch size and training data
proportion, (c) change of batch size and learning rate.
of the three factors, respectively: learning rate and training data pro- how the parameters change, the prediction results will not be very
portion, batch size and training data proportion, and batch size and different and can be maintained at a stable level.
learning rate. It can be directly observed from these figures that under In addition to the MAE and RMSE results obtained from the above
different parameters. The results of PC-CGA basically do not change experiments, we also discuss the R2 of the PC-CGA framework. R2 is
greatly, and the model has a certain stability. It can be shown that PC- used to determine the quality of the methods. Greater R2 means a
CGA comprehensively extracts local and global features of RAS water better model fit. Figs. 16, 17 and 18 show R2 of the PC-CGA with
quality data and focuses on more critical features. Therefore, no matter different parameter, respectively. The two curves in the three figures
11
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
Fig. 16. R2 of PC-CGA with different learning rate and training data proportion: (a) 90%, (b) 60%, (c) 70%, (d) 80%.
Fig. 17. R2 of PC-CGA with different batch size and training data proportion: (a) 80%, (b) 60%, (c) 70%, (d) 90%.
12
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
Fig. 18. R2 of PC-CGA with different batch size and learning rate: (a) 0.0008, (b) 0.001, (c) 0.0005, (d) 0.0001.
represent the predicted R2 results for COD and NH3 -N. It can be seen
from the above three figures that the PC-CGA water quality prediction
framework proposed in this paper has a minimum value of R2 of
0.71548 and a maximum value of 0.99627 when predicting COD, and
R2 is greater than 0.9 in most cases. When predicting NH3 -N, the
minimum value of R2 is 0.72668, the maximum value is 0.99448, and
most of R2 are greater than 0.9. Therefore, the fitting effect of the
proposed PC-CGA is generally good, and it is more credible in water
quality prediction.
As shown in Figs. 12–18, we can find that when PC-CGA with a
learning rate of 0.001, a training set proportion of 90%, and a batch
size of 8, the prediction is relatively stable. We set the parameters to
the values when the prediction effect is best, and show the visualization
results of the predicted COD and ammonia nitrogen. As shown in
Figs. 19 and 20. The steel blue curves represent the true values of
COD and NH3 -N on the test set and the dark red curves represent the
predicted values. Judging from the visualization results in the figure,
the actual prediction results of PC-CGA are good. Fig. 19. The predicted values and truth of COD on the test set.
We set the learning rate of PC-CGA to 0.001, the proportion of
training set to 90%, and the batch size to 8 to predict the water quality
of RAS. When the trend of water quality changes abnormally in the We applied PC-CGA to the RAS for practical experiments. Finally, the
next month, we formulate corresponding control strategies to regulate
results were obtained. The adjustment speed of controlling the water
water quality. Our control strategy is mainly based on the control of
quality based on the predicted water quality of PC-CGA is faster than
circulating water volume, circulating water flow rate and fish tanks
water level. When the PC-CGA predicts that the water quality is about that of manual monitoring and adjusting the water quality, which is
to change, the system control unit issues control instructions based about 68.5% higher. Under the same conditions, predicting the water
on the severity of the water quality change. Then, based on the real- quality in advance to make a control strategy improved the water
time predicted water quality conditions, it is determined whether to quality by 8.3% compared to manual monitoring and regulation of the
continue to control the water change, water flow rate and water level. water quality.
13
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
Data availability
Acknowledgements
References
With the combination of the above experimental results, it has been Adaryani, F.R., Mousavi, S.J., Jafari, F., 2022. Short-term rainfall forecasting using
demonstrated that the proposed PC-CGA has excellent efficiency and machine learning-based approaches of PSO-SVR, LSTM and CNN. J. Hydrol. 614,
stability in RAS water quality prediction. By making control strategies 128463.
Alizadeh, M.J., Kavianpour, M.R., 2015. Development of wavelet-ANN models to predict
by predicting water quality, water quality can be controlled in real time
water quality parameters in Hilo Bay, Pacific ocean. Mar. Pollut. Bull. 98 (1–2),
and the quality of water quality can be improved. 171–178.
We applied PC-CGA to the RAS for practical experiments. Finally, Barzegar, R., Aalami, M.T., Adamowski, J., 2021. Coupling a hybrid CNN-LSTM deep
the results were obtained. The adjustment speed of controlling the learning model with a boundary corrected maximal overlap discrete wavelet
transform for multiscale lake water level forecasting. J. Hydrol. 598, 126196.
water quality based on the predicted water quality of PC-CGA is faster
Bi, J., Lin, Y., Dong, Q., Yuan, H., Zhou, M., 2021. Large-scale water quality prediction
than that of manual monitoring and adjusting the water quality, which with integrated deep neural network. Inform. Sci. 571, 191–205.
is about 68.5% higher. Under the same conditions, predicting the water Calderini, M.L., Stevčić, Č., Taipale, S., Pulkkinen, K., 2021. Filtration of nordic
quality in advance to make a control strategy improved the water recirculating aquaculture system wastewater: Effects on microalgal growth, nutrient
quality by 8.3% compared to manual monitoring and regulation of the removal, and nutritional value. Algal Res. 60, 102486.
Chen, C., Liao, Z., Ju, Y., He, C., Yu, K., Wan, S., 2022. Hierarchical domain-based
water quality.
multi-controller deployment strategy in SDN-enabled space-air-ground integrated
network. IEEE Trans. Aerosp. Electron. Syst. http://dx.doi.org/10.1109/TAES.2022.
5. Conclusion 3199191.
Crafts, N., 2021. Artificial intelligence as a general-purpose technology: An historical
perspective. Oxford Rev. Econ. Policy.
Based on the predicted water quality, the RAS can be adjusted in
Crouse, C., Davidson, J., Good, C., 2022. The effects of two water temperature regimes
advance to control the recirculating water volume, recirculating water on Atlantic salmon (Salmo salar) growth performance and maturation in freshwater
flow rate and recirculating water level to regulate the water quality. recirculating aquaculture systems. Aquaculture 553, 738063.
Hence, it is essential to predict the water quality of RAS. Conventional Faraji, M., Nadi, S., Ghaffarpasand, O., Homayoni, S., Downey, K., 2022. An inte-
network methods of data prediction are highly dependent on complex grated 3D CNN-GRU deep learning method for short-term prediction of PM2. 5
concentration in urban environment. Sci. Total Environ. 834, 155324.
and redundant model parameters, resulting in inefficiencies. To solve
Fernandes, P., Pedersen, L.-F., Pedersen, P.B., 2015. Microscreen effects on water quality
the problem, this paper proposes a novel predictive and control frame- in replicated recirculating aquaculture systems. Aquac. Eng. 65, 17–26.
work of PC-CGA, which combining CNN, GRU and Attention. In which Grbčić, L., Družeta, S., Mauša, G., Lipić, T., Lušić, D.V., Alvir, M., Lučin, I., Sikirica, A.,
the local features and the global sequential features of water quality Davidović, D., Travaš, V., et al., 2022. Coastal water quality prediction based on
are utilized for water quality prediction. At the end, we conducted a machine learning with feature interpretation and spatio-temporal analysis. Environ.
Model. Softw. 105458.
number of experiments. The experimental results show that the pro- Guo, Z., Du, B., Wang, J., Shen, Y., Li, Q., Feng, D., Gao, X., Wang, H., 2020.
posed PC-CGA framework performs better than the comparison model Data-driven prediction and control of wastewater treatment process through the
in predicting both COD and NH3 -N, and the R2 can reach more than 0.9, combination of convolutional neural network and recurrent neural network. RSC
and the results also shows the efficiency and stability of the proposed Adv. 10 (23), 13410–13419.
Guo, Z., Yu, K., Bashir, A.K., Zhang, D., Al-Otaibi, Y.D., Guizani, M., 2022a. Deep
PC-CGA.
information fusion-driven POI scheduling for mobile social networks. IEEE Network
36 (4), 210–216. http://dx.doi.org/10.1109/MNET.102.2100394.
CRediT authorship contribution statement Guo, Z., Yu, K., Kumar, N., Wei, W., Mumtaz, S., Guizani, M., 2022b. Deep distributed
learning-based POI recommendation under mobile edge networks. IEEE Internet
Things J. 10 (1), 303–317. http://dx.doi.org/10.1109/JIOT.2022.3202628.
Junchao Yang: Methodology, Writing – original draft. Lulu Jia:
Holan, A.B., Good, C., Powell, M.D., 2020. Health management in recirculating
Visualization, Writing – original draft. Zhiwei Guo: Investigation, For- aquaculture systems (RAS). In: Aquaculture Health Management. Elsevier, pp.
mal analysis. Yu Shen: Software, Funding acquisition. Xianwei Li: 281–318.
Data curation. Zhenping Mou: Writing – review & editing, Computer Hu, Z., Zhang, Y., Zhao, Y., Xie, M., Zhong, J., Tu, Z., Liu, J., 2019. A water quality
programming. Keping Yu: Writing – review & editing. Jerry Chun-Wei prediction method based on the deep LSTM network considering correlation in
smart mariculture. Sensors 19 (6), 1420.
Lin: Project administration, Resources.
Jiang, Y., Li, C., Sun, L., Guo, D., Zhang, Y., Wang, W., 2021. A deep learning algorithm
for multi-source data fusion to predict water quality of urban sewer networks. J.
Declaration of competing interest Clean. Prod. 318, 128533.
Jing, Y., Zhang, L., Hao, W., Huang, L., 2022. Numerical study of a CNN-based model
for regional wave prediction. Ocean Eng. 255, 111400.
The authors declare that they have no known competing finan- Keren, G., Schuller, B., 2016. Convolutional RNN: An enhanced model for extracting
cial interests or personal relationships that could have appeared to features from sequential data. In: 2016 International Joint Conference on Neural
influence the work reported in this paper. Networks. IJCNN, IEEE, pp. 3412–3419.
14
J. Yang, L. Jia, Z. Guo et al. Engineering Applications of Artificial Intelligence 121 (2023) 106002
Li, Y., Ma, H., Wang, L., Mao, S., Wang, G., 2022. Optimized content caching and Song, C., Yao, L., Hua, C., Ni, Q., 2021. A novel hybrid model for water quality
user association for edge computing in densely deployed heterogeneous networks. prediction based on synchrosqueezed wavelet transform technique and improved
IEEE Trans. Mob. Comput. 21 (6), 2130–2142. http://dx.doi.org/10.1109/TMC. long short-term memory. J. Hydrol. 603, 126879.
2020.3033563. Ta, X., Wei, Y., 2018. Research on a dissolved oxygen prediction method for recirculat-
Li, M., Wang, W., Zhou, K., 2021. Exploring the technology emergence related to ing aquaculture systems based on a convolution neural network. Comput. Electron.
artificial intelligence: A perspective of coupling analyses. Technol. Forecast. Soc. Agric. 145, 302–310.
Change 172, 121064. Tian, C., Niu, T., Wei, W., 2022. Developing a wind power forecasting system based
Liu, C., Pan, C., Chang, Y., Luo, M., 2021. An integrated autoregressive model for on deep learning with attention mechanism. Energy 124750.
predicting water quality dynamics and its application in Yongding River. Ecol. Wang, S., Peng, H., Liang, S., 2022. Prediction of estuarine water quality using
Indic. 133, 108354. interpretable machine learning approach. J. Hydrol. 605, 127320.
Lv, H., Chen, J., Pan, T., Zhang, T., Feng, Y., Liu, S., 2022. Attention mechanism in Wawrzyniak, M.K., Serrato, L.A.M., Blanchoud, S., 2021. Long-term monitoring data
intelligent fault diagnosis of machinery: A review of technique and application. logs of a recirculating artificial seawater based colonial ascidian aquaculture. Data
Measurement 111594. Brief 38, 107372.
Munubi, R.N., Pedersen, L.-F., Chenyambuga, S.W., et al., 2022. Evaluation of biofilter Xue, Z., Zhang, T., Sun, Y., Yin, T., Cao, J., Fang, F., Feng, Q., Luo, J., 2022. Integrated
performance with alternative local biomedia in pilot scale recirculating aquaculture moving bed biofilm reactor with partial denitrification-anammox for promoted
systems. J. Clean. Prod. 366, 132929. nitrogen removal: Layered biofilm structure formation and symbiotic functional
Pan, M., Zhou, H., Cao, J., Liu, Y., Hao, J., Li, S., Chen, C.-H., 2020. microbes. Sci. Total Environ. 156339.
Water level prediction model based on GRU and CNN. Ieee Access 8, Yang, J., Zhang, Y., Jia, L., Zhang, Q., Hu, C., Guo, Z., Shen, Y., 2022. Dynamic scene
60090–60100. images-assisted intelligent control method for industrialized feeding through deep
Peng, D., He, D., Li, Y., Wang, Z., 2022a. Integrating terrestrial and satellite multibeam vision learning. J. Electron. Imaging 32 (2), 021611.
systems toward 6G: Techniques and challenges for interference mitigation. IEEE Zarzycki, K., Ławryńczuk, M., 2022. Advanced predictive control for GRU and LSTM
Wirel. Commun. 29 (1), 24–31. http://dx.doi.org/10.1109/MWC.002.00293. networks. Inform. Sci. 616, 229–254.
Peng, Y., Jolfaei, A., Yu, K., 2022b. A novel real-time deterministic scheduling Zhang, Y., Li, C., Jiang, Y., Sun, L., Zhao, R., Yan, K., Wang, W., 2022. Accurate
mechanism in industrial cyber-physical systems for energy internet. IEEE Trans. prediction of water quality in urban drainage network with integrated EMD-LSTM
Ind. Inform. 18 (8), 5670–5680. http://dx.doi.org/10.1109/TII.2021.3139357. model. J. Clean. Prod. 354, 131724.
Ren, Q., Wang, X., Li, W., Wei, Y., An, D., 2020. Research of dissolved oxygen Zhang, S.-Y., Li, G., Wu, H.-B., Liu, X.-G., Yao, Y.-H., Tao, L., Liu, H., 2011. An
prediction in recirculating aquaculture systems based on deep belief network. integrated recirculating aquaculture system (RAS) for land-based fish farming: The
Aquac. Eng. 90, 102085. effects on water quality and fish production. Aquac. Eng. 45 (3), 93–102.
Schroeder, J., Croot, P., Von Dewitz, B., Waller, U., Hanel, R., 2011. Potential and Zhao, L., Chai, H., Han, Y., Yu, K., Mumtaz, S., 2022. A collaborative V2X data
limitations of ozone for the removal of ammonia, nitrite, and yellow substances in correction method for road safety. IEEE Trans. Reliab. 71 (2), 951–962. http:
marine recirculating aquaculture systems. Aquac. Eng. 45 (1), 35–41. //dx.doi.org/10.1109/TR.2022.3159664.
Selvin, S., Vinayakumar, R., Gopalakrishnan, E., Menon, V.K., Soman, K., 2017.
Stock price prediction using LSTM, RNN and CNN-sliding window model. In:
2017 International Conference on Advances in Computing, Communications and
Informatics. Icacci, IEEE, pp. 1643–1647.
15