## Hiva Company

# What is Fuzzy Logic?

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

• What is Fuzzy Logic?

• Why do we use Fuzzy Logic?

• Architecture

• Membership Function

• Fuzzy Logic vs Probability

• Applications of Fuzzy Logic

• Advantages & Disadvantages

• Fuzzy Logic in AI: Example

# What is Fuzzy Logic?

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:

o Certainly Yes

o Possibly Yes

o Cannot Say

o Possibly No

o Certainly No

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

• It can be implemented in systems with different sizes and capabilities such as micro-controllers, large networked or workstation-based systems.

• Also, it can be implemented in hardware, software or a combination of both.

# Why do we use Fuzzy Logic?

o It controls machines and consumer products

o If not accurate reasoning, it at least provides acceptable reasoning

o This helps in dealing with the uncertainty in engineering

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.

# Fuzzy Logic Architecture

**1- Rules – ** It contains all the rules and the if-then conditions offered by the experts to control the decision-making system. The recent update in the fuzzy theory provides different effective methods for the design and tuning of fuzzy controllers. Usually, these developments reduce the number of fuzzy rules.

**2- Fuzzification – ** This step converts inputs or the crisp numbers into fuzzy sets. You can measure the crisp inputs by sensors and pass them into the control system for further processing. It splits the input signal into five steps such as-

**3- Inference Engine – ** It determines the degree of match between fuzzy input and the rules. According to the input field, it will decide the rules that are to be fired. Combining the fired rules, form the control actions.

**4- Defuzzification – ** The Defuzzification process converts the fuzzy sets into a crisp value. There are different types of techniques available, and you need to select the best-suited one with an expert system.

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

# Membership Function

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 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.

# Fuzzy Logic vs Probability

Fuzzy Logic | Probability |
---|---|

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 truth | Probability theory captures partial knowledge |

Fuzzy logic takes truth degrees as a mathematical basis | Probability is a mathematical model of ignorance |

# Applications of Fuzzy Logic

• It is used in the aerospace field for altitude control of spacecraft and satellite.

• This controls the speed and traffic in the automotive systems.

• It is used for decision making support systems and personal evaluation in the large company business.

• It also controls the pH, drying, chemical distillation process in the chemical industry.

• Fuzzy logic is used in Natural language processing and various intensive applications in Artificial Intelligence.

• It is extensively used in modern control systems such as expert systems.

• Fuzzy Logic mimics how a person would make decisions, only much faster. Thus, you can use it with Neural Networks.

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

• The structure of Fuzzy Logic Systems is easy and understandable

• Fuzzy logic is widely used for commercial and practical purposes

• It helps you to control machines and consumer products

• It helps you to deal with the uncertainty in engineering

• Mostly robust as no precise inputs required

• If the feedback sensor stops working, you can program it into the situation

• You can easily modify it to improve or alter system performance

• Inexpensive sensors can be used which helps you to keep the overall system cost and complexity low

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

o Fuzzy logic is not always accurate. So the results are perceived based on assumptions and may not be widely accepted

o It cannot recognize machine learning as-well-as neural network type patterns

o Validation and Verification of a fuzzy knowledge-based system needs extensive testing with hardware

o Setting exact, fuzzy rules and, membership functions is a difficult task

o At times, the fuzzy logic is confused with probability theory

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

# Step 1

# Step 2

# Step 3

• If Hot then Fast

• If Warm then Medium

• And, if Cold then Slow

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.

Hiva IoT Technology Company has been operating in the field of Artificial Intelligence since 2018, utilizing the knowledge, expertise and experience of capable people in the field of Fuzzy Logic in Artificial Intelligence.

Reference: edureka.co