`
Introduction to
Artificial
Intelligence
Dr Lekshmi S Nair
Live 14
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.
ARCHITECTURE OF FUZZY LOGIC
• It has four main parts as shown −
• Fuzzification Module − It transforms the
system inputs, which are crisp numbers,
into fuzzy sets.
• It splits the input signal into five steps such
as
• LP x is Large Positive
• MP x is Medium Positive
• S x is Small
• MN x is Medium Negative
• LN x is Large Negative
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
}
FUZZY LOGIC REPRESENTATION
Slowest
[ 0.0 – 0.25 ]
Slow
[ 0.25 – 0.50 ]
Fast
[ 0.50 – 0.75 ]
Fastest
[ 0.75 – 1.00 ]
FUZZY LOGIC REPRESENTATION
CONT.
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
}
ARCHITECTURE OF FUZZY LOGIC
• Knowledge Base − It stores IF-THEN rules provided by experts.
• Inference Engine − It simulates the human reasoning process by
making fuzzy inference on the inputs and IF-THEN rules.
• Defuzzification Module − It transforms the fuzzy set obtained by the
inference engine into a crisp value.
FUZZY LOGIC: Membership function
• Membership functions allow you to quantify linguistic term and
represent a fuzzy set graphically.
• A membership function for a fuzzy set A on the universe of
discourse X is defined as µA:X → [0,1].
• Here, each element of X is mapped to a value between 0 and 1.
• It is called membership value or degree of membership.
• It quantifies the degree of membership of the element in X to the
fuzzy set A.
• x axis represents the universe of discourse.
• y axis represents the degrees of membership in the [0, 1] interval.
• There can be multiple membership functions applicable to fuzzify a
numerical value.
• Simple membership functions are used as use of complex functions
does not add more precision in the output.
AIR CONDITIONING SYSTEM
Let us consider an air conditioning system with 5-lvel fuzzy logic
system. This system adjusts the temperature of air conditioner by
comparing the room temperature and the target temperature
value.
AIR CONDITIONING SYSTEM
Algorithm:
i. Define linguistic variables and terms.
ii. Construct membership functions for them.
iii. Construct knowledge base of rules.
iv. Convert crisp data into fuzzy data sets using membership functions.
v.Evaluate rules in the rule base.
vi.Combine results from each rule.
vii.Convert output data into non-fuzzy values.
Development 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.
Step 2: Construct membership functions for them
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
Step3: Construct knowledge base rules
Step 5: Perform defuzzification
Step 5: Perform defuzzification
FUZZY LOGIC IN OTHER FIELDS
Business
Hybrid Modeling
Expert Systems
ADVANTAGES & DISADVANTAGES
Advantages :
i.Mathematical concepts within fuzzy reasoning are very simple.
ii.You can modify a FLS by just adding or deleting rules due to
flexibility of fuzzy logic.
iii.Fuzzy logic Systems can take imprecise, distorted, noisy input
information.
iv.FLSs are easy to construct and understand.
v.Fuzzy logic is a solution to complex problems in all fields of life,
including medicine, as it resembles human reasoning and decision
making.
Disadvantages
i.There is no systematic approach to fuzzy system designing.
ii.They are understandable only when simple.
iii.They are suitable for the problems which do not need high accuracy.
CONCLUSION
Fuzzy logic provides an alternative way to
represent linguistic and subjective attributes
of the real world in computing.
It is able to be applied to control systems and
other applications in order to improve the
efficiency and simplicity of the design
process.