# The Dissolved Oxygen Prediction Method Based on Neural Network

Authors: Zhong Xiao; Lingxi Peng; Yi Chen; Haohuai Liu; Jiaqing Wang; Yangang Nie
Journal: Complexity
 (2017)

---

## Abstract

The dissolved oxygen (DO) is oxygen dissolved in water, which is an important factor for the aquaculture. Using BP neural network method with the combination of purelin, logsig, and tansig activation functions is proposed for the prediction of aquaculture’s dissolved oxygen. The input layer, hidden layer, and output layer are introduced in detail including the weight adjustment process. The breeding data of three ponds in actual 10 consecutive days were used for experiments; these ponds were located in Beihai, Guangxi, a traditional aquaculture base in southern China. The data of the first 7 days are used for training, and the data of the latter 3 days are used for the test. Compared with the common prediction models, curve fitting (CF), autoregression (AR), grey model (GM), and support vector machines (SVM), the experimental results show that the prediction accuracy of the neural network is the highest, and all the predicted values are less than 5% of the error limit, which can meet the needs of practical applications, followed by AR, GM, SVM, and CF. The prediction model can help to improve the water quality monitoring level of aquaculture which will prevent the deterioration of water quality and the outbreak of disease.


---

## Body

## 1. Preface

Dissolved oxygen [1] refers to the amount of oxygen dissolved in water, usually expressed in DO. It is an important indicator to study the water self-purification ability. The level of DO directly affects the aquaculture’s food intake, feed conversion rate, and disease resistance. Low DO or hypoxic water environment has a great impact on aquaculture organisms. As an example, if the aquaculture shrimp is often raised in the low DO water environment, it will intake little food, which will lead to low conversion rate of food, slow growth, and low disease resistance. The hypoxia can directly or indirectly lead to a large number of live shrimp.Based on the study of the lowest time of DO in aquaculture water and the analysis of the daily variation of low DO values, we can estimate and forecast its development trend. The basis for decision-making is provided to improve water quality for preventing water quality deterioration with the low DO. It helps to control and reduce aquaculture risk. At present, the common prediction models include curve fitting (CF) [2], autoregression (AR) [3], neural network (NN) [4–8], grey models (GM) [9, 10], support vector machine (SVM) [11, 12], and other models [13]. But there is no literature on the comparison and experimentation of these methods. Therefore, in order to study an accurate and practical method of DO prediction, in this paper, NN method, CF method, AR method, GM method, and SVM method are compared using the 10 consecutive days of aquaculture data of southern China traditional aquaculture base in three shrimp culture ponds in Beihai, Guangxi Province. The experimental results show that the accuracy of NN prediction is high, and all the predicted values are less than 5%, which is the maximum acceptable predicted error rate. So the method can meet the needs of practical applications.


## 2. Artificial Neural Network

Artificial neural network [14, 15] is a biomimetic intelligent information processing system that simulates the structure and function of human brain’s neural network. It is suitable for describing complex nonlinear mapping relationships and has a strong ability to integrate information and fault tolerance. It has very good self-adaptability for nonregular, nonlinear structures. It is an important research method for computational intelligence.Backpropagation neural network is currently the most widely used neural network. In 1986, it was proposed by Rumelhart and McClelland and others. It is a multilayer feed-forward neural network trained by error backpropagation algorithm. It solves the problem of the hidden layer connection of multilayer neural networks systematically and gives the complete derivation in mathematics. A multilayer feed-forward network using this algorithm for error correction is called a BP network. BP neural network has complex pattern classification ability and excellent multidimensional function mapping ability, which solves the Exclusive OR (XOR) and some other problems that simple sensor cannot. Structurally, the BP network has an input layer, a hidden layer, and an output layer. In essence, the BP algorithm is based on the square of the network error as the objective function, using the gradient descent method to calculate the minimum value of the objective function.The BP neural network used in this paper has three layers, namely,LA layer, input layer,LB layer, hidden layer, andLC layer, output layer. These layers are fully interconnected, and there is no connection between neurons within each hierarchy.LA layer has n neurons,LB layer has p neurons,LC layer has m neurons, vhi is the weight between the neuron h on theLA layer and the neuron i on theLB layer, and wij is the weight between the neurons i on the LB layer and the neurons j on theLC layer. The following is the BP network specific learning algorithm:(1) Randomly initialize the weight of the BP network, and then a smaller random number is generally taken.(2) Obtain the input vector X=(x1,x2,…,xn) and its corresponding expected output vector T=(t1,t2,…,tm) from the learning sample.(3) Calculate the output values of neurons on the LB layer according to (1), where i=1,2,…,p. The function f is an S-shaped function.(1)bi=f∑h=inxhvhi.(4) Calculate the output values of neurons on the LC layer according to (2), where j=1,2,…,m.(2)cj=f∑i=1pbiwij.(5) Calculate the generalized error of the neurons in theLC layer according to (3), where j=1,2,…,m.(3)dj=tj-cjf′∑i=1pbiwij=tj-cjcj1-cj.(6) Calculate the error of LB layer neurons relative to each dj according to (4), where j=1,2,…,m. This step propagates the error of the LC layer’s neurons back to the LB layer.(4)ei=f′∑h=1nxhvhi∑j=1mwijdj=bi1-bi∑j=1mwijdj.The activation function of neurons must be derivable everywhere in the BP algorithm, so the common applications in the BP network are purelin, logsig, and tansig. It has the following properties:(5)purelinx=x,purelin′x=1,logsig⁡x=11+e-x,logsig′x=11+e-x-11+e-x2=fx-f2x,tansig⁡x=11+arctan⁡x,tansig′x=1-tansigx2.In our experiments, we use the combination of these three activation functions, which greatly improve the prediction accuracy, and a large amount of calculation has been reduced.(7) Adjust the weights between theLB andLC layers’ neurons according to (6), where i=1,2,…,p,j=1,2,…,m, and η is the learning rate.(6)Δwij=ηbidj.(8) Adjust the weights between theLA andLB layers’ neurons according to (7), where h=1,2,…,n,i=1,2,…,p.(7)Δvhi=ηxhei.(9) Go to step (2) until the error dj becomes small enough or becomes zero for j=1,2,…,m.Artificial neural network model has the advantages of autonomous learning, information memory, knowledge reasoning, optimization calculation, and nonlinear fitting ability. It is able to predict data after learning and training. But it is not suitable for small samples and high-dimensional data. Its shortcomings are mainly the large amount of computing, slow convergence rate, being easy to fall into the local minimum, difficulty in determining the number of hidden layer’s neurons, and so on.


## 3. Experiments

Beibu Gulf is located in the southern part of Beihai, Guangxi Province, which is rich in marine resources. It is a traditional aquaculture base in southern China. It is one of the four major fishing grounds in China. In 2016, its aquaculture area has been more than 50 million acres. The DO measurements were taken from the representative three shrimp farming ponds in Beihai, Guangxi province. As a result, the DO value of the first pond was deteriorating at 4:00 am, but the DO values of the second and the third ponds were normal.As far as the parameter is concerned, the order of curve fitting is 2. The autoregression (AR) and grey models (GM) need no parameters. The parameters used in the neural network (NN) were set to the number of iterations of 5000, the learning rate of 0.01, and the target value of 0.000000001. The support vector machine (SVM) uses different penalty coefficient and nuclear function according to the training data to minimize the training error.The DO value in aquaculture water is susceptible to solar radiation, temperature, pressure, wind speed, and other environmental factors. It is cyclical over time. Generally it reaches the highest value between 15:00 and 17:00 and reaches the lowest value between 3:00 and 5:00. The lowest value of DO is an important indicator of water pollution. Therefore, the test was conducted for study based on the DO values at 4:00 am for seven consecutive days. By using five models, CF, AR, NN, SVM, and GM, the DO values at 4:00 am for the eighth day, the ninth day, and the tenth day were analyzed; the values of the low dissolved oxygen period ware predicted. This will be able to predict the development trend of DO in water. Based on this, it is possible to prevent deterioration of water quality and prevent disease outbreaks in advance.The total DO values were selected at 4:00 am in mid-June for seven consecutive days. The sunshine duration of the seven days is about 16 hours. The sun is plenty. The average temperature is about 31 degrees. Day water temperature difference is ±3 degrees. The average humidity is about 90%. The average pressure is 1 atmosphere. The wind level is 2 to 3. There is no typhoon and rainstorm. The baits are delievered at three times a day at 8:00 am, 12:00 noon, and 18:00 pm. The aerator runs twice a day, once in the afternoon, 14:00 to 17:00, and once between 3:00 and 5:00. The test assumes that other conditions have no effect on DO.


### 3.1. The First Experiment

The shrimp culture pond is located in Hepu County Party Town, Beihai, Guangxi Province, China. It covers an area of 7.5 acres. The average water depth is 1.4 meters. It breeds South American white shrimp with 60000 shrimps per acre. It planted theHydrilla verticillata, tape grass, and so forth.The actual value of the output and DO of each model is shown in Figure1. The absolute error between the predicted value and the actual value of the DO for the next 3 days is shown in Figure 2. As can be seen from Figure 2, the actual value of DO on day 8 is 3.8. The prediction data of each prediction model are accurate. The prediction accuracy from high to low is as follows: NN, CF, SVM, GM, and AR. The error of NN model is the smallest: it is only 0.005%. The error of GM model is the largest: it is 1.34%. They are all less than 5%. Therefore, this is fully in line with forecast requirements. The actual value of DO on day 9 is 3.7. The prediction accuracy from high to low is as follows: NN, CF, SVM, GM, and AR. The error of AR model is 5.25 and the rest are all less than 5%. The actual value of DO on day 10 is 3.5. The prediction accuracy from high to low is as follows: NN, AR, CF, SVM, and GM. The error of all models is less than 5%. This meets the forecast requirements.Figure 1
The actual value and predicted value for the first pond.Figure 2
The absolute error between the actual and predicted values for the first pond.Thus, the above five predictive models (CF, AR, NN, SVM, and GM) can meet the design requirements based on ignoring the fact that the error of AR model on day 9 is slightly larger. They can make accurate prediction of the next 3 days’ DO at 4:00 am, which is the lowest value of DO in each day. Through the early warning of the deterioration of water quality, the amount of water in the pond is regulated. Thereby the water quality of the pond is improved and the aquaculture risk is reduced. In fact, the water quality of this shrimp pond is deteriorating because the density of the pond is too large and the regulation of water is not timely. Eventually, the serious accident broke out and nearly half of the shrimps died. It caused serious economic losses to aquaculture households.


### 3.2. The Second Experiment

The shrimp culture pond is located in Hepu County West Town, Beihai, Guangxi Province, China. It covers an area of 4.5 acres. The average water depth is 1.2 meters. It breeds South American white shrimp with 40000 shrimps per acre. It planted the waterweed, tape grass, and so forth.The actual value of the output and DO of each model is shown in Figure3. The absolute error between the predicted value and the actual value of the DO for the next 3 days is shown in Figure 4. As can be seen from Figure 4, the actual value of DO on day 8 is 4.49. The prediction accuracy of each model from high to low is as follows: NN, CF, AR, SVM, and GM. The error of GM model is the largest: it is 6.904%. It is slightly higher than the 5%. The actual value of DO on day 9 is 4.2. The prediction accuracy of each model from high to low is as follows: AR, NN, GM, SVM, and CF. The error of CF model is the largest: it is 5.391%. The error of other models is less than 5%. The actual value of DO on day 10 is 4.2. The prediction accuracy of each model from high to low is as follows: NN, GM, AR, SVM, and CF. The error of SVM model is 7.607% and the error of CF model is 8.902%. They are higher than 5%. However, the others meet the forecast requirements.Figure 3
The actual value and predicted value for the second pond.Figure 4
The absolute error between the actual and predicted values for the second pond.The shrimp delivery of the pond did not exceed the standard. The lowest value of DO is only fluctuating up and down within a certain range. It can be seen that the current minimum DO fluctuation is not very large. The error between the predicted value and the actual value of DO is not large. Although the prediction error of SVM model and CF model in the third day is slightly larger, the prediction accuracy of NN model and AR model is still maintained at a high level.


### 3.3. The Third Experiment

The shrimp culture pond is located in Hepu County Party Town, Beihai, Guangxi Province, China. It covers an area of 8.5 acres. The average water depth is 1.1 meters. It breeds South American white shrimp with 42000 shrimps per acre. It planted the waterweed,Hydrilla verticillata, tape grass, and so forth. The actual value of the output and DO of each model is shown in Figure 5. The absolute error between the predicted value and the actual value of the DO for the next 3 days is shown in Figure 6. As can be seen from Figure 6, the actual value of DO on day 8 is 4.08. The prediction accuracy from high to low is as follows: NN, GM, SVM, AR, and CF. The error of CF model is the largest: it is only 7.458%. It is higher than 5%. The actual value of DO on day 9 is 4.2. The prediction accuracy from high to low is as follows: AR, NN, GM, SVM, and CF. Except that the error between the predicted value and the actual value of DO of CF model is 17.46%, the prediction error of other models is less than 5%. The actual value of DO on day 10 is 4.3. The prediction accuracy from high to low is as follows: NN, GM, AR, SVM, and CF. The prediction error of the models is less than 5% except the prediction error of NN model.Figure 5
The actual value and predicted value for the third pond.Figure 6
The absolute error between the actual and predicted values for the third pond.The shrimp delivery of the pond did not exceed the standard. The lowest value of DO is only fluctuating up and down within a certain range. The error between the predicted value and the actual value of DO is less than 5%. Among the models, the prediction accuracy of NN model is the highest.In summary, three ponds were raised with the white leg shrimps. There are almost the same test conditions. From the comparison between the predicted values and the actual values of the three ponds, we can see that NN model has the highest accuracy of prediction. The prediction error rate of NN model is less than 5%. Among all the prediction values of OD, the maximum prediction error only appears on the eighth day of the second experiment. It is only 2.474%. The AR model comes next. There are two prediction error rates of test values exceeding 5%. But they are 5.25% and 6.58%. The prediction error rate is not much higher. GM model is ranked third, and SVM model is ranked fourth. Although there are two prediction error rates of test values exceeding 5%, the sum of the prediction errors of SVM model is slightly larger than that of GM model. The predicted value of CF model is relatively poor in the second experiment and the third experiment. But the predicted value of low DO of CF model for the next day (i.e., the eighth day) is satisfactory.


## 3.1. The First Experiment

The shrimp culture pond is located in Hepu County Party Town, Beihai, Guangxi Province, China. It covers an area of 7.5 acres. The average water depth is 1.4 meters. It breeds South American white shrimp with 60000 shrimps per acre. It planted theHydrilla verticillata, tape grass, and so forth.The actual value of the output and DO of each model is shown in Figure1. The absolute error between the predicted value and the actual value of the DO for the next 3 days is shown in Figure 2. As can be seen from Figure 2, the actual value of DO on day 8 is 3.8. The prediction data of each prediction model are accurate. The prediction accuracy from high to low is as follows: NN, CF, SVM, GM, and AR. The error of NN model is the smallest: it is only 0.005%. The error of GM model is the largest: it is 1.34%. They are all less than 5%. Therefore, this is fully in line with forecast requirements. The actual value of DO on day 9 is 3.7. The prediction accuracy from high to low is as follows: NN, CF, SVM, GM, and AR. The error of AR model is 5.25 and the rest are all less than 5%. The actual value of DO on day 10 is 3.5. The prediction accuracy from high to low is as follows: NN, AR, CF, SVM, and GM. The error of all models is less than 5%. This meets the forecast requirements.Figure 1
The actual value and predicted value for the first pond.Figure 2
The absolute error between the actual and predicted values for the first pond.Thus, the above five predictive models (CF, AR, NN, SVM, and GM) can meet the design requirements based on ignoring the fact that the error of AR model on day 9 is slightly larger. They can make accurate prediction of the next 3 days’ DO at 4:00 am, which is the lowest value of DO in each day. Through the early warning of the deterioration of water quality, the amount of water in the pond is regulated. Thereby the water quality of the pond is improved and the aquaculture risk is reduced. In fact, the water quality of this shrimp pond is deteriorating because the density of the pond is too large and the regulation of water is not timely. Eventually, the serious accident broke out and nearly half of the shrimps died. It caused serious economic losses to aquaculture households.


## 3.2. The Second Experiment

The shrimp culture pond is located in Hepu County West Town, Beihai, Guangxi Province, China. It covers an area of 4.5 acres. The average water depth is 1.2 meters. It breeds South American white shrimp with 40000 shrimps per acre. It planted the waterweed, tape grass, and so forth.The actual value of the output and DO of each model is shown in Figure3. The absolute error between the predicted value and the actual value of the DO for the next 3 days is shown in Figure 4. As can be seen from Figure 4, the actual value of DO on day 8 is 4.49. The prediction accuracy of each model from high to low is as follows: NN, CF, AR, SVM, and GM. The error of GM model is the largest: it is 6.904%. It is slightly higher than the 5%. The actual value of DO on day 9 is 4.2. The prediction accuracy of each model from high to low is as follows: AR, NN, GM, SVM, and CF. The error of CF model is the largest: it is 5.391%. The error of other models is less than 5%. The actual value of DO on day 10 is 4.2. The prediction accuracy of each model from high to low is as follows: NN, GM, AR, SVM, and CF. The error of SVM model is 7.607% and the error of CF model is 8.902%. They are higher than 5%. However, the others meet the forecast requirements.Figure 3
The actual value and predicted value for the second pond.Figure 4
The absolute error between the actual and predicted values for the second pond.The shrimp delivery of the pond did not exceed the standard. The lowest value of DO is only fluctuating up and down within a certain range. It can be seen that the current minimum DO fluctuation is not very large. The error between the predicted value and the actual value of DO is not large. Although the prediction error of SVM model and CF model in the third day is slightly larger, the prediction accuracy of NN model and AR model is still maintained at a high level.


## 3.3. The Third Experiment

The shrimp culture pond is located in Hepu County Party Town, Beihai, Guangxi Province, China. It covers an area of 8.5 acres. The average water depth is 1.1 meters. It breeds South American white shrimp with 42000 shrimps per acre. It planted the waterweed,Hydrilla verticillata, tape grass, and so forth. The actual value of the output and DO of each model is shown in Figure 5. The absolute error between the predicted value and the actual value of the DO for the next 3 days is shown in Figure 6. As can be seen from Figure 6, the actual value of DO on day 8 is 4.08. The prediction accuracy from high to low is as follows: NN, GM, SVM, AR, and CF. The error of CF model is the largest: it is only 7.458%. It is higher than 5%. The actual value of DO on day 9 is 4.2. The prediction accuracy from high to low is as follows: AR, NN, GM, SVM, and CF. Except that the error between the predicted value and the actual value of DO of CF model is 17.46%, the prediction error of other models is less than 5%. The actual value of DO on day 10 is 4.3. The prediction accuracy from high to low is as follows: NN, GM, AR, SVM, and CF. The prediction error of the models is less than 5% except the prediction error of NN model.Figure 5
The actual value and predicted value for the third pond.Figure 6
The absolute error between the actual and predicted values for the third pond.The shrimp delivery of the pond did not exceed the standard. The lowest value of DO is only fluctuating up and down within a certain range. The error between the predicted value and the actual value of DO is less than 5%. Among the models, the prediction accuracy of NN model is the highest.In summary, three ponds were raised with the white leg shrimps. There are almost the same test conditions. From the comparison between the predicted values and the actual values of the three ponds, we can see that NN model has the highest accuracy of prediction. The prediction error rate of NN model is less than 5%. Among all the prediction values of OD, the maximum prediction error only appears on the eighth day of the second experiment. It is only 2.474%. The AR model comes next. There are two prediction error rates of test values exceeding 5%. But they are 5.25% and 6.58%. The prediction error rate is not much higher. GM model is ranked third, and SVM model is ranked fourth. Although there are two prediction error rates of test values exceeding 5%, the sum of the prediction errors of SVM model is slightly larger than that of GM model. The predicted value of CF model is relatively poor in the second experiment and the third experiment. But the predicted value of low DO of CF model for the next day (i.e., the eighth day) is satisfactory.


## 4. Conclusions

This paper presents the methods for predicting DO in aquaculture based on BP neural network. The combination of these three activation functions greatly improves the prediction accuracy and a large amount of calculation has been reduced. It requires less training and training data. It is limited in computation and its prediction accuracy is the highest. The prediction error rate is less than 5%. Therefore, this method fully meets the needs of practical applications and is suitable for a wide range of promotion. The future work for us to do is to apply the neural network method in aquaculture. In particular, we can further use the oxygen machine to suppress the growth of anaerobic bacteria in water, prevent water deterioration, and improve the production efficiency of aquaculture.



---

*Source: 4967870-2017-10-09.xml*