See discussions, stats, and author profiles for this publication at: https://www.researchgate.
net/publication/287359577
Automatic development of fuzzy membership functions on hepatitis patients
data using particle swarm optimization (PSO)
Article · December 2015
DOI: 10.11113/jt.v77.6670
CITATIONS                                                                                                 READS
0                                                                                                         50
3 authors, including:
             Candra Dewi
             Brawijaya University
             28 PUBLICATIONS   18 CITATIONS   
                 SEE PROFILE
Some of the authors of this publication are also working on these related projects:
                   Identifying Quality of Patchouli Leaves through Its Leave Image Using Learning Vector Quantization View project
 All content following this page was uploaded by Candra Dewi on 27 January 2016.
 The user has requested enhancement of the downloaded file.
 Jurnal
                                                                                                                 Full Paper
 Teknologi
 AUTOMATIC DEVELOPMENT OF FUZZY MEMBERSHIP                                                                     Article history
                                                                                                                    Received
 FUNCTIONS ON HEPATITIS PATIENTS DATA USING                                                                      27 April 2015
                                                                                                     Received in revised form
 PARTICLE SWARM OPTIMIZATION (PSO)                                                                              15 June 2015
                                                                                                                   Accepted
 Candra Dewi*, Ratna Putri P.S, Indriati                                                                  25 November 2015
 Informatics Department, Brawijaya University, Malang,                                           *Corresponding author:
 Indonesia                                                                                       dewi_candra@ub.ac.id
 Abstract
 Information about the status of disease (prognosis) for patients with hepatitis is important to determine the type of action to
 stabilize and cure this disease. Among some system, fuzzy system is one of the methods that can be used to obtain this prognosis.
 In the fuzzification process, the determination of the exact range of membership function will influence the calculation of
 membership degree and of course will affect the final value of fuzzy system. This range and function can usually be formed using
 intuition or by using an algorithm. In this paper, Particle Swarm Optimization (PSO) algorithm is implemented to form the triangular
 membership functions in the case of patients with hepatitis. For testing process, this paper conducts four scenarios to find the
 best combination of PSO parameter values . Based on the testing it was found that the best parameters to form a membership
 function range for the hepatitis data is about 0.9, 0.1, 2, 2, 100, 500 for inertia max, inertia min, local ballast constant, global
 weight constant, the number of particles, and maximum iterations respectively.
 Keywords: Hepatitis, fuzzy system, membership function, particle swarm optimization
                                                                                      © 2015 Penerbit UTM Press. All rights reserved
1.0 INTRODUCTION                                                      diagnosis. Recently, the usage of fuzzy to improve the
                                                                      performance of inference system is broadly used.
Hepatitis is a medical condition in which the liver                   Accordingly, determining the prognosis of some
becomes inflamed. This can be caused by many things,                  disease uses Fuzzy Inference System (FIS) has been
including viruses, bacteria, toxins as a result of liver              done [7-9].
injury, and by the body's own immune system [1]. Based                    Fuzzy inference process the mapping of input to
on data from the World Health Organization (WHO), an                  output with the fuzzy logic. This mapping will provide the
estimated 3% of the world population has been                         basis for a decision or determination of the pattern. FIS
infected     with    viral   hepatitis.   Beside,    about            could be used without hybrid it with another method
approximately 170 million people have been                            [7]. But, to improve the performance, FIS is usually hybrid
chronically infected, and the number of Hepatitis                     with some algorithm. This hybrid can be developed to
patients grow 3-4 million people each year [2]. The                   pre-process the input data or to develop fuzzy rule [8-
prognosis is needed to determine the next treatment to                9].
stabilize and cure this disease. Prognosis is done by                     Beside the data and rule base, the shape and
determining the status of the patient's condition based               boundaries of membership function are also a
on the test results [3]. Thus, the status of the disease is           significant factor in determining the membership
very important to identify with the process of healing                degrees of input parameter. However, there is often no
the patients with hepatitis.                                          reference or expert who can describe this limit.
    The prognosis can be done using the computer                      Therefore, the determination of membership function
instead of referring to the doctor. Some research on                  boundary would be very helpful if it can be done
computer field has been done to diagnose this disease                 automatically. This process can be done using intuition
[4-6]. Among the methods used, the expert system is a                 or learning algorithm [9-14].
method that performs inference based on the doctor’s
                             77:22 (2015) 115-119 | www.jurnalteknologi.utm.my | eISSN 2180–3722 |
116                            Candra Dewi, Ratna Putri, Indriati / Jurnal Teknologi (Sciences & Engineering) 77:22 (2015) 115-119
Particle Swarm Optimization algorithm (PSO) is a                                           accuracy is 73,55%. The Naïve Bayes method produces
learning algorithm that is widely used. PSO is a                                           the best accuracy of 86.35%, with an average
stochastic search algorithm that uses a modeling                                           accuracy of 83.05 % and the lowest accuracy of 66.94
problem through n - dimensional space to minimize or                                       %. While the FDT (Fuzzy Decision Tree) method has the
maximize the objective function of a problem [13, 15]. S                                   highest value of 78.15 % accuracy, average accuracy
study that compared the performance of PSO with                                            of 75.39 % and lowest accuracy of 61.49 % [6].
clustering methods in data mining mentioned that in                                        Therefore, this study used the PSO to seek the optimal
500 running times, PSO has the best accuracy of 89.86                                      limits of fuzzy membership functions of the hepatitis
% with a mean accuracy of 82.66 % and the lowest                                           disease patient parameters.
                                                                                           where,
                                                                                            vik : speed of agent i at iteration k
2.0 EXPERIMENTAL
                                                                                            ω : weight function (inertia)
                                                                                            ci : weighting factor
2.1 Membership Function                                                                     rand : random value between 0 and 1
                                                                                            sik : last position of agent i at iteration k
Fuzzy logic is used to overcome fuzziness phenomenon                                        pbesti: the best position of agent i
and is modeled through the truth value that is taken                                        gbest : the best value of pbest
from the succession scale [16]. The fuzzy set can be
characterized by using certain membership functions.                                       The value of inertia is updated at every iteration using
This paper models a triangular membership function                                         the following equation [19]:
formed by three values, i.e. a, b and c [17, 18]. The term
a and c in the triangular membership function describe
                                                                                                                     
the end point, while b describes the peak point. This                                                             max     min
                                                                                                                          x iter           (3)
function is represented using the following formula:                                                max            iter
                                                                                                                       mx
                                             0,                x  a
                                            xa
                                                     ,       a  x  b                    where,
Triangular ( x : a , b , c )  
                                             ba                                     (1)
                                             cx
                                                                                            ωmax : initial value of inertia
                                                             b  x  c                     ωmin : the last value inertia
                                              cb
                                                                                           itermax : maximum number of iterations
                                              0                x  c
                                                                                            iter : number of the last iteration
2.2 Particle Swarm Optimization                                                            The position of the agent will change at every iteration
                                                                                           according to the velocity changing and can be
Particle Swarm Optimization (PSO) algorithm is a                                           calculated using the following equation [15]:
population based optimization technique to find the
optimal solutions using a population of particles
                                                                                             sik 1  sik  vik                                (4)
themselves. PSO is based on the idea that every particle                                   where,
crowd is a solution of the solution space [13]. The                                          sik 1 : the position of the current agent
pseudo code of PSO algorithm is described in
                                                                                             sik : prior agent position
Figure 1.
                                                                                             vik : the current speed
             Start
             for each particle i
               initialize the position and velocity
             end for                                                                       2.3 Encoding Scheme of Particle
             while (not max iteration)
               for each particle i
                 describe fitness value ωi
                 if ωi is better than current pbest
                                                                                           The process of encoding of particle is based on the
                      then pbest_fitness = ωi , pbest = sik                                parameter of input which is the hepatitis factors. The
                 if ωi is better than current gbest
                     then gbest_fitness = ωi , gbest = sik                                 membership function of each linguistics variable uses
               end for
               for each particle i                                                         triangular membership function. The system process six
                 calculate vik
                 update vik                                                                parameters, i.e. bilirubin, ALK Phosphate, AST, Albumin
               end for
               update ω
                                                                                           and ProTime of which each has three linguistics
             end while                                                                     variable, and age parameter which has four linguistic
             End
                                                                                           variable. Therefore, the total linguistic function being
                         Figure 1 Pseudo code of general PSO                               processed is 19.
                                                                                               The triangular membership function is formed by
                                                                                           three parameters, namely a, b, and c. Thus the total
The changing of velocity has been described in the                                         dimension of each particle is 57 dimensions obtained
pseudo code can be represented by the following                                            from 19 linguistic functions with each linguistic function
equation [15]:                                                                             have 3 parameters. The encoding scheme of particle
      k 1                                                                                 for this paper is shown in Figure 2
                                                                                     (2)
                     k                                    k                    k
   vi         v i  c1 rand 1 x ( pbest i  s i )  c 2 rand 2 x ( gbest  s i )
117                    Candra Dewi, Ratna Putri, Indriati / Jurnal Teknologi (Sciences & Engineering) 77:22 (2015) 115-119
           a1     b1      c1   a...   b...   c...   an   bn     cn        50 training data and 30 testing data. Attributes used in
                                                                          this papers arenamely Age, bilirubin, ALK Phosphate,
            Linguistic 1        Linguistic ...       Linguistic n
                                                                          AST, Albumin, and Protime.
                                                                               The test is done to obtain the best combination of
                Figure 2 Encoding scheme of particle
                                                                          PSO parameter values that is measured based on
                                                                          smallest MSE value. Testing is done with 4 scenarios. The
2.4 Developing Membership Function                                        first scenario is done by changing the parameter value
                                                                          of the maximum inertia (ωmax) and minimum inertia
The process of developing the membership functions                        (ωmin). The second scenario is done by changing the
using PSO is shown in Fig. 3. The input of the process is                 values of constant local weights (c1) and constant
maximum inertia (ωmax) and minimum inertia (ωmin),                        global weight (c2). The third scenario is done by
maximum iteration (itermax), weight factor (c1 , c2), and                 changing the value of particle number. The fourth
the number of particles (particle_num). The fitness                       scenario is done by changing the value of the
measurement is calculated based on the value of the                       maximum iteration. Each test was repeated 10 times
membership degree of the particle positions (s). Initial                  and was recorded the value of the parameter that
gbest value (the best value of the particle of the whole                  produces the smallest average error.
dimension) use the membership functions are
                                                                                Table 1 Testing result of the combination of inertia
predefined and initial position value of the particle is
randomly taken from the training data value. Each                                                  Average MSE at ωmin
particle is designed in 3 dimensions, where each                                  ωmax         0,1          0,2           0,3
dimension (v) represents a boundary point of each                                 0,7       0,003619     0,004398      0,006481
membership function.                                                              0,8       0,002628     0,003738      0,004497
   The results of modeling fuzzy membership function                              0,9       0,002119     0,002512      0,002905
can be measured by the Mean Square Error (MSE). The
calculation of MSE shown in Equation (5) is used as a
fitness function for the implementation of the PSO                           The first scenario uses ωmaxvalue of 0.7, 0.8, 0.9 and
algorithm [16]. The smaller of MSE value generated, the                   ωmin value of 0.1, 0.2, 0.3. This test is done at value of c1
better of the results of experiments resulted.                            = 2, c2 = 2, the maximum iterations = 100, and the
           ( y k  yˆ k ) 2                                              number of particle = 10. The test result for the first
            q
                                                     (5)
    MSE  k 1 q                                                          scenario is shown in Table 1 where the greater the value
              k 1 k
                   y 2
                                                                          of ωmax and the smaller the value of ωmin used produce
where,                                                                    increasingly smaller MSE value. The best results obtained
  yk : target data value                                                  at ωmax = 0.9 and ωmin = 0.1 with an average MSE is
                                                                          0.002119.
   ŷk   : estimated data value                                              The second scenario conducted with c1 of 0.5, 1, 2
                                                                          and c2 of 0.5, 1, 2. Each experiment use ωmax = 0.9, and
                                                                          ωmin = 0.2, maximum iterations = 100, and the number
  Start
                                                                          of particles = 10. The testing results of this scenario are
  Input : ωmax, ωmin,c1,c2, iter_max and particle_num                     shown in
  initialize s, v, spbest, msepbest, cost, r1, r2,
       gbest, msegbest                                                       Table 2.
  create random value of s0
                                                                          By comparing the average MSE values at each testing
  v0=0, Gbest = initial_limit
  while (msegbest > 0.01) or (i<= iter_max)                               value, it was found that the average value of MSE
     For j=1 to particle_num                                              obtained at the value of c1 = 2, and c2 = 2. This table
           calculate MSE                                                  indicates that the best results obtained at balanced
           check pbest                                                    search of the local and global particles.
           create random value of r1, r2
           calculate ω, vi+1, si+1
           calculate gbest
                                                                            Table 2 Testing result for the combination of weight factors
     End for
  End while                                                                                               Average MSE at c2
  Ouput: new linguistic range                                                        c1           0,5             1             2
  End.                                                                               0,5       0,005842       0,005455      0,004045
                                                                                      1        0,005581       0,005077      0,003647
Figure 3 The process of developing membership function using                          2        0,003615       0,003132      0,002486
PSO
                                                                             In the third scenario is used the number of particles
3.0 RESULTS AND DISCUSSION
                                                                          between 10 to 200, ωmax = 0.9, ωmin = 0.1 , c1 = 2 , c2 =
                                                                          2, and the maximum iteration = 100. The result of this
The data used in this paper is a hepatitis patient data
                                                                          scenario is shown in Table 3. This table shows that the
from the UCI machine learning repository. Total records
                                                                          experiment with the number of particles 200 produces
are 80 without missing values. The data are divided into
                                                                          the smallest MSE that is 0.002645. The table also shows
118               Candra Dewi, Ratna Putri, Indriati / Jurnal Teknologi (Sciences & Engineering) 77:22 (2015) 115-119
that the decrease of MSE values on the number of                         Table 5 The limits value of each membership function
particles 100, 150, and 200 is not too significant.
                                                                            Parameter      Linguistic      a            b       c
       Table 3 Testing result for some particle number
                                                                             Bilirubin       Low         0,332     0,694     1,291
       Particle                       Particle                               Bilirubin     Normal        0,385     0,929     1,660
                       MSE                            MSE
       Number                         Number
         10          0,004565           100         0,002830                 Bilirubin       High        1,141     2,686     6,994
         20          0,004145           150         0,002697                   ALP           Low        34,313     61,734   64,288
         50          0,003756           200         0,002645
                                                                               ALP         Normal       45,569     95,807   157,626
                                                                               ALP           High       103,788   137,850   256,502
    In the fourth scenario uses the maximum iterations of
                                                                             Albumin         Low         1,249     2,566     3,768
100, 200, and 500, ωmax = 0.9, ωmin= 0.1, c1 = 2, c2 = 2
and the number of particles = 100. The result of this                        Albumin       Normal        3,133     3,599     5,015
scenario is shown in Table 4. This table shows that the                      Albumin         High        4,706     5,323     6,970
smallest value of average MSE obtained at the number
                                                                              SGOT           Low        10,542     12,521   21,222
of iteration 700. However, a decrease in the value of
MSE at iteration of 500, 600, and 700 is not too                              SGOT         Normal       12,465     28,638   51,101
significant. This does not mean that the less iteration will                  SGOT           High       36,211     55,588   358,174
give the worse result. The testing shows that the number
of iteration has a great impact on the shifting value of                     ProTime         Low        13,453     18,286   24,169
the inertia. The greater the value of the maximum                            ProTime       Normal       16,615     22,051   38,368
iteration, the shift value of inertia is also getting smaller.               ProTime         High       22,613     52,588   131,779
       Table 4 Testing result for some iteration number                        Age           Child       6,473     14,935   22,943
                                                                               Age        Adolescent    14,134     20,794   29,590
                      Iteration
                                         MSE                                   Age           Adult      17,317     35,090   54,372
                      Number
                         100           0,004771                                Age            Old       44,917     61,610   72,766
                         200           0,003590
                         500           0,003016
                         600           0,002916
                         700           0,002851                      4.0 CONCLUSION
                                                                     This paper implements PSO algorithm to obtain the
                                                                     optimal end point and peak point of triangular
    As shown at (3), the maximum number of iterations
associated with the particle velocity, in which the                  membership function automatically for hepatitis patient
greater the maximum iteration will result the smaller                data. The data is used for testing consist of 80 data
inertia. Thus, these results suggest that the greater                without missing values. These data is obtained from the
                                                                     UCI machine learning repository. Based on the
decline of inertia will result in a better MSE values and
                                                                     accuracy testing results that is measured using MSE, it
the resulting inertia value will go down faster. The
                                                                     can be concluded that the combination of PSO
amount of inertia will affect the speed of the particle.
                                                                     parameter that provide the best results are 0.9 and 0.1
The magnitude of velocity at the beginning of the
                                                                     for the maximum and minimum inertia, 2 for local and
search will also affect the final result, because at high
                                                                     global weights, 200 for the number of particles, and 700
speeds these particles can reach the global optimum
                                                                     for maximum iterations. This optimal value of the PSO
value freely. This is due to the condition that the search
                                                                     parameter can then be used to obtain the limits of the
process will be more focused on the local search area
                                                                     triangular membership function of the hepatitis disease
at the smaller speed. The magnitude of the particle
                                                                     data. The example of this limit value of each hepatitis
velocity that is move will be better if the particles move
                                                                     parameter can be seen in Table 5. However, it needs
closer to the optimal value. However, when the particle
                                                                     further testing to observe the most optimal number of
moves away from the optimal value, then the value of
                                                                     testing data due to the limitation of data in this paper.
the resulting MSE will also be greater.
                                                                     Furthermore, the use of the membership function of
    Furthermore, the most optimal PSO parameter value
                                                                     fuzzy inference system is needed to ensure whether it
is considered used in testing the limits of the
                                                                     will offer the better accuracy or not.
membership functions. The values of the parameters
used is 0.9, 0.1, 2, 2, 100, 500 respectively for maximum
inertia, minimum inertia, weighting factor c1 and c2, the
number of particles, and the maximum iteration. The                                      Acknowledgement
results of these tests are shown in Table 5. The values of
a, b and c indicate the end point and peak point of the               I would like to thank to Program of Information
membership function.                                                 Technology and Computer Science, Brawijaya
                                                                     University for the support to our research.
  119                     Candra Dewi, Ratna Putri, Indriati / Jurnal Teknologi (Sciences & Engineering) 77:22 (2015) 115-119
  References                                                                  [10] C.C. Yang, N.K. Bose. 2006. Generating fuzzy membership
                                                                                   function with self-organizing feature map. Pattern
                                                                                   Recognition Letters. 27 (2006): 356–365.
  [1]         B. Karlik. 2011. Hepatitis Disease Diagnosis Using
                                                                              [11] Byung-In Choi, F. Chung-Hoon Rhee. 2008. Interval type-2
              Backpropagation and the Naive Bayes Classifiers. Journal of
                                                                                   fuzzy membership function generation methods for pattern
              Science and Technology. 1 (1): 49-62.
                                                                                   recognition. Information Sciences. 179 (2009): 2102–2122.
  [2]         World     Health     Organization.    2002.    Hepatitis   C.
                                                                              [12] S. M. Bai, S. M. Chen. 2008. Automatically constructing grade
              http://www.who.int/csr/disease/hepatitis/Hepc.pdf.
                                                                                   membership functions of fuzzy rules for students’ evaluation.
              Accessed at 22 October 2013.
                                                                                   Expert Systems with Applications. 35 (2008): 1408–1414.
  [3]         N. Cutler. 2012. Getting Real About Hepatitis C Prognosis.
                                                                              [13] E.P. Kurniawan,. Hashim S.Z.M. 2010. Fuzzy Membership
              http://www.hepatitiscentral.com/mt/archives/2012/07/getti
                                                                                   Function Generation using particle Swarm Optimization.
              ng_real_ab.html. Accessed 23 October 2013.
                                                                                   International Journal Open Problems Computation Math. 3
  [4]         E. Dogantekin, Akif D., Derya A. 2009. Automatic Hepatitis
                                                                                   (1): 27-41..
              Diagnosis System Based on Linear Discriminant Analysis and
                                                                              [14] A. Almeida,P. Orduña, E.Castillejo, D.López-de-Ipiña, M.
              Adaptive Network Based on Fuzzy Inference System. Expert
                                                                                   Sacristán. 2013. A method for automatic generation of fuzzy
              Systems with Applications. 36 (2009): 11282–11286.
                                                                                   membership functions for mobile device’s characteristics
  [5]         M. Neshat, M. Sargolzaei, A. N. Toosi, A. Masoumi. 2012.
                                                                                   based on Google Trends. Computers in Human Behavior. 29
              Hepatitis Disease Diagnosis Using Hybrid Case Based
                                                                                   (2013): 510–517.
              Reasoning and Particle Swarm Optimization. International
                                                                              [15] Y. Fukuyama. 2007. Fundamentals of Particle Swarm
              Scholarly Research Network. 2012. Article ID 609718,
                                                                                   Optimization Techniques in Modern Heuristic Optimization
              doi:10.5402/2012/609718.
                                                                                   Techniques: Theory and Applications to Power Systems. John
  [6]         J. S Sartakhti, M. H. Zangooei, K. Mozafari. 2012. Hepatitis
                                                                                   Wiley & Sons, Inc, Hoboken, NJ, USA.
              Disease Diagnosis Using A Novel Hybrid Method Based On
                                                                              [16] V. Novak, I. Perfilieva, J. Mockor. 1999. Mathematical
              Support Vector Machine and Simulated Annealing (SVM-
                                                                                   Principle of Fuzzy Logic. Kluwer Academic Publishers, London.
              SSA). Computer Methods and Programs in Biomedicin. 2(2):
                                                                                   http://www.academia.edu/5038898/Mathematical_Principl
              570–579.
                                                                                   es_of_Fuzzy_Logic.
  [7]         Debabrata P. K. M. Mandana, Sarbajit P., Debranjan S.,
                                                                              [17] J. S. R. Jang, C.T. Sun, M. Eiji. 1997. Neuro-Fuzzy and Soft
              Chandan C. 2012. Fuzzy expert system approach for
                                                                                   Computing. Prentice Hall, New Jersey, USA.
              coronary artery disease screening using clinical parameters.
                                                                              [18] S. Kusumadewi, H. Purnomo. 2004. Aplikasi Logika Fuzzy Untuk
              Knowledge-Based Systems. 36 (2012): 162–174.
                                                                                   Pendukung Keputusan. Graha Ilmu, Yogyakarta.
  [8]         A. Keles, Ay. Keles, U. Yavuz. 2010. Expert System Based on
                                                                              [19] E. E. Omizegba, G.E. Adebayo. 2009. Optimizing Fuzzy
              Neuro-Fuzzy Rules for Diagnosis Breast Cancer. Expert Systems
                                                                                   Membership Functions Using Particle Swarm Algorithm.
              with Applications. 38 (2011): 5719–5726.
                                                                                   Proceedings of IEEE International Conference in Systems,
  [9]         U. Segundo, J.L. Cuadrado, L.A. Echevarria, T. A. Pérez, D.
                                                                                   Man, and Cybernetics, IEEE, San Antonio, TX, USA.
              Buenestado, A. Iruetaguena, R. Barrena, J.M. Pikatza. 2014.
                                                                              [20] B.Chen.          2013.      Fuzzy     Inference        System.
              Automatic Construction of Fuzzy Inference Systems for
                                                                                   http://www.bindichen.co.uk/           post/AI/fuzzy-inference-
              Computerized clinical Guidelines and Protocols. Applied Soft
                                                                                   system.html. Accessed 6 November 2013.
              Computing 26 (2015): 257–269.
View publication stats