Fuzzy Expert Systems Lecture 8 (Fuzzy Systems) Soft Computing is an emerging approach to computing which parallels the remarkable ability of the human mind to reason and learn in an environment of uncertainty and imprecision (Lotfi A. Zadeh, 1992) Lecture 08 صفحه 1
The Whole Fuzzy System Fuzzy Reasoning Fuzzifier موتور استنتاج فازی Fuzzy Inference Engine Defuzzifier Fuzzy Rule Base غير فازی ساز فازی ساز Lecture 08 صفحه 2
Fuzzifier and Defuzzifier In general, both the Inputs and outputs of a Fuzzy Inference Engine are Fuzzy Variables µ A (x) and µ B (y) However, in the real world, it is usually desired to have a system with crisp inputs and outputs. So the Fuzzifier and Defuzzifier blocks are needed to accept crisp inputs and produce crisp outputs. Lecture 08 صفحه 3
Fuzzifier The fuzzifier is actually a mapping. It maps a real-valued crisp point x * U to a fuzzy set A A in U. So it can be defined with a fuzzy membership function µ A (x) as a function of x * µ A (x)=f(x*) x*) x* Fuzzifier Lecture 08 صفحه 4
The output of the fuzzifier is not a membership value, it is a membership function µ A (x) x 1 x* The Fuzzifier µ A (x 1 ) Lecture 08 صفحه 5
Fuzzifier produces membership functions which can be regarded as fuzzy inputs to fuzzy inference engine. x* x X Fuzzifier µ A (x) µ A (x) A B A w X Y Lecture 08 صفحه 6
How to design a Fuzzifier? 1. Since the fuzzy variable µ A (x) is used as the input instead of x*, intuitively, it should be selected such that the t actual crisp value x* has a large membership value in A A. 2. If the input to a fuzzy system is corrupted by noise, it is desirable that the fuzzifier should help to suppress the noise. 3. Practically, It is better to select the fuzzifier such that it simplifies the computations (particularly computation of Sup x U ) Lecture 08 صفحه 7
Fuzzifier Examples Singleton Fuzzifier: (most commonly used) The singleton fuzzifier is defined as: µ A' ( x) = * 1 if x = x 0 otherwise x = ( x, x2,..., x 1 n ) Lecture 08 صفحه 8
Singleton Fuzzifier x* X µ A (x) Singleton Fuzzifier x* X Sup x U It greatly simplifies the computation of Sup (Actually it omits the Sup x U and reduces it to x=x * ) Lecture 08 صفحه 9
Gaussian Fuzzifier: µ x * * x1 x1 2 xn xn 2 ( ) ( ) ( x = e a1 L e an ) A' = x, x,..., xn) and is any t ( 1 2 x* X norm Gaussian and Triangular Fuzzifiers suppress the noise µ A (x) Gaussian Fuzzifier x* X Lecture 08 صفحه 10
Triangular Fuzzifier: µ A ' ( x ) = (1 0 b i > x 1 0 b 1 x * 1 ) L (1 x n x b n otherwise * n ) x* X µ A (x) Trinagular Fuzzifier X Lecture 08 صفحه 11
Defuzzifier (Defuzzification Method) Conceptually, the task of the defuzzifier is to specify a crisp point in output space V that best represents the fuzzy set C µ c (x) Crisp Variable X * Defuzzifier Fuzzy Variable C X x* Lecture 08 صفحه 12
Important criteria in choosing a defuzzification method Plausibility: the crisp point y * should represent C C from an intuitive point of view Computational Simplicity: In real time applications such as fuzzy controllers, it is important to achieve less computational time. Continuity: A small change in C C should not result in a large change in y * Lecture 08 صفحه 13
Defuzzification Methods Centroid of Area: (Center of Gravity) z COG = Z Z µ C ' µ C ' ( z) zdz ( z) dz where µ C' ( z) is aggregated output MF Advantage: Intuitive Plausibility Disadvantage: Computationally intensive Lecture 08 صفحه 14
Bisector of Area: z α α = BOA µ A ( min{ z z ) dz µ ( z) z = β Z} z BOA A dz where, β = max{ z z Z} BOA Lecture 08 صفحه 15
Mean of Maximum: Average of the maximizing zdz z at which the MF reach a z = Z MOM maximum, µ * where dz Z z' = { z µ ( z) =µ } A * MOM Lecture 08 صفحه 16
Smallest of Maximum: z SOM is the minimum (in terms of magnitude) of the maximizing z Largest of Maximum: z LOM is the maximum of the maximizing z SOM LOM Lecture 08 صفحه 17
Center Average Center Average is the weighted average of the centers of the M fuzzy sets, with the weights equal the heights of the corresponding l fuzzy sets. Let y be the center of the l th fuzzy set and w l be its height, then : w l z CA M l = 1 = M l = 1 y l w w l l l y Lecture 08 صفحه 18
Example of the Center Average (CA) w 1 y * = w 1 w + 2 w 2 w 2 y 1 = 0 y 2 =1 The Center average method is most commonly used defuzzifier in fuzzy systems and fuzzy control. It is computationally simple and intuitively plausible. also small changes in l y and w l result in small change in y * Lecture 08 صفحه 19
Various Defuzzification Schemes 1 0.8 centroid 0.6 bisector 0.4 mom 0.2 lom so m 0-10 -8-6 -4-2 0 2 4 6 8 10 1 0.8 centroid 0.6 bisector 0.4 mom 0.2 so m lo m 0-10 -8-6 -4-2 0 2 4 6 8 10 Lecture 08 صفحه 20
Fuzzy Systems Types Mamdani Fuzzy Systems (most commonly used in many of applications) (TSK) (Most often used in applications in which it is needed to develop a systematic approach in creating and analyzing the fuzzy system). Most popular candidate for sample- data-based fuzzy modeling Sugeno Fuzzy Systems (TSK) Tsukamoto Fuzzy Systems (Rarely used) Lecture 08 صفحه 21
1. Mamdani Fuzzy Systems Mamdani Fuzzy Systems are fuzzy systems having fuzzy if then rules in the familiar form of : if x is A and y is B and THEN y is C where A, B,.. And C are fuzzy sets This type of fuzzy systems are used in applications where the fuzzy rules are direct consequence of the human expert advice expressed in the form of fuzzy rules. The output of a MAMDANI fuzzy system is a fuzzy variable Lecture 08 صفحه 22
2. Sugeno Fuzzy Systems TSK (Takagi Sugeno) TSK fuzzy systems are fuzzy systems having if then rules in the following form: If x is A and y is B THEN z = f (x,y( x,y) where A and B are fuzzy set in the antecedent, while z=f (x,y)) is a crisp function in the consequent Lecture 08 صفحه 23
Usually, z=f(x,y f(x,y) is a polynomial in x and y. the order of this polynomial is defined as the order of TSK model. So in zero-order order TSK models, z is a constant. Sugeno Type 1 If X is small and Y is small, then z = - x + y + 1 Sugeno Type 0 If X is small and Y is small, then z = 5 Center Average defuzzifier is used in Sugeno fuzzy systems Lecture 08 صفحه 24
An Example of a TSK system Example of Two-input single-output TSK system If X is small and Y is small, then z = - x + y + 1 If X is small and Y is large, then z = - y + 3 If X is large and Y is small, then z = - x 3 If X is large and Y is large then z = x + y + 2 1 Small Large Membership Grades 0.8 0.6 0.4 0.2 0-5 -4-3 -2-1 0 1 2 3 4 5 X 1 Small Large Membership Grades 0.8 0.6 0.4 0.2 0-5 -4-3 -2-1 0 1 2 3 4 5 Y Lecture 08 صفحه 25
Graphical Demonstration of a type-1 Sugeno Fuzzy Systems A1 B1 z1 = w1 p1x+q1y+r1 X Y A2 B2 z2 = w2 p2x+q2y+r2 x=3 X y=2 Y Min or Product z = w1z1+w2z2 w1+w2 Lecture 08 صفحه 26
3. Tsukamoto Fuzzy Systems In this case, the consequent part of each fuzzy if-then rule is represented by a fuzzy set with a monotonical MF. The inferred output of each rule is defined as a crisp value induced by the rule firing strength. The overal output is taken as the weighted average of each rule s s output. Tsukamoto fuzzy model aggregates each rule s output by the method of weighting average. Lecture 08 صفحه 27
Graphical Demonstration of a Tsukamoto Fuzzy Systems The Tsukamoto fuzzy model Lecture 08 صفحه 28
Control Surface The relationship between each pair of the input variables and each of the output variables is usually called surface or control surface of the fuzzy system. Lecture 08 صفحه 29
Building a fuzzy system Two types of knowledge are needed to develop a fuzzy system 1 Domain Knowledge: : the knowledge about the fuzzy if-then rules, membership functions, 2 Meta Knowledge: : the knowledge about how to treat with domain knowledge including the type of t-norm, t s-norm, s implication and inference engine, method of defuzzification, Lecture 08 صفحه 30
The source of domain knowledge Developing Methods of Fuzzy Systems Fuzzy System 1 Human Expert Opinion Knowledge Base 3 (x (x i,y i,y i ) i ) i=1,.n 2 Learning from Examples Automatic Optimization Algorithm Lecture 08 صفحه 31
1. Consulting Human Expert and incorporating expert knowledge into fuzzy system Knowledge Base Historically, the first method in developing a fuzzy system was human knowledge represented in the common form of fuzzy if then rules. However, disadvantage of this method is the lake of a systematic method for designing a fuzzy system using human knowledge Lecture 08 صفحه 32
2. Modeling by Observation (Learning from Examples) x x : 1 2 x m (i) i=1,2,..,n Unknown System y y : 1 2 y n (i) Fuzzy System Lecture 08 صفحه 33
Modeling or learning by observation means to build a fuzzy system using a set of input-output data pairs relating to an unknown system which should be modeled. The resulting fuzzy system can be used as fuzzy model of the main system and thus is expected to have the same input/output mapping. There are many methods for learning from examples such as Table Look-Up scheme, Fuzzy Clustering, ANFIS,... These methods are different in degree of accuracy, computational complexity and noise cancellation ability. Lecture 08 صفحه 34
3. Automatic optimization methods Designing a fuzzy system is actually a search and optimization problem in which the objective is to search and find the most appropriate knowledge including fuzzy membership functions and fuzzy rules. This can be done using many of the evolutionary optimization methods such as Genetic Algorithms and Genetic Programming. A design criteria and a fitness function are used and the optimization problem looks for the best solution (fuzzy system) which maximize the fitness function. Lecture 08 صفحه 35
Domains of applications for fuzzy systems: Modeling, Learning. Control (Feedback control of dynamical systems) Control System Identification, Prediction. (Speech recognition, Signal and image processing) Pattern recognition, Classification (Speech Expert Systems, Decision Making. etc, Lecture 08 صفحه 36
References 1. A course in fuzzy systems and control, L-X. Wang, 2. A. H. Meghdadi, Probabilistic Fuzzy Systems and Modeling Human Control Strategy, MSEE Thesis, Ferdowsi University of Mashhad, Jan2001. 3. Slides for fuzzy sets, J.-s. Roger Jang http://www.cs.nthu.edu.tw/~jang 4. 5. John Kim, Intelligent systems course, http://rit.kaist.ac.kr/johkim/lectureee481_2002/ note/chap4_2.ppt 5. J-S. J Roger Jang, C-T C T Sun, E. Mizutani, Neoro-Fuzzy and Soft Computing,, Prentice Hall, 1997. 6. Fuzzy Logic ToolBox for MATLAB, MATWORKS Inc. Lecture 08 صفحه 37