What is Fuzzy Logic in AI and What are its Applications?

Last updated on Nov 21,2023 65.7K Views
A Data Science Enthusiast with in-hand skills in programming languages such as... A Data Science Enthusiast with in-hand skills in programming languages such as Java & Python.

What is Fuzzy Logic in AI and What are its Applications?

edureka.co

In our day to day life, we might face situations where we are unable to determine whether the state is true or false. Fuzzy refers to something which is unclear or vague. Fuzzy Logic in AI provides valuable flexibility for reasoning. And in this article, we will learn about this logic and its implementation in Artificial Intelligence in the following sequence:

 

What is Fuzzy Logic?

Fuzzy Logic (FL) is a method of reasoning that resembles human reasoning. This approach is similar to how humans perform decision making. And it involves all intermediate possibilities between YES and NO.

 

 

The conventional logic block that a computer understands takes precise input and produces a definite output as TRUE or FALSE, which is equivalent to a human being’s YES or NO. The Fuzzy logic was invented by Lotfi Zadeh who observed that unlike computers, humans have a different range of possibilities between YES and NO, such as:

 

 

The Fuzzy logic works on the levels of possibilities of input to achieve a definite output. Now, talking about the implementation of this logic:

 

Why do we use Fuzzy Logic?

Generally, we use the fuzzy logic system for both commercial and practical purposes such as:

So, now that you know about Fuzzy logic in AI and why do we actually use it, let’s move on and understand the architecture of this logic.

Check out this Artificial Intelligence Course by Edureka to upgrade your AI skills to the next level.

Fuzzy Logic Architecture

The fuzzy logic architecture consists of four main parts:

 

 

So, this was about the architecture of fuzzy logic in AI. Now, let’s understand the membership function.

 

Membership Function

The membership function is a graph that defines how each point in the input space is mapped to membership value between 0 and 1. It allows you to quantify linguistic terms 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]

It quantifies the degree of membership of the element in X to the fuzzy set A.

There can be multiple membership functions applicable to fuzzify a numerical value. Simple membership functions are used as the complex functions do not add precision in the output. The membership functions for LP, MP, S, MN, and LN are:

 

 

 

The triangular membership function shapes are most common among various other membership function shapes. Here, the input to 5-level fuzzifier varies from -10 volts to +10 volts. Hence the corresponding output also changes.

Top 10 Trending Technologies to Learn in 2024 | Edureka

This video talks about the Top 10 Trending Technologies in 2024 that you must learn.

 

Fuzzy Logic vs Probability

 

Fuzzy LogicProbability
In fuzzy logic, we basically try to capture the essential concept of vagueness.Probability is associated with events and not facts, and those events will either occur or not occur
Fuzzy Logic captures the meaning of partial truthProbability theory captures partial knowledge
Fuzzy logic takes truth degrees as a mathematical basisProbability is a mathematical model of ignorance

So, these were some of the differences between fuzzy logic in AI and probability. Now, let’s have a look at some of the applications of this logic.

 

Applications of Fuzzy Logic

The Fuzzy logic is used in various fields such as automotive systems, domestic goods, environment control, etc. Some of the common applications are:

These were some of the common applications of the Fuzzy Logic. Now, let’s have a look at the advantages and disadvantages of using Fuzzy Logic in AI.

 

Advantages & Disadvantages of Fuzzy Logic

Fuzzy logic provides simple reasoning similar to human reasoning. There are more such advantages of using this logic, such as:

 

These were the different advantages of fuzzy logic. But, it has some disadvantages as well:

 

 

 

So, these were some of the advantages and disadvantages of using fuzzy logic in AI. Now, let’s take a real-world example and understand the working of this logic.

 

Fuzzy Logic in AI: Example

The design of a fuzzy logic system starts with a set of membership functions for each input and a set for each output. A set of rules is then applied to the membership functions to yield a crisp output value. Let’s take an example of process control and understand fuzzy logic.

Step 1

Here, Temperature is the input and Fan Speed is the output. You have to create a set of membership functions for each input. A membership function is simply a graphical representation of the fuzzy variable sets. For this example, we will use three fuzzy sets, Cold, Warm and Hot. We will then create a membership function for each of three sets of temperature:

 

Step 2

In the next step, we will use three fuzzy sets for the output, Slow, Medium and Fast. A set of functions is created for each output set just as for the input sets.

 

Step 3

Now that we have our membership functions defined, we can create the rules that will define how the membership functions will be applied to the final system. We will create three rules for this system.

 

 

These rules apply to the membership functions to produce the crisp output value to drive the system. Thus, for an input value of 52 degrees, we intersect the membership functions. Here, we are applying two rules as the intersection occurs on both functions. You can extend the intersection points to the output functions to produce an intersecting point. You can then truncate the output functions at the height of the intersecting points.

This was a very simple explanation of how the fuzzy logic systems work. In a real working system, there would be many inputs and the possibility of several outputs. This would result in a fairly complex set of functions and many more rules.

With this, we have come to the end of our Fuzzy Logic in AI article. I hope you understood what is fuzzy logic and how it works. 

Got a question for us? Please mention it in the comments section of “Fuzzy Logic in AI” and we will get back to you.

BROWSE COURSES