You are on page 1of 24
Universiti Teknologi MARA Predicting Water Quality for Aquaculture using Fuzzy Logic Prototype Siti Mashitah binti Haji

Universiti Teknologi MARA

Predicting Water Quality for Aquaculture using Fuzzy Logic Prototype

Universiti Teknologi MARA Predicting Water Quality for Aquaculture using Fuzzy Logic Prototype Siti Mashitah binti Haji

Siti Mashitah binti Haji Zakaria

Thesis submitted in fiilfilhnent of the requirements for

Bachelor of Science (Hons) Information Technology Faculty of Information Technology And Quantitative Science

November 2006

ACKNOWLEGMENT

Alhamdulillah, all praise be to Allah s.w.t, who has given me the strength and inspiration to complete this work. I would like to take this opportunity to express my gratitude and appreciation to many people who were involved directly or indirectly with the project. Firstly, my utmost gratitude goes to my project supervisor, Pn Shuzlina bt Abdul Rahman for her initial suggestions, advice, guidance and invaluable help throughout the development of the project.

ACKNOWLEGMENT Alhamdulillah, all praise be to Allah s.w.t, who has given me the strength and inspiration

I would like to thank En Johari Hj Abdul Latif from Segamat Aquaculture Officer, for his helps and supports. Special thanks to those who have directly or indirectly helped me in writing this report. Beside that I would like to thanks to the journalists of the usefiil articles that I referred during my research

To my femily, thank you for the support. I will never make it without your support. Finally, I would like to take this opportunity to thank all my friends who have helped me and supported me in comi^eting my final project. May Almighty Allah Bless and Reward them for their generosity.

u

COPYRIGHT © UiTM

TABLE OF CONTENT

Declaration

 

i

Acknowledgment

Acknowledgment

ii

Table of Content

iii

List

of Tables

vi

List of Figures

 

vii

List

of Abbreviations

ix

Abstract

 

x

CHAPTER

DESCRIPTION

PAGE

  • 1.1 Introduction

1

  • 1.2 Project Background

2

  • 1.3 Problem Statement

3

  • 1.4 Project's Aim

3

  • 1.5 Project's Objectives

4

  • 1.6 Project Scope

4

  • 1.7 Significance of Project

4

  • 1.8 Organization of the Thesis

5

  • 1.9 Summary

6

LITERATURE REVIEW

  • 2.1 Introduction

7

  • 2.2 Overview of Water Quality

7

  • 2.2.1 Water Chemistry in Freshwater Aquaculture

7

  • 2.2.2 Water Quality Variables

8

  • 2.3 Overview of Fu22y Logic

10

ui

COPYRIGHT © UiTM

2.4

Fuzzy Expert System

10

  • 2.5 Application ofFuzzy Expert System

12

  • 2.6 Application of Fuzzy and Expert System in Aquaculture

14

  • 2.7 Summary

16

2.4 Fuzzy Expert System 10 2.5 Application ofFuzzy Expert System 12 2.6 Application of Fuzzy and

METHODLOGY

  • 3.1 Introduction

17

  • 3.2 Research Approach and Methodology

18

  • 3.3 Knowledge Acquisition

20

  • 3.4 Data Analysis

21

  • 3.5 Design

23

  • 3.5.1 Define Fuzzy Sets

23

  • 3.5.1.1 Input Variables

24

  • 3.5.1.2 Output Variables

28

  • 3.5.2 Fuzzy Design

29

  • 3.5.3 Flow Fuzzy Design

30

  • 3.5.4 Fuzzy Rule Inference

31

  • 3.5.5 System Architecture

34

  • 3.5.6 Enterprise Modeling

36

  • 3.5.7 Interface Design

38

  • 3.5.8 Database Design

38

  • 3.6 Testing

39

  • 3.7 Documentation

39

  • 3.8 Sunra lary

39

DISCUSSION OF FINDING

  • 4.1 Introduction

40

  • 4.2 Fuzzy Design

40

  • 4.3 Fuzzification

41

IV

COPYRIGHT © UiTM

LIST OF TABLES

TABLES

TITLE

PAGE

  • 3.1 Research Methodolosf

19

  • 3.2 Preferred Ranges for Freshwater

3.2 Preferred Ranges for Freshwater

21

  • 3.3 Linguistic Variable for Typical Values

23

  • 3.4 Category of pH Levels

24

  • 3.5 Category of Dissolved Oxygen

25

  • 3.6 Category of Temperature

26

  • 3.7 Category of Turbidity

27

VI

COPYRIGHT © UiTM

4.10

Output from CoA Defuzification

47

  • 4.11 Output from CoM Defuzification

48

  • 4.12 Input Interfaces

49

  • 4.13 Check Min and LV

50

4.14 Check Inference Stage
  • 4.14 Check Inference Stage

51

  • 4.15 Fuzzification Result

52

viu

COPYRIGHT © UiTM

LIST OF ABBREVIATIONS

AI

Artificial Intelligent

CoA

-

Center-of-Area

CoM

-

CoM - Center-of-Maximum

Center-of-Maximum

DO

-

Dissolved Oxygen

DOS

-

Degree of Support

ES

-

Expert System

FAM

-

Fuzzy Associative Memory

FL

-

Fuzzy Logic

LV

-

Linguistic Variable

MoM

-

Mean-of-Maxima

IX

COPYRIGHT © UiTM

ABSTRACT

The study describes a web-based fuzzy Expert System (ES) to predict water quality of aquaculture in fireshwater. In fuzzy logic, small changes of concentration of one water quality parameter can cause significant changes of overall water quality. Making decision of the availability of water quality by manually may contribute to misdiagnosing and wrong decision-making. Therefore, in this study predicting water quality prototype using fuzzy expert system with a Mamdani-type inference engine. Predicting water quality for aquaculture offers computerized fiizzy expert system in dealing with uncertainty information in a way to determine level of water quality. The associated values and the fuzzy rules were constructed using hierarchical inference structure. Fuzzy sets and rule are encoded into the expert system in order to perform fuzzy inference. The system is able to predict water quality. It is also able to provide explanation and describe how the conclusion can be derived.

ABSTRACT The study describes a web-based fuzzy Expert System (ES) to predict water quality of aquaculture

COPYRIGHT © UiTM

CHAPTER 1 INTRODUCTION COPYRIGHT © UiTM

CHAPTER 1

INTRODUCTION

COPYRIGHT © UiTM

CHAPTER 1

INTRODUCTION

CHAPTER 1 INTRODUCTION 1.1 Introduction Water covers two-third of the Earth's surface with over 97% presents

1.1

Introduction

Water covers two-third of the Earth's surface with over 97% presents in the oceans and less than 1% in freshwater streams and lake. Water is an essential habitation for fish and other marine hves. According to Ruimei et al. (2002), tfie reproduction, growth and development of the fish are carried out in the water, therefore there should be better

water quality to ensure the fish to grow and develop, and that is very important for fish. Along with the development of the aquaculture, the intensive grade of the centralized aquaculture is becoming higher and higher. And as a result of the enhancement of the density of the aquaculture, the management of the water has been one of the main

factors that constrict the increase

for the fish yield.

Fish mortalities occur in natural populations and under aquaculture conditions. They are caused by a variety of factors. Fish can behave erratically, get sick or die in response to toxic substances, poor water quality and infectious disease. Fish have home ranges, territories within which they move and outside which they rarely go. However, they will go outside to get away from pollutants (like ammonia) which they can detect and perhaps be distressed by. Many pollutants however are not detected (Hellawell, 1986) and the fish suffered from a very rapid pollution (for instance, spills) or if the entire river is affected and there is no clean place to go.

Fish usually avoid severe organic pollution, except sometimes round sewage works outfalls, vs^ere they eat well, at least in cold weather. Fish are repelled by low oxygen levels, particularly at high temperatures. Where carbon dioxide rises (with

COPYRIGHT © UiTM

decaying organic matter), fish appear to need more oxygen and less sensitive to ammonium poisoning. Oxygen levels are also affected by weather (Hynes, 1960).

This thesis introduces a new approach to the level of water quality for aquacultuie by using Fuzzy Logic concepts. Fuzzy Logic is one of the Artificial Intelligent (AI) software and this method will promise fester, cheaper and higher technology (Pandian,

decaying organic matter), fish appear to need more oxygen and less sensitive to ammonium poisoning. Oxygen

2000).

  • 1.2 Project's Background

The source and quantity of water available are the most important fectors to consider when choosing a site for an aqiiaculture facility. Many undesirable chemicals and environmental factors associated with certain fish farms can be traced to lack of background information on the source of water used Before the final site for a new fami is selected, a thorough investigation of the quality and quantity of water must be considered by the producer.

According to Majid (2004), when choosing a good water source, it will be usefiil to know what characterizes an "ideal" source and how the source may be affected in the fixture. First, the source must be uncontaminated from excessive nutrients, chemicals or heavy metals. A source that meets this criterion should be fiirther investigated to determine the threat of fiiture contamination.

Therefore this fiizzy logic technique prototype will be applied to investigate the water quality of freshwater aquaculture and determine the availabiUty of water quality.

COPYRIGHT © UiTM

1.3

Problem Statement

Poor water quality can cause massive fish kills. It is often a major factor contributing to fish disease and parasite infection. Water quality does not remain constant. Most of the commercial fish producers have a wrater test kits to monitor the water quality of their facilities. Test kits are used to determine the concentrations of dissolved oxygen, carbon dioxide, nitrite, ammonia, hardness and alkalinity. The examples of water test kits are thermometer, pH meter and oxygen meter.

1.3 Problem Statement Poor water quality can cause massive fish kills. It is often a major

Nowadays, most of the commercial fish producers and Department of Fisheries, Malaysia are making decision of the level of water quality by manually based on the parameter of water quality. This situation may contribute to misdiagnosing and wrong decision-making. The price of test kits may range firom inexpensive aquaria kits to more expensive battery operated meters. The accuracy of these kits usually increases with price. HopefiiUy with fiizzy logic prototype, it will help in making conclusion and also getting the exact result.

  • 1.4 Projecfs Aim

This project is aim to develop a fazzy expert system prototype that is able to predict the water quality of aquaculture.

COPYRIGHT © UiTM

1.5

Project's Objectives

In order to achieve this aim, the project is breakdowns as follow:

1.5 Project's Objectives In order to achieve this aim, the project is breakdowns as follow: i)

i)

To identify the variables of the problem that determines the quality of the

ii)

water, To construct fuzzy sets and its memberships function,

iii)

To design an architecture of the prototype.

  • 1.6 Project Scope

The project focuses on water quality in freshwater aquaculture ponds only. The fiizzy logic prototype is designed for use of experts such as Aquaculture Officers and commercial fish producer. The domain expert system is Departaient of Fisheries Malaysia.

  • 1.7 Significance of Project

The significant of this project hopefully can help Aquaculture Officers especially in predicting water quality in order to minimize fish mortalities and also to get faster result. In fuzzy logic, small changes of concentration of one water quality parameter can cause significant changes of overall water quality. This is to make sure that the errors are reduced and thus can avoid mistaken conclusion. The system does not purpose to replace the role of the laboratory person or domain expert but simply as attempts to reduce their burdens.

COPYRIGHT © UiTM

1.8

Organization of the Thesis

Chapter 1: Introduction This thesis begins with chapter 1 which outlines a general introduction, background, problem statement, objective, scope and significance of the project.

1.8 Organization of the Thesis Chapter 1: Introduction This thesis begins with chapter 1 which outlines

Chapter 2: Literature Review This chapter describes a literature review on published works in the related fields of predicting water quality and aquaculture. This chapter also describes studies on water quality, fuzzy expert system and the application that involved.

Chapter 3: Methodology This chapter describes the detail methodology of the Fuzzy system. It covers the development of the data collection, research approach and methodology, data analysis, design and testing.

Chapter 4: Discussion of Findings This chapter focuses on fiizzification, fuzzy rule inference and defuzzification. This chapter presents the analysis level acceptable of water quality for aquaculture using FuzzyTech system and the result with membership functions and rule that were valid in the system.

Chapter 5: Conclusion and Recommendation This chapter summarizes the overall of the project and will provide the recommendation for future work.

COPYRIGHT © UiTM

1.9

Summary

In conclusion, selecting a good source of water that will provide large quantities of high quality water is one of the first steps to a successftil aquaculture enterprise. This is due to the fact that fish require large quantities of unpolluted water to grow rapidly vdiile maintaining their state of well-being.

1.9 Summary In conclusion, selecting a good source of water that will provide large quantities of

COPYRIGHT © UiTM

CHAPTER! LITERATURE REVIEW COPYRIGHT © UiTM

CHAPTER!

LITERATURE REVIEW

COPYRIGHT © UiTM

CHAPTER 2

CHAPTER 2 LITERATUKE REVIEW 2.1 Introduction In this chapter, a literature review on various fields related

LITERATUKE REVIEW

  • 2.1 Introduction

In this chapter, a literature review on various fields related to fiizzy logic and water quality of aquaculture is discussed. Section 2.2 reviews the parameter and water quality, section 2.3 explains the overview of fuzzy logic, section 2.4 reviews fiizzy expert system, section 2.5 reviews the application of fuzzy expert system and section 2.6 reviews the application fiizzy and expert system in aquaculture sectors. Section 2.7 is the last section that will be summarized in this chapter.

  • 2.2 Overview of Water Quality

Poor water quality can cause massive fish kills. It is often a factor that contributes to fish disease and parasite infection. Water quality does not remain constant. A pond's water quality may change drastically within a few hours.

  • 2.2.1 Water Chemistry in Freshwater Aquaculture

According to Rahman (2004), some water quality factors are more likely to be involved with fish losses such as dissolved oxygen, temperature and ammonia. Others such as pH, alkalinity, hardness and clarity affect fish but usually are not directly toxic. The

COPYRIGHT © UiTM

following

water

quality

variables

are considered

to

be

the

most

important

in

aquaculture:-

following water quality variables are considered to be the most important in aquaculture:- 2.2.2 Water Quality
  • 2.2.2 Water Quality Variables

Temperature

All biological and chemical processes in an aquaculture operation are influenced by temperature. Fish adjust their body temperature and metabolic rate by moving into cooler or warmer water. Each species has a preferred or optimum temperature range where it grows best. At temperature above or below optimum, fish growth is reduced. Mortalities may occur at extreme temperatures.

Dissolved Oxygen

Dissolved oxygen (DO) is probably the most critical water quality variables in freshwater aquaculture. Oxygen level depends on water temperature, stocking rates of aquaculture species, salinity and the amount of aquatic vegetation and number of aquatic animals in the freshwater.

DO in a culture system must be maintained above levels considered stressful to fish. Warm water fish (species that grows best at temperature above 80°F) can tolerate lower DO concentrations than coldwater fish (species that grow best at temperature below 60°F). As a rule of thumb, DO should be maintained above S.Oppm (parts per milUon) and S.Oppm for warm and coldwater fish respectively.

COPYRIGHT © UiTM

pH Levels

The measure which indicates whether water is acidic or basic is known as pH. Water is considered acidic when pH is below 7 and basic when pH is above 7. Most pH values encountered fall between 0 and 14. The recommended pH range for aquaculture is 6.5 to 8.5. Fish and other vertebrates have an average blood pH of 7.4. Fish blood comes into close contact with water as it passes through the blood vessels of the grills and skin.

• pH Levels The measure which indicates whether water is acidic or basic is known as

A desirable range for water pH would be close to that of fish blood. Fish may become stressed and die if the pH drops below 5 (e.g. acidic runoff) or arises above 10 (e.g. low alkalinity)

Turbidity

Water turbidity is important as it determines the amount of light penetration that occurs in the water column of a pond. This in tum will have an affect on the temperature of the water and the amount of vegetation and al^ie that will grow in the pond itself

Turbidity is measured in centimeters using a sechii disk which consists of a round plate divided into alternate black and white "pie" sections. This disk is attached to a graduated rope or a metal handle and divided into measuring units (usually at 2 cm intervals). The disk is lowered into the water until it can not be seen and then raised until it re-appears. Sechii depth between 20cm and 60cm are recommended for optimal management of freshwater ponds.

COPYRIGHT © UiTM

2 3

Overview of Fuzzy Logic

Fuzzy logic attempts to model reasoning in situations where information is imprecise and vsliere uncertainty exists. It mimics the human ability to find solutions for many real-world problems by interpolating information when handling the situation where data is missing, incorrect or uncer^n.

2 3 Overview of Fuzzy Logic Fuzzy logic attempts to model reasoning in situations where information

Fuzzy logic was first developed by Zadeh. It was developed for solving decision making problems with 'IF-THEN' rules. Later, it was used to deal with uncertainty and imprecise data management.

  • 2.4 Fuzzy Expert System

According to Rao and Pratihar (2006) a fiizzy logic based expert system, works based on the principle of fuzzy set theory and it is a potential tool for dealing with imprecision and imcertainty. The fiizzy logic based expert systems have been developed by various researchers, after realizing their potential in solving real world complex problems. The authors point out that the performance of an expert system mainly depends on its knowledge based, vMch consists of a database and a rule base. Thus, designing a proper knowledge base is very important vsiiich is difficult too.

A fiizzy expert system is simply an expert system (ES) that uses a collection of fiizzy membership fimctions and rules, instead of Boolean logic, to reason about data (Schneider et al, 1996, cited by Abraham, 2005). The rules in a fiizzy expert system are usually of a form similar to the following:

If A is low and B is high then X = medium where A and B are input variables, X is an output variable.

10

COPYRIGHT © UiTM

Here low, high and medium are fuzzy sets defined on A, B and X respectively. The antecedent (the rule's premises) describes to what degree the rule applies, while the rule's consequent assigns a membership function to each of one or more output variables.

Here low, high and medium are fuzzy sets defined on A, B and X respectively. The

Figure 2.1 illustrates the basic architecture of a fiizzy expert system. The main components are a fiizzification interface, a fuzzy rule base (knowledge base), an inference engine (decision-making logic) and a defuzzification interface. The input variables are applied to their actual values, to determine the degree of truth for each rule antecedent. Fuzzy IF-THEN rules and fuzzy reasoning are the backbone of fuzzy expert system, which are the most modeling tools based on fuzzy set theory. The fiizzy rule base is characterized in the form of IF-THEN rules in vs^ch the antecedents and consequents involve linguistic variables.

The collection of these fiizzy rules forms the rule base for the fiizzy logic system. Using suitable inference procedure, the truth value for the antecedent of each rule is computed, and applied to the consequent part of each rule. This results in one fiizzy subset to be assigned to each output variable for each rule. Again, by using suitable composition procedure, all the fiizzy subsets assigned to each output variable are combined together to form a single fiizzy subset for each output variable. Finally, defuzzification is applied to convert the fiizzy output set to a crisp output (Abraham,

2005).

11

COPYRIGHT © UiTM

 

Fu2zi£ication

Inference Engine

 

Defuzzification

Crisp input

Interface

Fuzzy input

Fuzzy

Interlace

Crisp

 
  • 1 output

U

'

'

'

output

Rules

Rules

 

Fuzzy Rule Base

 

Figure 2.1 Basic architecture of a fuzzy expert system (Source: Adapted from Abraham, 2005)

Siraj and Arbaiy (2006) pointed out defuzzification or decomposition involves finding a value that best represents the information contained in the fiizzy set. There are a number of defuzzification methods such as Center of Area (COA), Center of Sums (COS) and Mean of Maxima (MOM).

Meanwhile Cheung et al. (2005), mentioned that defuzzification refers to the reproduction of a range of conclusions with different membership to a single point output. The conclusions reached from the rules were defuzzified based on the output fuzzy membership functions.

  • 2.5 Application of Fuzzy Expert System

Siraj and Tajuddin (2006) have built a fuzzy system, called FuzzyXteem to measure students' self-esteem at early age using real time computation. FuzzyXteem facilitates user by automatically evaluating Behavioral Academic Self-Esteem (BASE) factors and helps the user to diagnose their student's level of academic self-esteem in 3 ratings, low, moderate and high. FuzzyXteem is also able to provide explanation and describe how

12

COPYRIGHT © UiTM

the conclusion can be derived. FuzzyXteem is a web-based application that runs online by using Microsoft Active Server (ASP).

Meanwhile Sir^ and Arbaiy (2006) indicated that fuzzy logic lets expert system perform optimally with uncertain and unambiguous data and knowledge. Fuzzy ES is very efifective in improving hourly load forecast accuracy. More than that, it can improve accuracy using fiizzy rule-based approach. They are proposed FuzzyXPest to provide information to the farmer and researchers through the Internet using fuzzy expert system. This system is used to forecast the level of pest activity in rice fields and also provide explanation fecilities.

the conclusion can be derived. FuzzyXteem is a web-based application that runs online by using Microsoft

The authors point out that fiizzy inference can be implemented in two ways using IF-THEN statements only or directly using Fuzzy Associative Memory (FAM). The IF- THEN implementation is same as executed in expert system except it involves linguistic variables. Rules are simplified in fiizzy associative memory (FAM) tables to make the system easier to evaluate each set of rules. In their study, FAM is constructed by two inputs and produced one output at each inference stage. This single inference structure is shown in Figure 2.2.

Atribute 1

 

Outtnit

Atribute 2

 

a) Two Attributes

Atribute 1

Atribute 2

 

Output

Atribute 3

I) ) More tlla n two attributes

Figure 2.2 Single Inferences and Hierarchical Inference Structure

(Source: Adapted from Siraj and Arbaiy ,2006)

13

COPYRIGHT © UiTM

other example that develops with technique expert system is Saini et al. (2002) which is a web-based fuzzy Expert System (ES) SOYPEST (Soybean Pest Expert System) for Integrated Pest Management (IPM). This system is to identify the active pests and to calculate the activity of active pests followed by their diagnosis. Web based SOYPEST ES using Java technology in their system.

other example that develops with technique expert system is Saini et al. (2002) which is a

Dokas (2005) is also implementing a web based fuzzy expert system for accident prevention in landfills. This web based expert system called Landfill Operation Management Advisor (LOMA). Besides that, Cheung et al. (2005) presents a fiizzy expert system that integrates life history and ecological characteristics of marine fishes to estimate their intrinsic vulnerability to fishing.

  • 2.6 Application of Fuzzy and Expert System in Aquaculture

A few expert systems have been developed for aquaculture purpose. Ruimei, Youyuan and Zetian (2002) developed a prototype ES to evaluate the water quality of the aquaculture pond and predict the water quality in the future by setting up and solving the model and instruct the production and ^)ply relevant controlling countermeasure for the management of water quality. It consists of four sub-systems which are database, knowledge base, model base and method base. Method - base consists of simple classic evaluation method and fuzzy synthetically evaluation method.

Many countries have introduced a scheme for river water quality monitoring and assessment, examining separate stretches of freshwater in terms of their chemical, biological and nutrient constituents and overall aesthetic condition. One well-known assessment methodology is the Water Quality Index (WQI), developed by the National Sanitation Foundation (NSF) using the Delphi technique as a tool in a formal assessment procedure (Ott, 1978, cited by Chang et al., 2001).

14

COPYRIGHT © UiTM