What is defuzzification? Defuzzification is the process of converting a fuzzy set or fuzzy output of a fuzzy inference system into a crisp value . 09.07.2024 2 / 55 This is the final step in a fuzzy logic system, where the fuzzy results obtained from the inference engine are translated into a specific action or decision. Several defuzzification methods can be used, each with its strengths and applications.
Example 1 : Fuzzy to crisp As an example , let us consider a fuzzy set whose membership finction is shown in the following figure. ( x ) What is the crisp value of the fuzzy set in this case? 09.07.2024 3 / 55
Example 2 : Fuzzy to crisp Now, consider the following two rules in the fuzzy rule base. R1: If x is A then y is C R2: If x is B then y is D A pictorial representation of the above rule base is shown in the following figures. 1.0 1.0 x y What is the crisp value that can be inferred from the above rules given an input say x ′ ? A B C D x’ 09.07.2024 4 / 55
Why defuzzification? The fuzzy results generated can not be used in an application, where decision has to be taken only on crisp values. Example: If T HIGH then rotate R FIRST . Here, may be input T HIGH is fuzzy, but action rotate should be based on the crisp value of R FIRST . Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 5 / 55
Generic structure of a Fuzzy system Following figures shows a general fraework of a fuzzy system. Fuzzy rule base Fuzzifier Defuzzifier Crisp input Inference mechanism Crisp output Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 6 / 55
Defuzzification methods A number of defuzzification methods are known. Such as 1 2 Weighted average method 3 Maxima methods Centroid methods 09.07.2024 8 / 55
Output of a Fuzzy System Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 9 / 55
Output of a fuzzy System The output of a fuzzy system can be a single fuzzy set or union of two or more fuzzy sets. To understand the second concept, let us consider a fuzzy system with n - rules. R 1 : If x is A 1 then y is B 1 R 2 : If x is A 2 then y is B 2 ........................................ ........................................ R n : If x is A n then y is B n In this case, the output y for a given input x = x 1 is possibly B = B 1 ∪ B 2 ∪ ..... B n Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 10 / 55
Output fuzzy set : Illustration Suppose, two rules R 1 and R 2 are given as follows: 1 R 1 : If x is A 1 then y is C 1 R 2 : If x is A 2 then y is C 2 2 Here, the output fuzzy set C = C 1 ∪ C 2 . For instance, let us consider the following: 1.0 1.0 x 1 1 2 3 4 5 6 x x 2 x 3 1 2 3 4 5 6 7 8 y A C 1 C 2 B Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 11 / 55
Output fuzzy set : Illustration The fuzzy output for x = x 1 is shown below. 1.0 x 1.0 C 1 2 3 4 5 6 1 2 3 4 5 6 7 8 y x 1 Fuzzy output for x = x 1 A B Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 12 / 55
Output fuzzy set : Illustration The fuzzy output for x = x 2 is shown below. 1.0 x 1.0 C 1 2 3 4 5 6 1 2 3 4 5 6 7 8 y x = x 2 Fuzzy output for x = x 2 B A Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 13 / 55
Output fuzzy set : Illustration The fuzzy output for x = x 3 is shown below. 1.0 x 1.0 C 1 2 3 4 5 6 1 2 3 4 5 6 7 8 y x = x 3 Fuzzy output for x = x 3 B A Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 14 / 55
Defuzzification Methods Following defuzzification methods are known to calculate crisp output in the situations as discussed in the last few slides Maxima Methods 1 Height method First of maxima (FoM) Last of maxima (LoM) Mean of maxima(MoM) 2 3 4 Centroid methods 1 Center of gravity method (CoG) Center of area method (CoA) 2 Weighted average method Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 15 / 55
Maxima methods Following defuzzification methods are known to calculate crisp output. Maxima Methods 1 Height method First of maxima (FoM) Last of maxima (LoM) Mean of maxima(MoM) 2 3 4 Centroid methods 1 Center of gravity method (CoG) Center of sum method (CoS) Center of area method (CoA) 2 3 Weighted average method Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 17 / 55
Maxima method : Height method This method is based on Max- membership principle , and defined as follows. µ C ( x ∗ ) ≥ µ C ( x ) for all x ∈ X c Note: Here, x ∗ is the height of the output fuzzy set C . This method is applicable when height is unique. Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 18 / 55
Cenroid methods Following defuzzification methods are known to calculate crisp output. Maxima Methods 1 Height method First of maxima (FoM) Last of maxima (LoM) Mean of maxima(MoM) 2 3 4 Centroid methods 1 Center of gravity method ( CoG ) Center of area method (CoA) 2 Weighted average method Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 24 / 55
Centroid method : CoG 1 The basic principle in CoG method is to find the point x ∗ where a vertical line would slice the aggregate into two equal masses. Mathematically, the CoG can be expressed as follows : 2 ∗ x = , x .µ C ( x ) dx , µ C ( x ) dx 3 Graphically, c x Center of gravity x* Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 25 / 55
Centroid method : CoG Note: 1 x ∗ is the x- coordinate of center of gravity. 2 ∫ µ C ( x ) dx denotes the area of the region bounded by the curve µ C . 3 If µ C is defined with a discrete membership function, then CoG can be stated as : ∗ x = Σ n i = 1 x i .µ C ( x i ) Σ n i = 1 µ C ( x i ) ; 4 Here, x i is a sample element and n represents the number of samples in fuzzy set C . Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 26 / 55
CoG : A geometrical method of calculation Steps: 1 Divide the entire region into a number of small regular regions (e.g. triangles, trapizoid etc.) A 1 A 2 A 3 A 4 A 5 A 6 x 1 x 2 x 3 x 4 x 5 x 6 x 2 Let A i and x i denotes the area and c.g. of the i -th portion. Then x ∗ according to CoG is 3 ∗ x = Σ n i = 1 x i . ( A i ) Σ n A i = 1 i where n is the number of smaller geometrical compo n en ts . Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 27 / 55
CoG: An example of integral method of calculation 09.07.2024 28 / 55
CoG: An example of integral method of calculation 09.07.2024 29 / 55
CoG: An example of integral method of calculation 09.07.2024 30 / 55
Centroid method: Certer of largest area If the fuzzy set has two subregions, then the center of gravity of the subregion with the largest area can be used to calculate the defuzzified value. Mathematically , x = m ∗ , µ c ( x ) . x ′ dx , µ c m ( x ) dx ; Here, C m is the region with largest area, x ′ is the center of gravity of C m . Graphically, C 1 C 2 C 3 x ' C m C 3 Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 31 / 55
Centroid method: Certer of largest area 09.07.2024 32 / 55
Centroid method: Certer of largest area 09.07.2024 33 / 55
Centroid method: Certer of largest area 09.07.2024 34 / 55
Cenroid methods Following defuzzification methods are known to calculate crisp output. Maxima Methods 1 Height method First of maxima (FoM) Last of maxima (LoM) Mean of maxima(MoM) 2 3 4 Centroid methods 1 Center of gravity method (CoG) Center of area method (CoA) 2 Weighted average method Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 36 / 55
Weighted average method 1 This method is also alternatively called ”Sugeno defuzzification” method. The method can be used only for symmetrical output membership functions. The crisp value accroding to this method is 2 3 x ∗ = Σ i = 1 n i µ C ( x i ) . ( x i ) Σ n i = 1 i µ C ( x i ) where, C 1 , C 2 , ... C n are the output fuzzy sets and ( x i ) is the value where middle of the fuzzy set C i is observed. Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 37 / 55
Weighted average method C 1 2 C C 3 Graphically, 1 k 2 k k 3 x 1 x 2 x 3 Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 38 / 55
Weighted average method C 1 2 C C 3 Graphically, 1 k 2 k k 3 x 1 x 2 x 3 Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 39 / 55
Exercise 1 Find the crisp value of the following using all defuzzified methods. 1 2 3 4 5 6 0.5 1.0 C 1 C 2 Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 40 / 55
Exercise 1 Find the crisp value of the following using all defuzzified methods. 0.5 1.0 C 1 C 2 1 2 3 4 5 6 7 8 9 10 0.75 C 3 Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 41 / 55
Exercise 3 The membership function defining a student as Average, Good, and Excellent denoted by respective membership functions are as shown below. 6.0 6.5 7 7.5 8.0 8.5 9.0 10.0 Avg Good Excellent 0.5 1.0 Find the crisp value of ”Good Student” Hint: Use CoG method to the portion ”Good” to calculate it. Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 42 / 55
Exercise 4 5 6 7 8 9 10 1.0 narrow wide 0.5 0.4 The width of a road as narrow and wide is defined by two fuzzy sets, whose membership functions are plotted as shown above. If a road with its degree of membership value is 0.4 then what will be its width (in crisp) measure. Hint: Use CoG method for the shadded region. Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 53 / 55
Exercise 5 The faulty measure of a circuit is defined fuzzily by three fuzzy sets namely Faulty(F), Fault tolerant (FT) and Robust(R) defined by three membership functions with number of faults occur as universe of discourses and is shown below. ( x ) ( x ) ( x ) 0.5 1.0 0.75 0.25 0.3 1 2 3 4 5 6 7 8 9 10 x 0.5 1.0 0.75 0.25 0.5 0.5 1.0 0.75 0.25 1.0 1 2 3 4 5 6 7 8 9 10 x 1 2 3 4 5 6 7 8 9 10 x Robust Fault tolerant Faulty Reliability is measured as R ∗ = F ∪ FT ∪ R . With a certain observation in testing ( x , . 3 ) ∈ R , ( x , . 5 ) ∈ FT , ( x , . 8 ) ∈ F . Calculate the reliability measure in crisp value. Calculate with 1) CoS 2) CoG . Debasis Samanta (IIT Kharagpur) Soft Computing Applications 09.07.2024 44 / 55