# Design and Development of Dissolved Oxygen Real-Time Prediction and Early Warning System for Brocaded Carp Aquaculture

Huiping Xue, Lianzhi Wang, Daoliang Li

► To cite this version:

Huiping Xue, Lianzhi Wang, Daoliang Li. Design and Development of Dissolved Oxygen Real-Time Prediction and Early Warning System for Brocaded Carp Aquaculture. 6th Computer and Computing Technologies in Agriculture (CCTA), Oct 2012, Zhangjiajie, China. pp.35-42, 10.1007/978-3-642-36124-1_5 . hal-01348078

HAL Id: hal-01348078

https://inria.hal.science/hal-01348078

Submitted on 22 Jul 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Design and Development of Dissolved Oxygen Real-time Prediction and Early Warning System for Brocaded Carp Aquaculture¹

Huiping Xue, Lianzhi Wang, Daoliang Li

College of Information and Electrical Engineering, China Agricultural University,
Beijing, China
wangcau@163.com

**Abstract.** In aquaculture process, common water quality monitoring system just collect data in real-time, and data-monitoring that have been collected is time postponed. It is necessary to conduct prediction and early warning on quality in accordance with its historical state and current state. This paper aims to conduct prediction and warning in terms of the DO content in carp aquaculture using neural network and decision tree, and try to complete the dissolved oxygen Real-time prediction and early warning system through prediction and early warning model research, system design, and system development. The effect in practical application shows that the system can use the two methods to predict DO content, and conduct early warning by value prediction and rule based reasoning.

**Keywords:** data correct; neural network; decision tree; dissolved oxygen real-time prediction and early warning

## 1 Introduction

Dissolved Oxygen (DO) is one of the key parameters in intensive aquaculture, the dissolved oxygen content plays a decisive role in affecting the aquatic feeding rate, feed utilization rate and feed conversion rate, and so, it is necessary to monitor the dissolved oxygen. At present, the DO monitor and prediction in pond breeding process cannot meet the need of real production [1], further research is still necessary. In carp breeding process, the equipment that control DO is operated by hand, which is not only waste of cost, but also badly delayed in time. Opening aeration equipment in the case of hypoxia condition has occurred, will inevitably cause losses. The traditional warning and control method just compare the current DO content and specified standards, and open aeration device if it does not meet the requirements, which means bad occurrence is not avoided by precaution.

In this paper, we use the data checking and correction method to ensure the data accuracy and effectiveness that obtained. The method of compensation calculation was established after communication with culture experts, and it is based on the practical experience in breeding.

¹ Fund Project: Beijing Municipal Natural Science Foundation (4092024)
The system was deployed in Yixing agriculture network platform and Xiaotangshan carp farms, and the results of testing and operation achieved a desired effect comparatively. The real-time dissolved oxygen prediction and warning made breed staff can aware of the dissolved oxygen content for the moment and a period of time later (10minute, 30minute, and 60minute).

## 2 Theory

### 2.1 Data Check and Correct

Remote data checking module will check the obtained data, and call modification module and check data if the abnormal data was found, and make it into reasonable range. The specific processes is, firstly, census data and analyze the data distribution, find the maximum and minimum value, secondly, communicate with the breeding experts and after comprehensive analysis, get the range of parameters. The proportion of parameter changes is calculated by following formula:

$$ \pm \max\left(\text{abs}\left(\frac{y_{i+1} - y_i}{y_i}\right)\right) \quad (1) $$

Among them: $y_i$ represents the obtained data in time $t$, $y_{i+1}$ represents the data collected in the moment $t+1$.

Calculation method of data compensation:

$$ \bar{y} = \frac{1}{base} \sum_{i=1}^{base} w_i y_i \quad (2) $$

Among them: $\bar{y}$ represents the to-be-checked data, $base$ represents the number of compensation, $y_i$ represents the historical data, $w_i$ represents the weight. The number of compensation refers to the number of data that referenced in order to correct and compensate data when the data is missing or error.

### 2.2 Real-time Prediction and Warning of DO

#### Natural Network

Neural network simulates human brain memory and learning activities, and can solve problems such as classification, identification and prediction [2]. BP algorithm is a kind of feedback neural network algorithm, and is realized by multiple iterations. A learning process is composed by forward propagation of data input and back-propagation of error. In this paper, we considered the actual situation of carp breeding, and take three layer network structures.
## Decision Tree

Decision tree is a kind of association rules, and is based on the inductive learning method as the given sample, using up-side-down recursive manner to produce tree structure that similar to flowcharts[3]. From the root node, choose the most appropriate described attributes as branching attribute with reference of the given metric standard, and establish branches down according to different values. The advantages of decision tree classification method are: less time-consuming, simple and intuitive model, easy to understand. The C4.5(an improved algorithm of ID3) algorithm can not only deal with discrete description attribute, but also continuous description attribute. It selects the attribute that have the maximum information gain ratio and classify the training samples, aims at minimizing the system entropy when branching, and improve the computing speed and accuracy. The simulation results that using decision tree to predict dissolved oxygen content are shown as Fig. 1.

<figure><img src="image_2.png" /><figcaption>Fig. 1 DO predict results of decision tree</figcaption></figure>

## DO Warning

Warning refers to measure a factor in present and the future, and predict abnormal state and possible injury [4]. On the early warning process, firstly, we analyze the surrounding environment and conduct early warning on object's internal factors in quality and quantity. Secondly, identify the trends, speed and range. Finally, do the warning and remind for events that might occur and measures that can be taken. The DO warning means to analyze and evaluate the DO content of water body in a certain period of time, and determines the change trends of dissolved oxygen content, and predicts the abnormal condition that maybe happen. In the process of freshwater pond breeding, the water quality warning is sudden, lagged, complex, concentrated, and dynamic [5].

This paper do the numerical prediction according to the prediction results of neural network and decision tree, and also calculate the warning state through rule based reasoning of the various parameters of water quality and their respective effect relationship.
# 3 System Design

## 3.1 Data collection and database design

The real-time database is a supporting part in development of real-time control and data acquainting system[6], which can help user collect and store data in real time and provide effective data sources for information mining in the upper layer software. Real-time database also contributes to the monitoring and optimization control, and also provides real-time data service, data management, scheduling, data analysis, decision support and remote online browsing for the enterprise production process. The database call relation of this system is shown as Fig. 2:

<figure><img src="image_3.png" /><figcaption>Fig. 2 database design</figcaption></figure>

## 3.2 The Frame of Real-time Prediction and Early Warning System

The Real time prediction and early warning system can automatically monitor, predict and warn on irregular data, and at the same time respond to users' requests such as viewing, modification, and so on.

The workflow of this system varies by role. First it verifies the user's jurisdiction, then responds to different service contents according to different roles. Fig. 3 shows the framework of system.

Common user: Users request for viewing the data and perform prediction, and the system responds to them. If user views the historical data, then the system calls the database of historical data directly and displays the corresponding results on the HTML page. If user views the predicted or early warning information, then the system first do the calculation process and gets the needed data, then store it into database and finally show them on a page after calling the database. The aim is: the database can save each step during handling process, which not only provides a guarantee for users' viewing, but also provides traceability data and log records when error occurs in future.
<figure><img src="image_4.png" /><figcaption>Fig. 3 system framework</figcaption></figure>

Expert: Expert is responsible for updating the local database, modifying the relevant parameters of prediction and warning, such as parameters of neural network prediction, rule base of warning reasoning.

Administrator: The administrator is mainly responsible for the users data maintenance work, including viewing user information, deleting users and other functions.

In short, the system implement functions according to the request of users, while keeping a real-time prediction and warning function, and perform remote monitoring data, predicting dissolved oxygen content and executing early warning functions no matter whether there is any manual interaction.

# 4 System Development and Implementation

## 4.1 MVC Model

MVC is the abbreviation of Model, View and Controller [7]. Both The model and controller can update the view layer content, and the controller can also change the state of the model. The view layer passes the user's operation to the controller and at the same time gets a new state from the model.

The view layer is the pages that user can see, usually made of HTML, JSP, ASP, which contains form, servlet path that processing page request,i.e. the URL address of action.

Control layer processes business of view and model layer, and reads the page information, in response to user request and interactive model, and finally return information to page, which was generally handled by the configuration file web.xml.
Model layer is mainly composed of Java files, classes and servlet definition files.

According to the research object, the JSP page consists with user needs, and the model is responsible for realizing the various functional models, and servlets (control layer) response page and call for the corresponding model.

## 4.2 The Implementation of DO Real-time Predict and Early Warning System

The prediction module includes two kinds of methods: neural network prediction and decision tree prediction. These serve for dissolved oxygen prediction, and belong to the same prediction module, including performing prediction, saving the results, showing the results. However, they are different in the principle of realization.

## 4.3 Neural Network Prediction Module

Neural network prediction module learns historical data, and input the recently acquired data to the network, then predicts the DO content in the next period. The module needs to be normalized. Neural network prediction process is divided into two main parts: preparation stage and working stage. In the preparation stage, there are two parallel activities: access to data and normalize, instantiate prediction class and acquaint parameters. In the working stage, it trains model firstly, and then uses the trained model to perform the final prediction, and save the prediction result into database, so that it contributes to the viewing and using.

## 4.4 Decision Tree Predict Module

This paper established the three-layer decision tree prediction module according to the prediction model previously built, and depth of 1, 2, 3 of the decision tree was set up and to predict dissolved oxygen content. Each prediction result was stored into the database, so users can view it. The implementation process of this module is divided into two parts: calculate the expected information that training set needed when doing classification, and information acquisition ratio of each attribute when the training set is partite.

## 4.5 DO Early Warning Module

Warning module includes two kinds of methods: according to the prediction value and rule reasoning, in which the prediction value is divided again for the predicted values of the neural network and decision tree to predict value.

According to the prediction value of early warning, each alert level is stored into database. When performing the warning, system reads warning line from database, and then the prediction value and early warning limits are compared, and finally the result of early warning is given.

When reasoning according to the rules, the system reads reasoning rules from database, calculates and infers, and gets the result of early warning. In addition, the role of experts can also modify warning rules.
## 5 System Testing and Running

In prediction module, the default parameter list is stored in the database, and is read from database when in use. This can not only ensure that the breeding expert modifies the parameter into reasonable value according to their own culture experience, but also make interaction with the system possible, while the system is able to respond to the requirements of experts and calculate a more accurate prediction value.

<table><caption>**Table 1 Default parameter list of predict module**</caption><thead><tr><th>Predict time</th><th>Default sample number when training</th><th>default learning times</th></tr></thead><tbody><tr><td>10min</td><td>500</td><td>3000</td></tr><tr><td>30min</td><td>400</td><td>7000</td></tr><tr><td>60min</td><td>300</td><td>10000</td></tr></tbody></table>

After reading the relative prediction parameters, system performs the dissolved oxygen content prediction modules in different times, and gives the corresponding prediction value. The prediction results for 10 minutes are shown Fig. 4.

<figure><img src="image_5.png" /><figcaption>**Fig. 4 dissolved oxygen prediction curve in 10 minutes**</figcaption></figure>

In addition, the user can view the prediction results of dissolved oxygen content in 10 minutes, 30 minutes, and 60 minutes. Fig. 5 shows the predict value of DO content using BP algorithm.

<figure><img src="image_6.png" /><figcaption>**Fig. 5 predict results**</figcaption></figure>
In the parameter management module, the expert can view and modify the critical parameters, including learning rate, momentum factor, the number of hidden layer nodes, learning steps, and training times, and etc.

## Conclusion

Taking the carp breeding as research object, this paper analyzed DO prediction and warning method in the practical breeding process, and developed a real-time prediction and warning system using Java programming technology. This paper has certain guidance significance in the practice of aquaculture production, and at the same time has reference value for other species culturing. In addition, breeding needs experts to be participating, especially in making the inference rules.

## Acknowledgements

Research work of this paper was supported by The Beijing Natural Science Fund Project (No 4092024). Thanks to the domain experts in Beijing Freshwater Fisheries Technology and Engineering Research Center for their long term support.

## References

[1] von Metzen, R.P.; Stieglitz, T.;, A Wireless System for Monitoring Polymer Encapsulations, Engineering in Medicine and Biology Society, 2007. EMBS 2007. 29th Annual International Conference of the IEEE, pp.6600-6603, 22-26 Aug. 2007

[2] Caudell, T.P.; Zikan, K.;, Neural network architecture for linear programming, Neural Networks, 1992. IJCNN., International Joint Conference on, vol.3, pp.91-96 vol.3, 7-11 Jun 1992

[3] Abdelhalim, A.; Traore, I.;, A New Method for Learning Decision Trees from Rules, Machine Learning and Applications, 2009. ICMLA '09. International Conference on, pp.693-698, 13-15 Dec. 2009

[4] Han, Lu; Wang, Jing; Lu, Chunyan; Xie, Junqi; , Research on early warning system of water quality safety based on RBF neural network model, Information Science and Engineering (ICISE), 2010 2nd International Conference on, pp.4667-4670, 4-6 Dec. 2010

[5] Ruimei Wang; DaQing Chen; Zetian Fu; , AWQEE-DSS: A Decision Support System for Aquaculture Water Quality Evaluation and Early-warning, Computational Intelligence and Security, 2006 International Conference on, vol.2, pp.959-962, 3-6 Nov. 2006

[6] Lu Huiming; Zhou Zhao; , The researching and application of historical data processing in real-time database system, Computer Application and System Modeling (ICCASM), 2010 International Conference on, vol.14, pp.V14-162-V14-166, 22-24 Oct. 2010

[7] Wojciechowski, J.; Sakowicz, B.; Dura, K.; Napieralski, A.;, MVC model, struts framework and file upload issues in web applications based on J2EE platform, Modern Problems of Radio Engineering, Telecommunications and Computer Science, 2004. Proceedings of the International Conference, pp.342-345, 28-28 Feb. 2004