The word ‘fuzzy’ means the things that are not clear (or are vague). In real-life situations, we often encounter circumstances in which it is difficult to determine whether to go this way or that or given a statement, it is difficult to judge whether it is true or false. In such a situation, fuzzy logic provides many values between the true and false thereby offering the flexibility to find the best solution for the given situation at that particular point in time. As seen from Fig. 10.1, fuzzy logic contains multiple logical values that are the truth values of a variable.

 

In fuzzy logic, instead of saying just hot or cold, we can have multiple values like Certainly Yes, Possibly Yes, Cannot Say, Possibly No and Certainly No.

images

FIGURE 10.1 Example of Fuzzy Logic as compared to Boolean Logic

Fuzzy logic that is based on the Fuzzy Set Theory was introduced by Lofti Zadeh in 1965. It provides a range of possibilities that used to be generated by humans but were not offered by computers. Computer systems followed Boolean system that were limited to only two values- 0 or 1, where 1 denotes the absolute truth value and 0 denotes the absolute false value. Fuzzy system offers multiple possibilities between the 0 and 1, so that the solution can be partially false and partially true. It is a very important concept that is often implemented in micro-controllers, workstation-based or large network-based systems in their hardware or software for achieving the definite output.

10.1.1 Characteristics of Fuzzy Logic

  1. It is flexible.
  2. It is easy to understand and implement.
  3. Fuzzy logic is useful for finding the best solution of problems that have approximate or uncertain reasoning.
  4. It is used to develop functions which are non-linear of arbitrary complexity.
  5. In fuzzy logic, everything is a matter of degree.
  6. It allows any logical system to be easily fuzzified.
  7. It is based on natural language processing.
  8. It helps to improve the execution time of the algorithms.

10.1.2 Architecture of a Fuzzy Logic System

The architecture of the fuzzy logic system as shown in Fig. 10.2 consists of four components which are discussed below.

images

FIGURE 10.2 Architecture of fuzzy logic system

Rule base, as we know, is used for storing rules in the form of If-Then conditions. These conditions are added by the experts and are usually used by the decision-making systems for making vital decisions. Recent advances in Fuzzy theory offer effective methods for designing and tuning of fuzzy controllers. With these updates, the number of rules stored in the rule base has come down considerably.

Fuzzification is used for converting the crisp system inputs into fuzzy inputs. The crisp inputs usually come from sensors but cannot be directly processed by the inference engine. So, they first undergo fuzzification module where the crisp input is divided into following five states in any fuzzy logic system as follows:

  1. Large positive (LP)
  2. Medium positive (MP)
  3. Small (S)
  4. Medium negative (MN)
  5. Large negative (LN)

Inference engine is the most important component of a fuzzy logic system that processes information. The engine interacts with the rules base to find a rule that is best applicable on the current fuzzy input. Once all rules are fired, the results of their application on fuzzy input are combined to give the control actions.

Defuzzification component accepts fuzzy inputs from the inference engine to transform them into a crisp value that is acceptable by the user.

10.1.3 Membership Function

The membership function, also known as indicator or characteristics function, was introduced by Zadeh. The function represents the graph of fuzzy sets to facilitate users to quantify the linguistic term. This graph maps each element of the fuzzy set, x to a value between 0 and 1.

For example, for the Fuzzy set B, the membership function for X is defined as:

images

This implies that, in function X, each element of set B is mapped to a value between 0 and 1. This is called a degree of membership or membership value. It quantifies the degree of membership of the element in X to the fuzzy set A. When plotting these values on a graph, the universal set or the universe of discourse is marked on X-axis and the degrees of membership in the [0, 1] interval is represented on the Y-axis.

There may be multiple membership functions that can fuzzify a numerical value. However, we usually use simple membership functions rather than complex functions as complexity of these functions do not improve the precision in the output.

10.1.4 Example of a Fuzzy Logic System

Let us consider a fuzzy logic system in an air conditioning system having five levels. The system adjusts the temperature of the air conditioner by comparing the room temperature and the target temperature value (as shown in Fig. 10.3). To develop such a system, follow the steps given below.

Step 1 − Define linguistic variables and terms

In this system, linguistic variables are input and output variables in the form of simple words or sentences. To specify room temperature, linguistic terms can be cold, warm, hot, etc. So, we can write it as,

images

Step 2 − Construct membership functions for them

The membership functions of temperature variable are given in Fig. 10.4.

Step 3 − Construct knowledge base rules

In this step, a matrix of room temperature values versus target temperature values that an air conditioning system is expected to provide is created. In the matrix given below, room temperature is written in the leftmost (first) column and the first row of other columns gives the target temperature. Except the cells in the first column and the first row, other cells in the matrix specify the action that needs to be performed.

images

FIGURE 10.3 Fuzzy logic system in an air conditioning system

images

FIGURE 10.4 Membership functions of temperature variable

 

TABLE 10.1 Knowledge base for Temperatureimages

For example, the highlighted cell states that if the room temperature is WARM and the expected temperature is HOT, then we need to increase HEATING.

Now, we will create a set of rules into the knowledge base in the form of IF-THEN-ELSE structures as shown in Table 10.2.

 

TABLE 10.2 Creating Rulesimages

Step 4 − Obtain fuzzy value

Fuzzy values are obtained by applying fuzzy set operations on the rules. The final fuzzy value is obtained by combining all results obtained by evaluating the rules.

Step 5 − Perform defuzzification

Defuzzification is performed based on the membership function for output variable as shown in Fig. 10.5.

images

FIGURE 10.5 Membership function for output variable in case of Defuzzification

10.1.5 Classical and Fuzzy Set Theory

Before going into the Fuzzy set theory, let us first quickly revise the set theory which we are all already familiar with.

10.1.5.1 Set Theory

A set is a collection of unordered or ordered elements. For example, we have a set of, all-natural numbers, even numbers, students in a class, rivers in a country, etc. these sets can be classified in various categories as shown in Fig. 10.6.

images

FIGURE 10.6 Set Theory

However, a classical set is a collection of distinct elements and has crisp boundaries. The classical set is defined in such a way that the universe of discourse (set of all possible values, also known as universal set) is divided into two groups—members and non-members. Therefore, such a set does not support partial membership. We can represent a classical set either in roaster form or in set-builder form.

Roaster form, also known as a tabular form, denotes a set by enclosing comma-separated members of the set within the brackets (as given below):

 

Set_name = {element1, element2, element3, ……, element N}

For example, set of Natural Numbers can be written as: N = {1, 2, 3, 4, 5, 6, 7, ……,n).

Similarly, set of Even Numbers less than 20 can be written as,

 

X = {2, 4, 6, 8, 10, 12, 14, 16, 18}.

Set builder form defines a set by stating the common properties of elements in the set. It can be denoted as:

 

A = {x : p(x)}

For example, the set {2, 4, 6, 8, 10, 12, 14, 16, 18} is written as:

 

B = {x:2 ≤ x < 20 and (x%2) = 0}

10.1.5.2 Operations on Classical Set

We can perform different operations on classical sets like union, intersection, difference and complement.

Union (A U B)

The result of this operation generates a set of those elements which exist in either appear in A or in B or in both. This means that the union operation combines all the elements from both the sets in a new set. For this reason, union operation is also known as a Logical OR operation on the set. It is denoted as follows:

images

For example, given

Set A = {0, 1, 2, 3}

Set B = {1, 2, 3, 4, 5}, then

A ∪ B = {0, 1, 2, 3, 4, 5}

Intersection (A ∩ B)

The intersection or Logical AND operation returns a new set of those elements which are present in both set A and in set B. The operation is described as, A ∩ B = { x | x ∊ A AND x ∊ B }.

For example, given

Set A = {0, 1, 2, 3}

Set B = {1, 2, 3, 4, 5}, then

A ∩ B = {1, 2, 3}

Difference Operation (A − B)

The difference operation returns a new set of those elements which exist only in set A but not in set B. It is described as follows:

images

For example, given

Set A = {0, 1, 2, 3}

Set B = {2, 3, 4, 5}, then

A – B = {0,1}

Complement Operation (A’)

The complement operation is applied on a single set. It returns a set of elements which do not exist in set A and can be represented as,

images

Here, U is the Universal set. Therefore, we can say that complement of a set is a subset of the universal set as it has all the elements of the universal set except those that are not present in the given set. In other words, the complement of a set A is the difference between the universal set and set A. that is A’ = U − A.

For example, if the universal set consists of all prime numbers up to 25, that is, U = {2, 3, 5, 7, 11, 13, 17, 19, 23} and,

images

A = {2, 3, 5} then,

A’ = (U − A)

= {2, 3, 5, 7, 11, 13, 17, 19, 23} − {2, 3, 5}

= {7, 11, 13, 17, 19, 23}

10.1.5.3 Properties of Classical Set

In this section, we will discuss some basic properties of a classical set.

Commutative Property

The property states that operations on a set can be performed irrespective of order of the sets. That is,

images

For example, given:

A = {1, 2, 3}, and B = {2, 3, 4}, then

A ∪ B = {1, 2, 3, 4} and B ∪ A = {1, 2, 3, 4}

Hence, proved. Similarly, let us prove it in case of intersection.

A ∩ B = {2, 3} and B ∩ A = {2, 3}

Associative Property

Associativity property allows us to perform the operations by grouping the operands and keeping them in similar order.

images

For example, given:

A = {1, 2, 3}, B = {2, 3, 4}and C = {5, 6}, then

A ∪ B = {1, 2, 3, 4} and (A ∪ B) ∪ C = {1, 2, 3, 4, 5, 6}

B ∪ C = {2,3,4,5,6} and A ∪ (B ∪ C) = {1, 2, 3, 4, 5, 6}

Hence, proved. Now,

A ∩ B = {2, 3} and (A ∩ B) ∩ C = φ

B ∩ C = φ. Therefore, A ∩ (B ∩ C) = φ

Idempotency Property

It is defined as

images
images

For example, given A = {1, 2, 3},

images

Similarly, A ∩ A = {1, 2, 3} ∩ {1, 2, 3} = {1, 2, 3}

Absorption Property

This property when defined on two sets states that,

images

For example, given:

A = {1, 2, 3}, B = {2, 3, 4}, then

A ∪ (A ∩ B) = {1, 2, 3} ∪ {2, 3} = {1, 2, 3}

Similarly, A ∩ (A ∪ B) = {1, 2, 3} ∩ { 1, 2, 3, 4} = {1, 2, 3}

Distributive Property

Given three finite sets A, B and C, distributive property is defined as,

images

For example, given:

A = {1, 2, 3}, B = {2, 3, 4} and C = {5, 6}, then

A ∪ (B ∩ C) = {1, 2, 3} ∪ {φ} = {1, 2, 3} (because A ∪ ∅ = A)

(A ∪ B) ∩ (A ∪ C) = {1, 2, 3, 4} ∩ {1, 2, 3, 5, 6} = {1, 2, 3}

Hence, proved. Now,

A ∩ (B ∪ C) = {1, 2, 3} ∩ {2, 3, 4, 5, 6} = {2, 3}

(A ∩ B) ∪ (A ∩ C) = {2, 3} ∪ {φ} = {2, 3}

Identity Property

For a given finite set A and Universal set X, identity property can be given as,

images

For example, given A = {1, 2, 3} and X = {1, 2, 3, 4, 5, 6}

A ∪ {φ} = {1, 2, 3} ∪ {φ} = {1, 2, 3}

A ∩ X = {1, 2, 3} ∩ {1, 2, 3, 4, 5, 6} = {1, 2, 3}

A ∩ {φ} = {1, 2, 3} ∩ {φ} = {φ}

A ∪ X = {1, 2, 3} ∪ {1, 2, 3, 4, 5, 6} = {1, 2, 3, 4, 5, 6}

Transitive Property

This property state that for the finite sets A, B and C, if A is a subset of B and B is a subset of C, then A is also a subset of C. This can be written as,

IF A ⊆ B ⊆ C, then A ⊆ C

For example, given

A = {1, 2, 3}, B = {1, 2, 3, 4, 5} and C = {1, 2, 3, 4, 5, 6}, then

Since all the elements of Aare a part of set B, A is said to be a subset of B.

Since all the elements of set B are a part of set C, B is said to be a subset of C.

Moreover, we see that A is also a subset of C.

Ivolution Property

The property states that for any finite set A,

images

For example, given A = {1, 2, 3} and U = {1, 2, 3, 4, 5, 6}

A’ = {1, 2, 3, 4, 5, 6} − {1, 2, 3} = {4, 5, 6}

A’’ = {1, 2, 3, 4, 5, 6} − {4, 5, 6} = {1, 2, 3}

De Morgan’s Law

Given two sets A and B, the De Morgan’s law says that,

images

For example, given;

A = {1, 2, 3}, B = {2, 3, 4} and U = {1, 2, 3, 4, 5, 6}

(A ∪ B)’ = {{1, 2, 3} ∪ {2, 3, 4}}’ = {1, 2, 3, 4}’ = {5, 6}

A’ ∩ B’ = {4, 5, 6} ∩ {1, 5, 6} = {5, 6}

Hence, proved. Similarly,

(A ∩ B)’ = {2, 3}’ = {1, 4, 5, 6}

A’ ∪ B’ = {4, 5, 6} ∪ {1, 5, 6} = {1, 4, 5, 6}

10.1.6 Fuzzy Set

The classical set theory is the subset of Fuzzy set theory. Or we can say that the fuzzy set theory is a generalization of the classical theory of set (i.e., crisp set). Introduced by Lofti A. Zadeh in 1965, the entire fuzzy logic is based on the fuzzy set theory.

A fuzzy set denoted by the tilde (~) character is a collection of values which exist between 0 and 1. In the fuzzy set, there is also a concept of partial membership.

A fuzzy set (Ã) is a pair of U and M, where U is the Universal set and M is the membership function which takes on values in the interval [0, 1]. The universal set (U) is also denoted by Ω or X.

images

10.1.6.1 Operations on Fuzzy Set

Given two fuzzy sets, and a universal set X, with member functions,

images

The operations defined on the fuzzy set are as follows:

Union Operation

The union operation of a fuzzy set is written as,

images

For example, given:

A = {(X1, 0.2), (X2, 0.4), (X3, 0.6), (X4, 0.8)}

B = {( X1, 0.1), (X2, 0.5), (X3, 0.7), (X4, 0.3)} then,

A U B = {( X1, 0.2), (X2, 0.5), (X3, 0.7), (X4, 0.8)}

Justification:

images

Intersection Operation

The intersection operation of a fuzzy set is written as,

images

For example, given:

A = {(X1, 0.2), (X2, 0.4), (X3, 0.6), (X4, 0.8)}

B = {( X1, 0.1), (X2, 0.5), (X3, 0.7), (X4, 0.1)} then,

A ∩ B = {( X1, 0.1), (X2, 0.4), (X3, 0.6), (X4, 0.1)}

Justification:

images

Complement Operation

The complement operation of fuzzy set is defined by:

images

For example, given:

A = {(X1, 0.5), (X2, 0.4), (X3, 0.2), (X4, 0.1)}, then

images = {(X1, 0.5), (X2, 0.6), (X3, 0.8), (X4, 0.9)}

Justification:

images

 

TABLE 10.3 Differences between classical set theory and fuzzy set theoryimages

10.1.7 Applications of Fuzzy Logic

Fuzzy logic is widely used in different application areas in businesses for making vital decisions.

Automative systems apply fuzzy logic to control brakes in hazardous cases depending on the speed, acceleration, wheel speed and acceleration of the car. It is also used to select the gear based on engine load, driving style and road conditions.

In auto-transmission systems, fuzzy logic is used to improve the efficiency by controlling the fuel injection and ignition based on throttle setting, cooling water temperature, RPM, etc.

Systems developed for defence use fuzzy logic for underwater target recognition and the automatic target recognition of thermal infrared images.

Fuzzy logic can be used to search fuzzy images.

Pattern recognition and classification systems use fuzzy logic for handwriting recognition.

In microwave ovens, fuzzy logic is used to set the lunes power and cooking strategy.

Modern control systems like expert systems often use fuzzy logic.

Fuzzy logic is widely used to predict the stock market and for managing funds.

In chemical industry, fuzzy logic is used to control the ph and chemical distillation process.

In manufacturing industry, fuzzy logic used for optimizing production.

In devices like vacuum cleaners, washing machines, heaters, air conditioners and humidifiers, fuzzy logic is used for controlling the timing of events. For example, an elevator uses fuzzy logic to reduce waiting for time-based on passenger traffic.

In a dish-washer, fuzzy logic is used for adjusting the cleaning cycle, rinse and wash strategies depending on the number of dishes and the amount of food served on the dishes.

Copy machine by Canon uses fuzzy logic for adjusting drum voltage based on picture density, humidity and temperature.

In a golf diagnostic system, fuzzy logic selects golf club based on golfer’s swing and physique.

In a kiln, fuzzy logic is used to control the mixing of cement.

10.1.8 Advantages of Fuzzy Logic

IBM’s Watson is a well-known AI system that uses variations of fuzzy logic and fuzzy semantics.

  1. Fuzzy logic works similar to human reasoning.
  2. The concept is easy to understand.
  3. It does not need large memory as the algorithms can work well with fewer data.
  4. Fuzzy logic is easily applicable in diverse fields.
  5. It provides effective solutions to even highly complex problems.
  6. Fuzzy set theory is based on the set theory of mathematics, so users can easily relate to its basic concepts.
  7. It facilitates controlling micro-controllers and thus electronic devices.
  8. Developing a system based on fuzzy logic takes less time than developing it using conventional methods.
  9. Fuzzy logic is very flexible as it allows users to easily add and delete rules in the system.
  10. Fuzzy logic supports the concept of partial truth, such as 0.9 or 0.5.
  11. Fuzzy logic mimics real-life circumstances, where we rarely have statements that are absolutely true or absolutely false.
  12. Fuzzy logic, when used by quantitative analysts, improves the execution of algorithms.
  13. Algorithms based on fuzzy logic produce accurate results even with imprecise or inaccurate data.
  14. Systems based on fuzzy logic are more robust as they are not dependent on precise inputs.
  15. Given the information about how far the subject in a photograph is, a fuzzy logic system can focus the lens on it.

10.1.9 Disadvantages of Fuzzy Logic

  1. The execution time of fuzzy logic systems is more than conventional systems, so these systems are often slow to generate output.
  2. Output generated by fuzzy logic system is not 100% accurate.
  3. In fuzzy logic system, there are multiple ways to solve a given problem. However, this may lead to ambiguity.
  4. Problems that need highly accurate solutions should not be solved using fuzzy logic.
  5. A fuzzy logic system needs a lot of testing for verification and validation.
  6. The accuracy of results obtained from a fuzzy logic system depends on human expertise and knowledge.
  7. The design of a fuzzy logic system is understandable only when it is simple.
  8. Fuzzy systems lack the capability of machine learning and neural network type pattern recognition.

You must not use fuzzy logic in the following cases:

  1. If it is difficult to map an input space to an output space
  2. When application of common sense can easily solve the problem
  3. Controllers work well without the use of fuzzy logic

10.1.10 Trends

Nowadays, the trend is to use fuzzy logic along with neurocomputing and genetic algorithms. A combination of all these techniques forms the basis of soft computing. In soft computing, the goal is to exploit the tolerance for imprecision, uncertainty and partial truth to achieve tractability, robustness and low solution cost. At present, despite of the fact that soft computing systems are expensive, they are being preferred as they build AI system with MIQ (Machine IQ) much higher than that of conventional neuro-fuzzy systems which combine fuzzy logic and neurocomputing and induce rules from observations. An effective method developed by Dr Roger Jang for this purpose is called ANFIS (Adaptive Neuro-Fuzzy Inference System).

Fuzzy logic approximates human reasoning and balances the tradeoff between precision and significance (illustrated in Fig. 10.7). For example, when there is an unexpected alert of a mass falling on you, the alert need not be precise about the exact mass and speed as is not at all necessary to make a quick decision.

images

FIGURE 10.7

images

FIGURE 10.8 An input/output map for the tipping problem: “Given the quality of service, how much should I tip?”

A fuzzy system behaves like a black box that maps an input space to an output space. Consider the example given in Fig. 10.8 where fuzzy logic is used to determine the appropriate amount of tip by mapping the input space of all possible restaurant service ratings to all possible tip values. Note that between the input and the output, there is a black box that may contain fuzzy systems, linear systems, expert systems, neural networks, differential equations, interpolated multidimensional lookup tables or any other algorithm.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *