Bulletin of Electrical Engineering and Informatics

Toh Yin Wei, Emmanuel Stewart Tindik, Ching Fui Fui, Haviluddin, Mohd Hanafi Ahmad Hijazi Data Technologies and Applications Research Group, Faculty of Computing and Informatics, Universiti Malaysia Sabah, Kinabalu, Malaysia Borneo Marine Research Institute, Universiti Malaysia Sabah, Kinabalu, Malaysia Department of Informatics, Faculty of Engineering, Universitas Mulawarman, East Kalimantan, Indonesia


INTRODUCTION
Aquaculture is the fastest-growing food production industry as there is a significant increase in the demand for seafood and fish worldwide.It is one of the fastest food production sectors in the world and currently contributes close to two third of the world's fish supply [1].In fact, more than 500 different fish are currently farmed through aquaculture all over the world, representing its significant role in suppressing overfishing pressure as well as supporting the recovery of the fish population in the natural water [2].Various countries, for example, Malaysia, have recognized the aquaculture sector as part of a national solution to food security and source of economy.
Fish farming management depends on water quality monitoring since fish disease is very prevalent and significantly affects harvesting yields [3].Water quality control is the key to the sustainability of aquaculture management, and it determines the feed quality, survival, and growth rates of fish in fish cages or tanks [4].A hatchery pool treatment includes the monitoring of dissolved oxygen (DO) level, water salinity, water pH values and also temperature.Studying DO is complex and requires caution, especially in tidal and ISSN: 2302-9285  Automated water quality monitoring and regression-based forecasting system for aquaculture (Toh Yin Wei) 571 productive ecosystems.Low DO availability leads to perturbations in the bio-chemical dynamics of ecosystems, as many chemical reactions require oxygen and all aerobic organisms depend on oxygen for survival [5].Hence, regular monitoring of water quality is among the most crucial part of a fish farm's daily tasks.Using the manual method to monitor water quality is inconvenient, costly, and time-consuming.It is problematic that fish farm staff need to collect a large number of readings from the fish tanks.When water quality is not well-monitored, the decrease in water quality is uncontrollable.For example, when a sudden drop in water quality occurs at night, mass mortality of fish is expected to happen and will eventually cause a major profit loss to the hatcheries.Such scenarios have been experienced by Malaysian fish farmers [6], [7].
A water quality monitoring system for aquaculture can include, in general, AI-based software, a wireless sensor network (WSN), an automation system, an alert system, data storage, graphic user interface (GUI) interaction, data processing, and real-time monitoring [8].In advanced countries like Japan, Korea, and China, the improvement in monitoring water quality through automation technology has improved the quality of the fish either in the hatchery, pond and cage systems, thus leading to tremendous success in producing a mass quantity of high-quality fish [9].Several works on using the advancement of technology for fish farms' water quality monitoring can be found in [10]- [12].To the best of our knowledge, however, none of the work provides the forecasting module that would allow advanced monitoring of the fish farms' water quality.
In this paper, an automated water quality and forecasting system is presented.Three water quality parameters were included, which are temperature, pH and DO.To generate the forecasting model, two techniques were compared, the support vector regression (SVR) and the long-short term memory (LSTM).The best forecasting model was identified and embedded in a web-based prototype of the system.The system was evaluated by a group of fish hatchery workers at Universiti Malaysia Sabah (UMS).The contributions of this paper are: i) comparison of SVR and LSTM for water quality forecasting and ii) evaluation of the usability of a water quality monitoring and forecasting system by the fish farm workers.The remaining of this paper is organized as follows: i) some background literature related to the presented intelligent water quality monitoring and forecasting system is presented in section 2, ii) the methods used are described in section 3, and iii) section 4 presents the evaluation and the discussion of results, and iv) the conclusion and potential future work are described in section 5.

RELATED WORK
In this section, the background of related research and the theoretical models used in this paper are described.

Water quality monitoring and forecasting for fish farming
The main goal of fish farming is to grow fish or other aquaculture products quickly to achieve an acceptable harvestable scale.Water quality is one of the most vital factors in fish farming, influencing aquatic products' growth and mortality rate, especially in high-density aquaculture systems [10].The manual method of water sampling introduces many risks, including data loss during the data collection process.A huge number of samples are required to ensure a reliable and solid analysis of the water quality [13], which will be time-consuming and repetitive [14].Therefore, work has been conducted on the automatic water quality monitoring system.
Saparudin et al. [10] proposed a water quality monitoring module that consists of several sensor nodes, whereby the data collected by each sensor will be stored locally first before being transmitted to the server node through a wireless connection.Othman et al. [11] used LabVIEW software to visualize the realtime data collected by the sensors.An alarm system is included in the system to notify users if any of the water quality parameters are out of range.Users may need to install the LabVIEW software in order to use the system.Another work [12] uses the WAZIUP platform for data processing and analysis, where a simple dashboard is provided by the platform to visualize the real-time data.
A solar-based aquaculture system to address the power supply issue was described in [15], [16].Both water quality parameters are measured using an Arduino microcontroller.Thingspeak, a cloud server, is used in both systems for the data logger.A web-based application is developed using PHP and XAMPP for data management and visualization.
Apart from monitoring water quality, forecasting, and prediction of water quality is pertinent in fish farming and should be part of any aquaculture management system, as forecasting would assist fish farmers, preventing any water quality issues before they arise [17].Several works have deployed the SVR to forecast the values of the water quality parameters [18]- [20].From their work, the SVR has been shown to produce the best forecasting model over other regression models.Other works found to use LSTM to predict the water quality with good results produced compared to other neural network based models [21]- [24].One work that is most similar to the one presented in this paper can be found in [25].It does not only provide real-time data on the fish tank's water quality, but it also embeds an alert system and forecasting.However, it focused on the generation of the water quality dataset for public use.The work presented in this paper, on the other hand, focuses on the development and evaluation of a water quality monitoring and forecasting system.

Long-short term memory
LSTM is an advancement of the recurrent neural network (RNN).A cell state is added to the LSTM network's hidden layer, while the traditional RNN only has one state.As shown in Figure 1, at time t, there are three inputs in the hidden layer [21]: the current time's input value xt, the previous time's output value st-1 of the hidden layer neurons, and the previous time's unit state ct-1.The hidden layer produces two outputs: the output of the hidden layer st, and the cell state ct at the current time.
Figure 2 shows the gates used by LSTM to control a state c [21].The three gates are forget gate r1, input gate r2 and output gate r3.The r1 gate regulates how much information from the previous state ct-1 is stored in the current state.The r2 gate controls how much data xt inputted into the hidden layer in the current state is saved to the current state ct.The r3 gate determines how much information from ct is inputted into st.More details of LSTM can be found in [26].(1) The first term in the error function penalizes model complexity.The ℇ-insensitive loss function is the second term.To minimize the error function, the solution is given in (2).
The Langrange multipliers are   * and   .Support vectors are training vectors with non-zero Lagrange multipliers.This model can be generalized to the nonlinear case using a kernel K, yielding the following solution in (3).
Details of the SVR can be found in [27].

METHOD
The work presented in this paper consists of three phases, i) development of the forecasting model, ii) development of the prototype of the system, and iii) evaluation of the usability (UT) of the system.Each is described in sections 3.1 to 3.3, respectively.

Bulletin of Electr Eng & Inf
ISSN: 2302-9285  Automated water quality monitoring and regression-based forecasting system for aquaculture (Toh Yin Wei) 573

The generation of the forecasting model
In this phase, the engine of the forecasting model is designed, developed and evaluated.Two common techniques for forecasting were investigated, the SVR and LSTM.Scikit-Learn [28] library was used to implement the SVR, while Tensorflow [29] was used for LSTM.A public dataset, the Canning water quality sensor data [30], was used to evaluate the selected techniques.The sensors are located around the City of Canning, Australia, and the data were collected at predetermined times throughout the day for thirty days.The water quality parameters collected are the temperature, pH, conductivity and DO.In this paper, only the temperature, pH and DO were selected as these parameters were common for water quality monitoring in fish farms.In total, there are 2,275 readings recorded and used in this paper.In the original dataset, some missing values were observed.The missing values were replaced by the median of each column respectively.Three evaluation indices were used, the mean absolute error (MAE), root mean squared error (RMSE), and mean absolute percent error (MAPE).The best performing technique was then used as a forecasting model and embedded in the system prototype.Figure 3 shows the framework of the forecasting model investigation.To minimize dimension variations, the data were normalized to the range of 0 to 1.The output of this phase is a water quality forecasting model.

The development of the water quality monitoring system
In this phase, the design and development of the intelligent water quality monitoring and forecasting system were conducted.It has two subphases.In the first subphase, the tool used to collect the water quality data from the fish tanks, which was based on the Arduino and Raspberry Pi, was developed.Three sensors were deployed, temperature, pH, and DO sensors.A delay of 60 seconds was set between two data readings.Based on the previous work, there is no specific indicator of how frequent the water quality data should be updated to the database.The sample can be taken as low as ten seconds intervals [31] to 30 minutes [32].Concerning the work presented in this paper, 60 seconds is deemed suitable to ensure a moderate consumption of the power, storage and to the need of the fish farms in UMS.The time interval can be adjusted from time to time according to the needs.The collected data will be uploaded and stored in the database in real-time via the internet.The data can be viewed by the user through a web-based application developed in the second subphase.Figure 4 illustrates the overall data collection tool and the web-based application developed in this paper.
In the second subphase, as already stated above, a web-based application was developed to visualize the collected data.Figure 5 shows the use case of the system.There were two actors, the fish hatchery workers and the system administrator.The fish hatchery worker needs to register an account and log into the system.Once logged in, the worker can view the real-time water quality, the history, the water quality forecast and receive a push notification whenever the readings are below the set threshold.The system administrator can approve and manage user accounts.The administrator also can add or delete fish tanks whenever necessary.The output of this phase is a prototype of the water quality monitoring and forecasting for fish farms.

The usability testing
In this phase, the user testing (UT) was performed to get the users' feedback on the usability of the system.The workers of the fish hatchery in UMS, which specializes in breeding numerous aquaculture fish species, were selected as subjects.By managing better water quality and enhancing feeding management, they focus on broodstock management in order to obtain a better quality of fish eggs and healthier fry [33].Questionnaires were distributed to the fish hatchery workers in UMS and their feedback was captured.

RESULTS AND DISCUSSION
In this section, the results and analysis of evaluations on the forecasting model, the developed prototype of the water quality monitoring and forecasting system, and the usability of the system are presented.

Evaluation of the forecasting model
In this section, the comparison result of the selected forecasting techniques is presented.Ten-fold cross-validation was used in the experiments, whereby the dataset was randomly divided into ten groups.The experiments were repeated ten times; one group was used as test data in each iteration.Two sets of experiments were conducted, the first was to evaluate the SVR, and the second was to evaluate the LSTM.For the SVR, the radial basis function (RBF) kernel was selected as it produced good results in the previous work.For the LSTM, the experiment was conducted using 100 epochs and an Adam optimizer.The purpose of the experiments was to identify the best regression technique that will be embedded in the proposed system.Hence, the forecasted values were fixed to one-day forecasting only.Table 1 shows the result.From the presented result, the LSTM model has better performance than the SVR model, in particular for the MAPE metric.Therefore, the LSTM model was embedded in the intelligent water quality monitoring and forecasting system.

Prototype demonstration
The implementation of the system is described in this section.Figures 6-8 show the main page of the proposed system, the real-time data collection page and the water quality forecasting page.From Figure 6, users can choose either to view the real-time water quality data, to view the past activities or the forecasting module.Figure 7 shows the real-time water quality interface.Users can check the real-time water quality data such as water temperature, water pH value, and DO according to the fish tank number.When the values are optimal, they will be shown in green colour.Poor water quality in a tank is indicated by the red-coloured text of the parameters.The thresholds to determine if the readings are fine for tropical freshwater were: temperature between 16.00 to 30.00 degree Celsius, a pH between 5.5 to 7.5, and a DO of more than 3 mg/L [34].Figure 8 shows the forecast water quality interface.Users can generate the forecast of the water quality data for the next seven days of the selected fish tanks.The results are presented in table form.
Figure 9 shows the notification page when the user clicks the alarm button on the right corner of the page.If one of the fish tanks has poor water quality condition, a red circle will appear on the button.When the user clicks it, a message that shows which fish tank is in a poor water quality state is shown.If all the fish tanks are in good condition, there will be no red circle on the button, and the messages will show that each fish tanks are in good condition.

Usability testing
The prototype developed was installed in one of the fish tanks at the UMS fish hatchery.For the UT, all eight workers at the UMS fish hatchery were given access to the prototype, and the evaluation form was distributed to all the subjects to evaluate the usability of the system.The evaluation form has nine questions Bulletin of Electr Eng & Inf ISSN: 2302-9285  Automated water quality monitoring and regression-based forecasting system for aquaculture (Toh Yin Wei) 577 and was categorized into four criteria which were i) functionality, ii) layout, iii) technical aspect, and iv) user-friendliness.Figure 10 shows the result of the UT.The subjects rated the system using a Likert scale of 1-5; 5 being strongly agreed and 1 strongly disagreed.Based on Figure 10, it shows that the subjects have good satisfaction with the system, in particular on the technical aspect and user-friendliness, whereby the system provides messages on how to use the system and fix any usage mistake when it occurs.The lowest score was 3.8 for functionality, which indicates the system may already provide necessary functions, but more features are required.Since the prototype was installed only in one fish tank, the usefulness of the system may be more significant if it is installed in more fish tanks to observe the effect of different fish species on the water quality.The overall score was 4.1, which shows that the subjects agreed that the proposed system is usable and acceptable.
Figure 10.The UT result summary

CONCLUSION
In this paper, automated water quality monitoring and forecasting for fish farms were described.The addition of the forecasting module was necessary to allow advance monitoring by the fish farm workers.Three water quality parameters were acquired, temperature, pH and DO.Real-time water quality monitoring was implemented as a web-based application.The forecasting of both methods has been measured using statistical methods such as MAE, RMSE, and MAPE.To generate the forecast, two regression-based techniques were investigated, the SVR and LSTM.LSTM was deployed and embedded in the web-based application due to its superiority over the SVR in the context of the dataset used in the presented work.The UT shows that the proposed system is usable and acceptable, whereby the functions provided enable the workers to monitor the water quality data remotely.Such feature allows the fish farm management to make the decision and take appropriate actions in a timely manner to avoid a significant decrease in the fish tank's quality of water.
The proposed automated water quality monitoring and forecasting system has several limitations.First, the forecasting feature was not implemented automatically, whereby the users must initiate the forecasting module in order to generate the forecast water quality for the next several days.It would be beneficial if the forecast could be automatically triggered when a certain value of water quality readings is recorded at a particular time.Second, a mobile application version of the system may be useful to allow push notifications and instant updates from the fish tanks.
Based on the identified limitations, future work could focus on the development of a module that is able to invoke the forecast automatically without human intervention based on the identified triggers.A trend in the previous sequence of readings that eventually led to poor water quality may need to be identified.Based on the identified trend, the system should trigger the forecasting module whenever a similar trend may occur based on the analysis of the real-time readings of the water quality data.Other than that, a mobile application based on a platform that could generate an android and iOS-based application should be developed.Last, some automation could be developed, such as a remotely controlled water changer and temperature controller, to increase the usefulness of the system.

Figure 1 .Figure 2 .
Figure 1.Schematic diagram of the hidden layer of LSTM

Figure 3 .
Figure 3.The forecasting model investigation framework

Figure 4 .Figure 5 .
Figure 4.The schematic diagram of the proposed intelligent water quality monitoring and forecasting system Bulletin of Electr Eng & Inf ISSN: 2302-9285  Automated water quality monitoring and regression-based forecasting system for aquaculture (Toh Yin Wei) 575

Table 1 .
The performance of SVR with RBF Kernels