Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Weather Prediction Application Based on

ANFIS (Adaptive Neural Fuzzy Inference


System) Method In West Jakarta Region
Anif Hanifa Setyaningrum, Praditya Megananda Swarinata
Department of Informatics Engineering, Faculty of Science and Technology, State Islamic University of Syarif
Hidayatullah Jakarta

Abstract- Rainy season in Indonesia between October meteorology rain drop with a diameter of more than
to April with the highest rainfall peak in December. But 0.5 mm in diameter and is called rain between 0.5 -
there is the possibility of weather’s anomaly and even 0.1 mm is called drizzle. The larger the grain size, the
climate irregularities. Some studies also mention that the greater rain fall speed. The accuracy of measuring
climate’s affect the economic situation in one region.
instruments rainfall is 1/10 mm. Readings were taken
Especially in West Jakarta. West Jakarta is one of
region for connecting activity of economy, where activity once a day and recorded as rainfall earlier
done by using air transportation that never stop today/yesterday [1].
running. It needs special handling, so that the rainfall Methodology of intelligent system potentially far
predicted by applying the basic rules of reasoning and in pattern detection and forecasting process. ANFIS
fuzzy logic. This research applies ANFIS to predict three (Adaptive Neural Fuzzy Inference System) has the
weather variables, namely air temperature, air humidity advantage in drawing conclusions, and also gives the
and wind speed as a predictor. The data used is the ability for the system to input learning. Thus the result
weather data from West Jakarta region in January, of good intelligent information systems, should be
February, March, July, August and September in the
able to take advantage of the interaction for the
year of 2012, and got from Meteorology Climatology and
Geophysics Agency Jakarta. Adaptive Neural-Fuzzy resolution and determination of solutions to problems
Inference System (ANFIS) for weather prediction has a in a comprehensive manner.
level of accuracy 100%, because each one is able to
predict the qualitative value of the category 0 (rain) and B. Scope of Works
1 (not rain) same with expert opinion, and from total Some of limited scopes for this thesis:
samples 183 and 180 as training data, testing and 1. Type of object to be studied by the author is
checking. the rainfall in the West Jakarta region only.
2. The secondary data that author used as weather
Keywords: weather, weather prediction, fuzzy logic,
prediction object are data from January,
ANFIS
February, March, July, August and September
I. INTRODUCTION on 2012 and as much as 183 and 180 daily
data.
A. Background of Problem 3. The secondary data that author used as weather
Weather condition is an important thing that prediction object are only data with lowland
needs to be studied because of the weather in a region condition.
determines the range of human activities. For 4. The process of identifying a problem is rain or
example, climate information and its classification not rain symptoms resulting from daily
much a reference to the fields of agriculture, observation, and will be match to the expert
transportation, and tourism such as cruise, or flight. opinion in the form of temperature at 7am
Some studies also mention that the climate’s affect the (Temp7), humidity at 7am (RH7) and wind
economic situation in one region. Especially in West speed at 7am(FF7).
Jakarta. West Jakarta is one of region for connecting 5. The application just showing prediction result
activity of economy, where activity done by using air without showing database from input and
transportation that never stop running. Then it need output (prediction) variable.
special handling, by using weather prediction, so all of 6. Target of this application is for ordinary staff,
activity that related to air transportation will going run not for an expert.
smoothly. 7. The process of making application using
The weather is influenced by several factor, there MATLAB R2013A version as just a tools and
are temperature, relative humidity, air pressure, wind not make an algorithm, in fuzzy logic
speed, and rainfall of course. Rainfall is the amount of identification with Takagi Sugeno method.
water that falls to the earth's surface. The degree of
precipitation is expressed by the amount of rainfall in
a unit time. Usually the units used are mm/hour. In

113

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on December 06,2020 at 11:33:31 UTC from IEEE Xplore. Restrictions apply.
II. LITERATURE STUDY
Fuzzy set is a group that represents a particular
A. Artificial Intelligence condition or circumstance in a fuzzy variable.
The term artificial intelligence is derived from Example:
English as "Artificial Intelligence". If interpreted each 1. Variable temperature. Divided into 5 fuzzy
word, artificial means dummy and intelligence is an sets, namely: COLD, COOL, NORMAL,
adjective that means smart . So artificial intelligence is WARM and HOT.
something artificial that has smart character.
Intelligent herein shall have the meanings possibility
cleverness or sharpness in thinking, as well as the
human brain in solving a problem.
Artificial intelligence is defined as intelligence
exhibited by an artificial entity. This type of system
generally considered as a computer. Intelligence was
created and inserted into the computer in order to do
the job like that can be done by humans . And
artificial intelligence is not just about understanding
Fig. 1. Example of Fuzzy Set
what the intelligence system, but also to reconstruct
[3].
D. Membership Function
B. Neural Network Membership function is a curve that shows the
There are three kinds of neural network applica- mapping of points of input data into membership
tions, there are [4]: values (which has the interval 0 to 1). One way that
1. Pattern Recognition can be used to obtain the membership value is the
Neural network can be used to identify patterns function approach [7]. There are several functions that
such as letters, numbers or a voice that has been can be used are:
slightly changed. This is similar to the human
brain is still able to recognize people who have 1. Linier Representation
some time never meet again (probably facial or In the linear representation, mapping inputs into
change of body shape). degrees of membership is described as a straight line.
2. Signal Processing There are 2 state of the linear fuzzy sets.
Neural network (ADALINE models) can be First, the set begins to rise in value domains that
used to press noise on the phone line. have a degree of membership of zero [0] to move to
3. Prediction the right towards the value of a domain that has a
Neural networks can also be used to predict higher degree of membership.
what will happen in the future, based on the
existing pattern of events in the past. This can be
done considering the ability of neural networks to
remember and make a generalization of what
already exists.
In addition to these areas, artificial neural
networks are also reported to resolve problems in
the areas of control, medicine, and others.

C. Fuzzy Logic Fig. 2. Up Linier Curve Representation


There are some reasons why people use fuzzy
logic according to [5]: Second, a straight line starting from the value of
1. The concept of fuzzy logic is easy to understand. the domain with the highest degree of membership
The underlying mathematical concept of fuzzy on the left side, then moving towards the domains
reasoning is very simple and easy to understand. values that have a lower degree of membership.
2. Fuzzy logic is very flexible.
3. Fuzzy logic can tolerate data that isn’t right.
4. Fuzzy logic is capable of modeling the nonlinear
functions that very complex.
5. Fuzzy logic can establish and apply the
experiences of experts directly without having to
go through the training process.
6. Fuzzy logic can work with the techniques of
conventional control. Fig. 3. Down Linier Curve Representation
7. Fuzzy logic is based on natural language.

114

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on December 06,2020 at 11:33:31 UTC from IEEE Xplore. Restrictions apply.
membership function is obtained based on interviews
2. Triangle Curve Representation with expert.
Triangel curve is basically a combination of two Temperature consist of three parameters: cold,
lines ( linear ) as shown in the picture below: warm and hot. Fuzzy value of temperature based on
air temperature is as follows:

TABLE I
VALUE OF FUZZY SET TEMPERATURE
Temperature (Temp7) Value
Cold 22,1 – 25 0c
Warm 25,1 – 27 0c
Hot 27,1 – 29 0c
Fig. 4. Triangle Curve Representation
Membership function of temperature Gaussian
E. Fuzzy Inference System (FIS) type described as follows:
The resulting fuzzy system called Fuzzy Inference
System (FIS). FIS is successfully applied in various
fields, such as automatic control, data classification,
decision analysis and expert system. Flexible due to
its ability to be applied in various fields, FIS is often
called by other names such as fuzzy rule-based
system, fuzzy expert systems, fuzzy modeling, fuzzy
logic controllers and fuzzy systems. Fig. 5. Membership Function of Temperature Gaussian Type

F. Adaptive Neural Fuzzy Inference System (ANFIS) Humidity consist of three parameters: dry, wet
ANFIS is developed by JSR Jang in 1992. and moist. Fuzzy value of humidity are:
According to Jang, class adaptive network is
functionally equivalent to a fuzzy inference system. TABLE II
ANFIS is an architecture that functionally same VALUE OF FUZZY SET HUMIDITY
with Sugeno fuzzy rule based model. ANFIS
Humidity(RH7) Value
architecture is also similar to the neural network with Dry 41 – 60 %
radial function with less certain restrictions. It could Wet 61 – 80 %
be said that ANFIS is a method which is used in Moist 81 – 100 %
making the adjustment rule learning algorithm to a set
of data. In ANFIS is also possible to adapt the rules Membership function of humidity Gaussian type
[10]. described as follows:

III. ANALYSIS, INPUT, ARCHITECTURE AND OUTPUT


DESIGN.
A. Analysis Design
Requirement analysis is the identification of
issues that need to be used on the system parameter to
be used in accordance with expert opinion. First, Fig. 6. Membership Function of
conduct interview with expert to know the parameter Humidity Gaussian Type
or variable that identify the weather prediction.
Second, identifying weather data observation that Wind speed consist of three parameters: weak,
indicate that the observed data is the cornerstone in medium and tight. Fuzzy value of wind speed
determining the outcome (rain or not rain) in West are:
Jakarta region.
B. Input Design TABLE III
VALUE OF FUZZY SET WIND SPEED
1. Fuzzy and Membership Function Wind Speed (FF) Value
Fuzzy set is a specific condition in a fuzzy Weak 0 – 8 knots
Medium 9 – 17 knots
variable. Design data structures using fuzzy sets Tight 18 – 26 knots
which are divided into criteria and parameters.
Criteria of weather prediction, namely temperature, Membership function of wind speed
humidity and wind speed. Data are presented as fuzzy Gaussian type described as follows:
criteria and each criteria has a parameter that reflects
the membership in fuzzy set. Value of each

115

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on December 06,2020 at 11:33:31 UTC from IEEE Xplore. Restrictions apply.
Rain 0 0,5
Not Rain 0,51 1

IV. TESTING RESULT

A. BlackBox Testing
At this stage of the testing done by black box
testing. The testing phase was conducted to ascertain
Fig. 7. Membership Function of
Wind Speed Gaussian Type whether the application has been running well and can
be used by a user or not. Testing is done by examining
In this study, the ANFIS is used as a neural weather data input and display the help menu. Testing
network architecture and set 3 types of Gaussian is done in MATLAB.
membership functions. In ANFIS architecture
adaptively shaped membership function B. Training and Testing Data Examination with
according to the amount of data entered (training ANFIS Model
data). Test conducted on the ANFIS models were built.
The purpose of testing is to find the ideal model. Prior
2. Rule Base to testing, the model training is done beforehand.
In the calculation of data with ANFIS used IF Training the model using the training data and testing
THEN rules. The rules are based on expert data.
opinion. The number of rules in accordance with Training data and testing data contains
the number of criteria and parameters. In this information about input data such as temperature,
study, there are three criteria, namely humidity, wind speed and output data is numeric
temperature, humidity and wind speed. Each predictions (rain or not rain).
criteria has three parameters so that the number Models that has been trained are given
of rules to 33 = 27 rules. appropriate input data testing. The test results are
compared with the predictions of the model output on
A. Architecture Design testing data. The more equal comparison between the
Design using ANFIS architecture, by using model output with prediction models, so model will be
Takagi-Sugeno type first orde, while for using more accurate.
Gaussian membership function. The learning process
is carried out using a hybrid algorithm. C. Model Examination with Training, Testing and
ANFIS architecture is determined by the number Checking Data.
of criteria and parameter, there are three input criteria, In testing the data, conducted the training, testing
namely temperature, humidity and wind speed criteria and checking.
which each has 3 parameters. ANFIS structure can be First process, do first examination by input
seen in the image below: training data, testing and checking the data of 183
samples.

Fig. 8. ANFIS Architecture


Fig. 9. Do Training Data
B. Output Design
ANFIS conclusion is presented in two categories.
Categories of data obtained by make a categories from
result, and then group it into group 0 and group 1
based on expert opinion. Training data obtained from
the minimum and maximum output values as follows:

TABLE 4
MINIMUM AND MAXIMUM VALUE OF TRAINING
DATA OUTPUT Fig. 10. Do Testing Data

Sampel Data Minimum Value Maximum Value

116

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on December 06,2020 at 11:33:31 UTC from IEEE Xplore. Restrictions apply.
Fig. 11. Do Checking Data Fig. 16. Training Result

From the total 183 samples and also 180 samples


in the training, testing and checking in, FIS and
ANFIS output results are not much different, and
the results also showed the prediction result is
same with output target (0/1) that got from the
expert.

D. User Interface Implementation


At this stage, the design view of the concept of
Fig. 12. Training Result
weather prediction application has been implemented,
Second process, do second examination by the following is the display interface of the Weather
input training data, testing and checking the data Prediction Application:
of 100 samples. The results of the test input and 1. Opening Page Display
output can be seen in appendices. This is the page that will appear the first time,
when a user accesses the application. This page
will display information from the application
developers. The picture can be seen in Fig. 17.

Fig. 13. Do Training Data

Fig. 17. Opening Page Display

2. Main Menu Display


On this page, user can select an existing 2 menu
in this application, there are weather data input
menu and help menu. The picture can be seen in
Fig. 18.
Fig. 14. Do Testing Data

Fig. 18. Main Menu Display

Fig. 15. Do Checking Data 3. Weather Input Data Display


On this page, users make weather prediction by
input 3 variables listed in the form, then the user
will get the result. The picture can be seen in Fig.
19.

117

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on December 06,2020 at 11:33:31 UTC from IEEE Xplore. Restrictions apply.
[6] Widodo, Prabowo Pudjo, Handayanto, Rahmadya Trias.,
Penerapan Soft Computing dengan MATLAB, Bandung:
Rekayasa Sains, 2009.
[7] Kusumadewi, Sri, Purnomo, Hari., Aplikasi Logika Fuzzy
untuk Pendukung Keputusan, Yogyakarta: Graha Ilmu, 2004.
[8] Kusumadewi, Sri, Purnomo, Hari., Aplikasi Logika Fuzzy
untuk Pendukung Keputusan, Yogyakarta: Graha Ilmu., 2004.
[9] Kusumadewi, Sri, Purnomo, Hari. Aplikasi Logika Fuzzy
untuk Pendukung Keputusan, Yogyakarta: Graha Ilmu, 2004.
[10] Kusumadewi, Sri., Fuzzy Logic MATLAB Toolbox, 2005.
[11] Kusumadewi, Sri, Hartati, Sri., Neuro-Fuzzy Integrasi Sistem
Fig. 19.Weather Data Input Form Fuzzy dan Jaringan Syaraf Edisi 2. Yogyakarta: Graha Ilmu,
2010.
4. Help Menu Display [12] Siang, J. J., Jaringan Syaraf Tiruan & Pemrogramannya
menggunakan MATLAB, Yogyakarta: Andi, 2004.
On this page, the user will be informed about the
range of any number that can be processed to obtain
the desired result weather predictions user. The
picture can be seen in Fig. 20.

Fig. 20. Help Menu Display

V. CONCLUSION AND RECOMMENDATION

Based on the research results, the researcher


concluded some of the following:
In general it can be concluded that the use of
Adaptive Neural-Fuzzy Inference System (ANFIS) for
weather prediction has a level of accuracy 100%,
because each one is able to predict the qualitative
value of the category 0 (rain) and 1 (not rain) same
with expert opinion, and from total samples 183 and
180 as training data, testing and checking
Based on the results of research by the authors can
provide suggestions for further research are as
follows:
1. The number of input data and also region
object for weather prediction should be
developed in order to have a prediction result
with more diverse categories.
2. Make this application as a web-based system,
so it has a more attractive appearance and
also can be commercialized.

REFERENCES
[1] Sosrodarsono, Suyono., Hidrologi, Jakarta: PT. Pradnya
Paramita, 1985.
[2] Arhami, Muhammad., Konsep Dasar Sistem Pakar.
Yogyakarta: Andi, 2005.
[3] Suyanto., Artificial Intelligence Searching, Reasoning,
Planning and Learning, Bandung: Informatika., 2007.
[4] Siang, J.J. Jaringan Syaraf Tiruan & Pemrogramannya
menggunakan MATLAB, Yogyakarta: Andi, 2009.
[5] Kusumadewi, Sri, Purnomo, Hari., Aplikasi Logika Fuzzy
untuk Pendukung Keputusan. Yogyakarta: Graha Ilmu, 2004.

118

Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on December 06,2020 at 11:33:31 UTC from IEEE Xplore. Restrictions apply.

You might also like