You are on page 1of 19

ARTIFICIAL INTELLIGENCE

MR50106
Unit – III

FUZZY LOGIC

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 2
Odisha
CONTENTS

֍ Introduction to crisp sets and fuzzy sets,

֍ Basic fuzzy set operations

֍ Fuzzy logic modeling and control.

֍ Fuzzification, inferencing and defuzzification.

֍ Fuzzy knowledge and rule bases.

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 3
Odisha
Unit – 3 Lecture 2
Objective of Today’s Lecture
Understand the architecture of Fuzzy Logic System

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 4
Odisha
Fuzzy Logic
Architecture

Four
Components

Inference
Rule Base Fuzzification Defuzzification
Engine

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 5
Odisha
Fuzzy Logic
Architecture

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 6
Odisha
Fuzzy Logic
Architecture

Rule Base is a component


 Contains all the rules.
 If-Then conditions are used for controlling the
decision-making systems.

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 7
Odisha
Fuzzy Logic
Architecture
 Fuzzification is a module or component for
transforming the system inputs.
 It converts the crisp number into fuzzy steps.

5 states
 Large Positive (LP)
 Medium Positive (MP)
 Small (S)
 Medium Negative (MN)
 Large negative (LN)

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 8
Odisha
Fuzzy Logic
Architecture

Inference Engine
 Main component in any Fuzzy Logic system (FLS),
 All the information is processed in the Inference
Engine.
 It helps to determine the degree of match between
fuzzy inputs and the rules.
 Based on the match, this system determines which
rule is to be added according to the given input
field.

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 9
Odisha
Fuzzy Logic
Architecture

Defuzzification
 A module or component,
 It takes the fuzzy set inputs generated by
the Inference Engine, and then transforms them into
a crisp value.
 It is the last step in the process of a fuzzy logic
system.
 The crisp value is a type of value which is
acceptable by the user.

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 10
Odisha
Fuzzy Logic
Membership Function

5 states
 Large Positive (LP)
 Medium Positive (MP)
 Small (S)
 Medium Negative (MN)
 Large negative (LN)

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 11
Odisha
Fuzzy Logic
Example

Algorithm
 Define linguistic Variables and terms (start)
 Construct membership functions for them. (start)
 Construct knowledge base of rules (start)
 Convert crisp data into fuzzy data sets using membership
functions. (fuzzification)
 Evaluate rules in the rule base. (Inference Engine)
 Combine results from each rule. (Inference Engine)
 Convert output data into non-fuzzy values.
(defuzzification)

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 12
Odisha
Fuzzy Logic
Example

Step 1 − Define linguistic variables and terms


 Linguistic variables are input and output variables in the form of simple words or sentences. For room
temperature, cold, warm, hot, etc., are linguistic terms.
 Temperature (t) = {very-cold, cold, warm, very-warm, hot}
 Every member of this set is a linguistic term and it can cover some portion of overall temperature values.

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 13
Odisha
Fuzzy Logic
Example

Step 2 − Construct membership functions for them


The membership functions of temperature variable are as shown:

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 14
Odisha
Fuzzy Logic
Example
Step3 − Construct knowledge base rules
Create a matrix of room temperature values versus target temperature values that an air conditioning system is
expected to provide.

RoomTemp.
Very_Cold Cold Warm Hot Very_Hot
/Target
Very_Cold No_Change Heat Heat Heat Heat
Cold Cool No_Change Heat Heat Heat
Warm Cool Cool No_Change Heat Heat
Hot Cool Cool Cool No_Change Heat
Very_Hot Cool Cool Cool Cool No_Change

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 15
Odisha
Fuzzy Logic
Example
Step3 − Construct knowledge base rules
Create a matrix of room temperature values versus target temperature values that an air conditioning system is
expected to provide.

Build a set of rules into the knowledge base in the form of IF-THEN-ELSE structures.
Sr. No. Condition Action
1 IF temperature=(Cold OR Very_Cold) AND target=Warm THEN Heat
2 IF temperature=(Hot OR Very_Hot) AND target=Warm THEN Cool
3 IF (temperature=Warm) AND (target=Warm) THEN No_Change

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 16
Odisha
Fuzzy Logic
Example

Step 4 − Obtain fuzzy value


 Fuzzy set operations perform evaluation of rules.
 The operations used for OR and AND are Max and Min respectively.
 Combine all results of evaluation to form a final result. This result is a fuzzy value.

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 17
Odisha
Fuzzy Logic
Example
Step 5 − Perform Defuzzification
 Defuzzification is then performed according to membership function for output variable.

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 18
Odisha
Quiz

Asutosh Patnaik, Asst. Prof., Dept. of EEE, CGU,


01-05-2021 19
Odisha

You might also like