งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

Fuzzy Logic Adapted from: Wei Zhang CSE Dept. Lehigh University.

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "Fuzzy Logic Adapted from: Wei Zhang CSE Dept. Lehigh University."— ใบสำเนางานนำเสนอ:

1 Fuzzy Logic Adapted from: Wei Zhang CSE Dept. Lehigh University

2 Content Crisp Logic Fuzzy Logic Fuzzy Logic Application Conclusion

3 Crisp Logic Crisp Logic คือ ตรรกศาสตร์พื้นฐานที่เราคุ้นเคย คือ มีค่าความจริงเป็น จริง [1] กับ เท็จ [0] เท่านั้น Rule Example: If temperature > 80 F, it is hot; otherwise, it is not hot Case: Temperature 100 F Temperature 50 F Temperature 80.1 F Temperature 79.9 F Hot Not hot Hot Not hot

4 Crisp Logic ในโลกของความเป็นจริง จะมีค่าความจริง ที่อยู่ระหว่าง จริง [1] กับ เท็จ [0] ( อยู่ ระหว่าง 0 กับ 1) อย่างไรก็ตาม crisp logic จะมีฟังก์ชัน สมาชิก (Membership Function:  ) คือ [0,1] เท่านั้น

5 Crisp set vs. Fuzzy set A traditional crisp setA fuzzy set

6 Crisp set vs. Fuzzy set

7 Membership function of crisp logic 80FTemperature HOT 1 If temperature >= 80F, it is hot (1 or true); 0 True False If temperature < 80F, it is not hot (0 or false).

8 Conception of Fuzzy Logic Many decision-making and problem-solving tasks are too complex to be defined precisely however, people succeed by using imprecise knowledge Fuzzy logic resembles human reasoning in its use of approximate information and uncertainty to generate decisions.

9 Natural Language Consider: Joe is tall -- what is tall? Joe is very tall -- what does this differ from tall? Natural language (like most other activities in life and indeed the universe) is not easily translated into the absolute terms of 0 and 1. “ false ” “ true ”

10 Fuzzy Logic เป็นวิธีการที่เกี่ยวกับความไม่แน่นอน ประกอบไปด้วยค่า ความจริงที่อยู่ระหว่าง [0…1] และมีการกระทำทางตรรกะ Fuzzy logic มีพื้นฐานอยู่บนแนวคิดของทฤษฎี Fuzzy set และฟังก์ชันสมาชิกของ Fuzzy set ซึ่งเรามักพบ บ่อยๆ ในภาษาพูด เช่น อากาศร้อน อากาศค่อนข้างร้อน อากาศหนาว โดยที่ข้อมูลข้างต้นเป็นข้อมูลที่เกี่ยวกับอุณหภูมิของ อากาศ แต่จะแสดงระดับที่แตกต่างกัน

11 Example Linguistic Variable Age (years) Young น้อยกว่า 25 Middle ระหว่าง 25 ถึง 55 Old มากกว่า 55

12 Membership function of fuzzy logic Young (x) = { 1, if age(x) <= 25 ( 40-age(x))/(40-25) if age between 25 and 40 (25 < age < 40) 0, if age(x) >= 40 Young (x) = { 1, if age(x) <= 25 ( 40-age(x))/15 if age between 25 and 40 (25 < age < 40) 0, if age(x) >= 40

13 Membership function of fuzzy logic Age 2540 Young DOM Degree of Membership Fuzzy values Fuzzy values have associated degrees of membership in the set. 0

14 Membership function of fuzzy logic Middle (x) = { 0, if age(x) = 55 ( age(x)-25)/(40-25) if age between 25 and 40 (25 < age < 40) 55-age(x)/(55-40) if age between 40 and 55 (40 <= age < 55) Middle (x) = 0, if age(x) = 55 ( age(x)-25)/(15) if age between 25 and 40 (25 < age < 40) 55-age(x)/(15) if age between 40 and 55 (40 <= age < 55) {

15 Membership function of fuzzy logic Age Middle 0.5 DOM Degree of Membership Fuzzy values Fuzzy values have associated degrees of membership in the set. 0

16 Membership function of fuzzy logic Old (x) = { 0, if age(x) <= 40 ( age(x)-40)/(55-40) if age between 40 and 55 (40 < age < 55) 1, if age >= 55 Old (x) = 0, if age(x) <= 40 ( age(x)-40)/(15) if age between 40 and 55 (40 < age < 55) 1, if age >= 55 {

17 Membership function of fuzzy logic Age Old DOM Degree of Membership Fuzzy values Fuzzy values have associated degrees of membership in the set. 0

18 Example: “Young” Example: Ann is 28, Bob is 35, Charlie is 23, Young (x) = { 1, if age(x) <= 25 ( 40-age(x))/15 if age between 25 and 40 (25 < age < 40) 0, if age(x) >= 40

19 Membership function of fuzzy logic Age YoungOld 1 Middle 0.5 DOM Degree of Membership Fuzzy values Fuzzy values have associated degrees of membership in the set. 0

20 Membership function of fuzzy logic Age YoungOld 1 Middle 0.5 DOM Degree of Membership Fuzzy values Fuzzy values have associated degrees of membership in the set. 0 23

21 Membership function of fuzzy logic Age YoungOld 1 Middle 0.5 DOM Degree of Membership Fuzzy values Fuzzy values have associated degrees of membership in the set. 0 28

22 Membership function of fuzzy logic Age YoungOld 1 Middle 0.5 DOM Degree of Membership Fuzzy values Fuzzy values have associated degrees of membership in the set. 0 35

23 Membership function of fuzzy logic Age YoungOld 1 Middle 0.5 DOM Degree of Membership Fuzzy values Fuzzy values have associated degrees of membership in the set. 0 50

24 Membership function of fuzzy logic Age YoungOld 1 Middle 0.5 DOM Degree of Membership Fuzzy values Fuzzy values have associated degrees of membership in the set

25 Example: “Young” Example:YoungMiddleOld Ann is 28, Bob is 35, Charlie is 23, George is 50, YYN YYN YNN NYY

26 Example: “Young” Example: Ann is 28, 0.8 in set “Young” Bob is 35, 0.33 in set “Young” Charlie is 23, 1.0 in set “Young”

27 Example: “Young” Example:Young  Young Ann is 28, Bob is 35, Charlie is 23, George is 50, จะเห็นได้ว่าผลลัพธ์ที่ได้จะไม่เหมือนกับสถิติ เนื่องจากค่าระดับของฟังก์ชันสมาชิกไม่ได้บอกถึง ความน่าจะเป็นของสิ่งที่เราสนใจ แต่เป็นการขยาย ความเพื่ออธิบายให้เราเห็นภาพได้ชัดเจนมากขึ้น Y0.80 Y0.33 Y1.00 N0.00

28 ตัวอย่าง : จงเขียน Membership function จากรูปที่กำหนดให้

29 ข้อดีของ fuzzy logic เราสามารถแสดงการเปลี่ยนแปลงของอายุ ในระดับต่างๆ ตั้งแต่ วัยหนุ่ม (Young) วัย กลางคน (Middle) และวัยชรา (Old) ได้ อย่างมีเหตุผล ถือว่าเป็นแนวคิดของ fuzzy logic

30 Fuzzy Set Operations Fuzzy union (  ): the union of two fuzzy sets is the maximum (MAX) of each element from two sets. E.g. A = {1.0, 0.20, 0.75} B = {0.2, 0.45, 0.50} A  B = {MAX(1.0, 0.2), MAX(0.20, 0.45), MAX(0.75, 0.50)} = {1.0, 0.45, 0.75}

31 Fuzzy Set Operations Fuzzy intersection (  ): the intersection of two fuzzy sets is just the MIN of each element from the two sets. E.g. A = {1.0, 0.20, 0.75} B = {0.2, 0.45, 0.50} A  B = {MIN(1.0, 0.2), MIN(0.20, 0.45), MIN(0.75, 0.50)} = {0.2, 0.20, 0.50}

32 Fuzzy Set Operations The complement of a fuzzy variable with DOM x is (1-x). Complement ( _ c ): The complement of a fuzzy set is composed of all elements’ complement. Example. A = {1.0, 0.20, 0.75} A c = {1 – 1.0, 1 – 0.20, 1 – 0.75} = {0.0, 0.80, 0.25}

33 Fuzzy Relations Triples showing connection between two sets: (a,b,#): a is related to b with degree # Fuzzy relations are set themselves Fuzzy relations can be expressed as matrices …

34 Fuzzy Relations Matrices Example: สีผิวของมะเขือ กับ การสุกของผล R 1 (x, y) ดิบปานกลางสุก เขียว เหลือง แดง 00.21

35 Where is Fuzzy Logic used? Fuzzy logic is used directly in very few applications. Most applications of fuzzy logic use it as the underlying logic system for decision support systems.

36 Fuzzy Expert System Fuzzy expert system is a collection of membership functions and rules that are used to reason about data. Usually, the rules in a fuzzy expert system are have the following form: “if x is low and y is high then z is medium”

37 Operation of Fuzzy System Crisp Input Fuzzy Input Fuzzy Output Crisp Output Fuzzification Rule Evaluation Defuzzification Input Membership Functions Rules / Inferences Output Membership Functions

38 Fuzzification Two Inputs (x, y) and one output (z) Membership functions: low(t) = 1 - ( t / 10 ) high(t) = t / 10 LowHigh 1 0 t X=0.32Y= Low(x) = 0.68, High(x) = 0.32,Low(y) = 0.39, High(y) = 0.61 Crisp Inputs

39 Create rule base Rule 1: If x is low AND y is low Then z is high Rule 2: If x is low AND y is high Then z is low Rule 3: If x is high AND y is low Then z is low Rule 4: If x is high AND y is high Then z is high

40 Inference Rule1: low(x)=0.68, low(y)=0.39 => high(z)=MIN(0.68,0.39)=0.39 Rule2: low(x)=0.68, high(y)=0.61 => low(z)=MIN(0.68,0.61)=0.61 Rule3: high(x)=0.32, low(y)=0.39 => low(z)=MIN(0.32,0.39)=0.32 Rule4: high(x)=0.32, high(y)=0.61 => high(z)=MIN(0.32,0.61)=0.32 Rule strength

41 Composition ( รวมผลลัพธ์ที่ได้ จากการ Inference) LowHigh 1 0 t low(z) = MAX(rule2, rule3) = MAX(0.61, 0.32) = 0.61 high(z) = MAX(rule1, rule4) = MAX(0.39, 0.32) =

42 Defuzzification Center of Gravity LowHigh t Crisp output Center of Gravity

43 Defuzzification Techniques Fuzzy logic is a rule-based system written in the form of horn clauses (i.e., if-then rules). These rules are stored in the knowledge base of the system.

44 Defuzzification Techniques The input to the fuzzy system is a scalar value that is fuzzified. The set of rules is applied to the fuzzified input.

45 Defuzzification Techniques The output of each rule is fuzzy. These fuzzy outputs need to be converted into a scalar output quantity so that the nature of the action to be performed can be determined by the system.

46 Defuzzification Techniques The process of converting the fuzzy output is called defuzzification. Before an output is defuzzified all the fuzzy outputs of the system are aggregated with an union operator. The union is the max of the set of given membership functions

47 Defuzzification Techniques Maximum Defuzzification Technique Centroid Defuzzification Technique Weighted Average Defuzzification Technique

48 Maximum Defuzzification Technique This method gives the output with the highest membership function. This defuzzification technique is very fast but is only accurate for peaked output. This technique is given by algebraic expression as for all x  X

49 Maximum Defuzzification Technique where x* is the defuzzified value.

50 Centroid Defuzzification Technique This method is also known as Center Of Gravity (COG) or Center Of Area (COA) defuzzification. This technique was developed by Sugeno in This is the most commonly used technique and is very accurate. The centroid defuzzification technique can be expressed as

51 Centroid Defuzzification Technique where x* is the defuzzified output,  i (x) is the aggregated membership function and x is the output variable. The only disadvantage of this method is that it is computationally difficult for complex membership functions

52 Weighted Average Defuzzification Technique In this method the output is obtained by the weighted average of the each output of the set of rules stored in the knowledge base of the system. The weighted average defuzzification technique can be expressed as

53 Weighted Average Defuzzification Technique where x* is the defuzzified output, m i is the membership of the output of each rule, and w i is the weight associated with each rule. This method is computationally faster and easier and gives fairly accurate result

54 Defuzzification Center of Gravity LowHigh t Crisp output Center of Gravity

55 DEMO zzy/loadsway/LoadSway.htm zzy/loadsway/LoadSway.htm yLogic/ yLogic/

56 A Real Fuzzy Logic System The subway in Sendai, Japan uses a fuzzy logic control system developed by Serji Yasunobu of Hitachi. It took 8 years to complete and was finally put into use in 1987.

57 Control System Based on rules of logic obtained from train drivers so as to model real human decisions as closely as possible Task: Controls the speed at which the train takes curves as well as the acceleration and braking systems of the train

58  This system is still not perfect; humans can do better because they can make decisions based on previous experience and anticipate the effects of their decisions This led to…

59 Decision Support: Predictive Fuzzy Control Can assess the results of a decision and determine if the action should be taken Has model of the motor and break to predict the next state of speed, stopping point, and running time input variables Controller selects the best action based on the predicted states.

60 The results of the fuzzy logic controller for the Sendai subway are excellent!! The train movement is smoother than most other trains Even the skilled human operators who sometimes run the train cannot beat the automated system in terms of smoothness or accuracy of stopping

61 Current Uses of Fuzzy Logic Widespread in Japan (multitudes of household appliances) Emerging applications in the West Digital Camera Thermostat (Air Condition, Refrigerator)


ดาวน์โหลด ppt Fuzzy Logic Adapted from: Wei Zhang CSE Dept. Lehigh University.

งานนำเสนอที่คล้ายกัน


Ads by Google