1 / 40

CS464: Soft Computing Lecture 9: Fuzzy Logic Introduction

CS464: Soft Computing Lecture 9: Fuzzy Logic Introduction. Dr. Mohammad Nassef Department of Computer Science Faculty of Computers and Information Cairo University Egypt. Outline. Fuzzy Logic What is Fuzzy Logic? History Fuzzy Sets Examples. WHAT IS FUZZY LOGIC?.

shu
Télécharger la présentation

CS464: Soft Computing Lecture 9: Fuzzy Logic Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS464: Soft ComputingLecture 9: Fuzzy LogicIntroduction Dr. Mohammad Nassef Department of Computer Science Faculty of Computers and Information Cairo University Egypt CS-FCI-CU-EG

  2. Outline • Fuzzy Logic • What is Fuzzy Logic? • History • Fuzzy Sets • Examples FCI-CU-EG

  3. WHAT IS FUZZY LOGIC? • Definition of fuzzy • Fuzzy – “not clear, distinct, or precise; blurred” • Definition of Fuzzy Logic • A form of knowledge representation suitable for notions that cannot be defined precisely, but which depend upon their contexts.

  4. WHAT IS FUZZY LOGIC? • Fuzzy logic: • A way to represent variation or imprecision in logic • A way to make use of natural language in logic • Approximate reasoning • Humans say things like "If it is sunny and warm today, I will drive fast" • Linguistic variables: • Temp: {freezing, cool, warm, hot, very hot} • Cloud Cover: {overcast, partly cloudy, sunny} • Speed: {very slow, slow, fast, very fast} Fuzzy Logic

  5. TRADITIONAL REPRESENTATION OF LOGIC Slow Fast Speed = 0 Speed = 1 bool speed; // get the speed if ( speed == 0) { // speed is slow } else { // speed is fast }

  6. FUZZY LOGIC REPRESENTATION • Some problems must be represented in terms of fuzzy sets. • What are Fuzzy Sets? Slowest [ 0.0 – 0.25 ] Slow [ 0.25 – 0.50 ] Fast [ 0.50 – 0.75 ] Fastest [ 0.75 – 1.00 ]

  7. FUZZY LOGIC REPRESENTATION Slowest Slow Fast Fastest float speed; // get the speed if ((speed >= 0.0)&&(speed < 0.25)) { // speed is slowest } else if ((speed >= 0.25)&&(speed < 0.5)) { // speed is slow } else if ((speed >= 0.5)&&(speed < 0.75)) { // speed is fast } else // speed >= 0.75 && speed < 1.0 { // speed is fastest }

  8. ORIGINS OF FUZZY LOGIC • Traces back to Ancient Greece • Lotfi Asker Zadeh ( 1965 ) • First to publish ideas of fuzzy logic. • Professor ToshireTerano ( 1972 ) • Organized the world's first working group on fuzzy systems. • F.L. Smidth & Co. ( 1980 ) • First to market fuzzy expert systems.

  9. ORIGINS OF FUZZY LOGIC • Professor Lotfi Zadeh, UC Berkeley, 1965 “People do not require precise numerical information input, and yet they are capable of highly adaptive control.” • Accepts noisy, imprecise input! • Fuzzy logic can be defined as a superset of conventional (Boolean) logic that has been extended to handle the concept of partial truth - truth values between “completely true” and “completely false”

  10. ORIGINS OF FUZZY LOGIC 1965 Seminal Paper “Fuzzy Logic” by Prof. Lotfi Zadeh, Faculty in Electrical Engineering, U.C. Berkeley, Sets the Foundation of the “Fuzzy Set Theory” 1970 First Application of Fuzzy Logic in Control Engineering (Europe) 1975 Introduction of Fuzzy Logic in Japan 1980 Empirical Verification of Fuzzy Logic in Europe 1985 Broad Application of Fuzzy Logic in Japan 1990 Broad Application of Fuzzy Logic in Europe 1995 Broad Application of Fuzzy Logic in the U.S. 2000 Fuzzy Logic Becomes a Standard Technology and Is Also Applied in Data and Sensor Signal Analysis. Application of Fuzzy Logic in Business and Finance. Today, Fuzzy Logic Has Already Become the Standard Technique for Multi-Variable Control !

  11. Another Example • A class of students(e.g. SWE Students learning“Fuzzy Logic”) • The universe of discourse: X • “Who does have a driving licence?” • A subset of X = a (Crisp) Set • (X) = CHARACTERISTIC FUNCTION 1 0 1 1 0 1 1 • “Who can drive very well?” (X) = MEMBERSHIP FUNCTION 0.7 0 1.0 0.8 0 0.4 0.2 FUZZY SET

  12. Crisp (Traditional) Variables • Crisp variables represent precise quantities: • x = 3.1415296 • A {0,1} • A proposition is either True or False • A  B  C • King(Richard) Greedy(Richard)  Evil(Richard) • Richard is either greedy or he isn't: • Greedy(Richard) {0,1} Fuzzy Logic

  13. Fuzzy Sets • What if Richard is only somewhat greedy? • Fuzzy Sets can represent the degree to which a quality/degree is possessed. • Fuzzy Sets (Simple Fuzzy Variables) have values in the range of [0…1] • Greedy(Richard) = 0.7 • Question: How evil is Richard? Fuzzy Logic

  14. Fuzzy Linguistic Variables • Fuzzy Linguistic Variables are used to represent qualities spanning a particular spectrum • Temp: {Freezing, Cool, Warm, Hot} • Membership Function • Question: What is the temperature? • Answer: It is warm. • Question: How warm is it? Fuzzy Logic

  15. Membership Functions • Temp: {Freezing, Cool, Warm, Hot} • Degree of Truth or "Membership" Fuzzy Logic

  16. Membership Functions • How cool is 36 F° ? Fuzzy Logic

  17. Membership Functions • How cool is 36 F° ? • It is 30% Cool and 70% Freezing 0.7 0.3 Fuzzy Logic

  18. Fuzzy Logic • How do we use fuzzy membership functions in predicate logic? • Fuzzy logic Connectives: • Fuzzy Conjunction,  • Fuzzy Disjunction,  • Operate on degrees of membership in fuzzy sets Fuzzy Logic

  19. Fuzzy Disjunction • AB max(A, B) • AB = C "Quality C is the disjunction of Quality A and B" • (AB = C)  (C = 0.75) Fuzzy Logic

  20. Fuzzy Conjunction • AB min(A, B) • AB = C "Quality C is the conjunction of Quality A and B" • (AB = C)  (C = 0.375) Fuzzy Logic

  21. Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 Fuzzy Logic

  22. Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 • Determine degrees of membership: Fuzzy Logic

  23. Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0.7 • Determine degrees of membership: • A = 0.7 Fuzzy Logic

  24. Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0.9 0.7 • Determine degrees of membership: • A = 0.7 B = 0.9 Fuzzy Logic

  25. Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0.9 0.7 • Determine degrees of membership: • A = 0.7 B = 0.9 • Apply Fuzzy AND • AB = min(A, B) = 0.7 Fuzzy Logic

  26. Fuzzy Control • Fuzzy Control combines the use of fuzzy linguistic variables with fuzzy logic • Example: Speed Control • How fast am I going to drive today? • It depends on the weather. • Disjunction of Conjunctions Fuzzy Logic

  27. What can we do now? • What should be done is summarized into three main stages • Fuzzification • Membership functions used to graphically describe a situation • Evaluation of Rules (Inference) • Application of the fuzzy logic rules • De-fuzzification • Obtaining the crisp results

  28. Inputs: Temperature • Temp: {Freezing, Cool, Warm, Hot} Fuzzy Logic

  29. Inputs: Temperature, Cloud Cover • Temp: {Freezing, Cool, Warm, Hot} • Cover: {Sunny, Partly, Overcast} Fuzzy Logic

  30. Output: Speed • Speed: {Slow, Fast} Fuzzy Logic

  31. Rules • If it's Sunny and Warm, drive Fast Sunny(Cover)Warm(Temp) Fast(Speed) • If it's Cloudy and Cool, drive Slow Cloudy(Cover)Cool(Temp) Slow(Speed) • Driving Speed is the combination of output of these rules... Fuzzy Logic

  32. Step by Step Approach

  33. Example: Speed Calculation • How fast will I go if it is • 65 F° • 25 % Cloud Cover ? Fuzzy Logic

  34. Fuzzification:Calculate Input Membership Levels • 65 F° Cool = 0.4, Warm= 0.7 Fuzzy Logic

  35. Fuzzification:Calculate Input Membership Levels • 65 F° Cool = 0.4, Warm= 0.7 • 25% Cover Sunny = 0.8, Cloudy = 0.2 Fuzzy Logic

  36. ...Calculating... • If it's Sunny and Warm, drive Fast Sunny(Cover)Warm(Temp)Fast(Speed) 0.8  0.7 = 0.7 Fast = 0.7 • If it's Cloudy and Cool, drive Slow Cloudy(Cover)Cool(Temp)Slow(Speed) 0.2  0.4 = 0.2 Slow = 0.2 Fuzzy Logic

  37. Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Find centroids: Location where membership is 100% Fuzzy Logic

  38. Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Find centroids: Location where membership is 100% Fuzzy Logic

  39. Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Speed = weighted mean = (0.2*25+... Fuzzy Logic

  40. Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Speed = weighted mean = (0.2*25+0.7*75)/(0.2+0.7) = 63.8 mph Fuzzy Logic

More Related