CSE-41XX
CS-4101 AI

Lecture 08.2: Fuzzy Expert Systems

Handling vagueness and ambiguity using Fuzzy Logic, membership functions, and the four steps of Fuzzy Inference.

In classical Boolean logic, everything is crisp: a statement is either True (11) or False (00). However, human experts rarely think in binary. An expert might say, "Though the power transformer is slightly overloaded, I can keep this load for a while." A traditional rule-based system cannot process "slightly" or "a while" because they are not binary states.

Fuzzy Logic, introduced by Lotfi Zadeh in 1965, solves this by mirroring the intrinsic way humans think. Instead of two-valued logic, fuzzy logic is multi-valued, dealing in Degrees of Membership where values range continuously between [0.0,1.0][0.0, 1.0].


Crisp Sets vs. Fuzzy Sets

To understand fuzzy logic, let us compare how sets are represented.

1. Representation & Notation

  • Crisp Set: A membership function μA(x)\mu_A(x) is binary:

μA(x)={1if xA0if xA\mu_A(x) = \begin{cases} 1 & \text{if } x \in A \\ 0 & \text{if } x \notin A \end{cases}

  • Fuzzy Set: A membership function μA(x)\mu_A(x) is continuous:

μA(x)[0.0,1.0]\mu_A(x) \in [0.0, 1.0]

In fuzzy set theory, a discrete fuzzy set AA is represented using Zadeh's Notation: A=i=1nμi/xi=μ1/x1+μ2/x2++μn/xnA = \sum_{i=1}^{n} \mu_i / x_i = \mu_1/x_1 + \mu_2/x_2 + \dots + \mu_n/x_n

[!CAUTION] Zadeh Notation Warning:

  • The slash / is not a division operator; it acts as a separator linking the membership value μi\mu_i to its corresponding element xix_i (i.e. degree/element\text{degree} / \text{element}).
  • The plus signs + and summation symbol \sum do not represent arithmetic addition; they represent the union of the elements.
  • Crisp Example: For a set of heights H={152cm,167cm,198cm}H = \{152\text{cm}, 167\text{cm}, 198\text{cm}\} representing "Tall Men", a crisp threshold of 180cm180\text{cm} gives:

Acrisp={0/152,0/167,1/198}{198}A_{\text{crisp}} = \{0/152, 0/167, 1/198\} \equiv \{198\}

  • Fuzzy Example: Under Zadeh's fuzzy representation, we can write:

Afuzzy={0.0/152+0.15/167+0.98/198}A_{\text{fuzzy}} = \{0.0/152 + 0.15/167 + 0.98/198\}


Linguistic Variables and Values

A key innovation of fuzzy systems is the formal separation of variables and their qualifiers:

  • Linguistic Variable: A variable whose values are words or sentences in a natural language (e.g., Temperature, Project Funding, Driving Speed).
  • Linguistic Value: The words/labels that qualify the linguistic variable (e.g., Cool, Warm, Inadequate, Marginal, Adequate, Fast, Slow).
Linguistic VariableTypical Linguistic Values (Fuzzy Sets)
Project FundingInadequate (A1A_1), Marginal (A2A_2), Adequate (A3A_3)
Project StaffingSmall (B1B_1), Large (B2B_2)
Risk LevelLow (C1C_1), Normal (C2C_2), High (C3C_3)

The Four Steps of Fuzzy Inference

Fuzzy inference is the process of mapping a set of crisp numerical inputs to a crisp numerical output.

Let's walk through a concrete, step-by-step calculation using a driving assistant system.

Rules in the Knowledge Base

  • Rule 1: IF it is Sunny (Cloud Cover) AND Warm (Temperature), THEN drive Fast (Speed).

SunnyWarmFast\text{Sunny} \wedge \text{Warm} \Rightarrow \text{Fast}

  • Rule 2: IF it is Cloudy (Cloud Cover) AND Cool (Temperature), THEN drive Slow (Speed).

CloudyCoolSlow\text{Cloudy} \wedge \text{Cool} \Rightarrow \text{Slow}

Crisp Inputs

  • Temperature = 65F65^\circ\text{F}
  • Cloud Cover = 25%25\%

Step 1: Fuzzification

We project the crisp inputs onto the membership function curves of our fuzzy sets:

  1. Temperature (65F65^\circ\text{F}):
    • μCool(65)=0.3\mu_{\text{Cool}}(65) = 0.3
    • μWarm(65)=0.7\mu_{\text{Warm}}(65) = 0.7
  2. Cloud Cover (25%25\%):
    • μSunny(25)=0.7\mu_{\text{Sunny}}(25) = 0.7
    • μCloudy(25)=0.1\mu_{\text{Cloudy}}(25) = 0.1

Step 2: Rule Evaluation

We apply fuzzy logic operators to evaluate the antecedents (the IF parts).

  • Fuzzy Conjunction (AND): Evaluated using the minimum operator (min\min).

μAB=min(μA,μB)\mu_{A \wedge B} = \min(\mu_A, \mu_B)

  • Fuzzy Disjunction (OR): Evaluated using the maximum operator (max\max).

μAB=max(μA,μB)\mu_{A \vee B} = \max(\mu_A, \mu_B)

Applying this to our rules:

  • Rule 1 Evaluation: Sunny (0.70.7) \wedge Warm (0.70.7):

μFast=min(μSunny(25),μWarm(65))=min(0.7,0.7)=0.7\mu_{\text{Fast}} = \min(\mu_{\text{Sunny}}(25), \mu_{\text{Warm}}(65)) = \min(0.7, 0.7) = 0.7

Result: The rule fires, prescribing the driving speed to be Fast to a degree of 0.70.7.

  • Rule 2 Evaluation: Cloudy (0.10.1) \wedge Cool (0.30.3):

μSlow=min(μCloudy(25),μCool(65))=min(0.1,0.3)=0.1\mu_{\text{Slow}} = \min(\mu_{\text{Cloudy}}(25), \mu_{\text{Cool}}(65)) = \min(0.1, 0.3) = 0.1

Result: The rule fires, prescribing the driving speed to be Slow to a degree of 0.10.1.


Step 3: Aggregation

We unify the fuzzy outputs of all rules into a single fuzzy set. Our aggregated output fuzzy speed profile dictates that our speed is:

  • Slow to a degree of 0.10.1
  • Fast to a degree of 0.70.7

Step 4: Defuzzification

To calculate our final crisp speed, we find the Center of Gravity (Centroid) of the aggregated fuzzy set.

Let's assume the center (where the membership degree is 1.01.0) of the membership functions for the output speed are:

  • Slowcenter=25 mph\text{Slow}_{\text{center}} = 25\text{ mph}
  • Fastcenter=75 mph\text{Fast}_{\text{center}} = 75\text{ mph}

We compute the weighted mean of the centers of gravity: Crisp Speed=(μkCk)μk=μSlowSlowcenter+μFastFastcenterμSlow+μFast\text{Crisp Speed} = \frac{\sum (\mu_k \cdot C_k)}{\sum \mu_k} = \frac{\mu_{\text{Slow}} \cdot \text{Slow}_{\text{center}} + \mu_{\text{Fast}} \cdot \text{Fast}_{\text{center}}}{\mu_{\text{Slow}} + \mu_{\text{Fast}}}

Substituting our values: Crisp Speed=0.125+0.7750.1+0.7=2.5+52.50.8=550.8=68.75 mph\text{Crisp Speed} = \frac{0.1 \cdot 25 + 0.7 \cdot 75}{0.1 + 0.7} = \frac{2.5 + 52.5}{0.8} = \frac{55}{0.8} = 68.75\text{ mph}

The system commands the car to drive at exactly 68.75 mph68.75\text{ mph}.


Concluding Remarks

Fuzzy Expert Systems provide a highly natural way to model human expertise in a computer program, dealing seamlessly with imprecision and vagueness (though not necessarily uncertainty, which is better handled by probabilistic models). However, they require careful, manual tuning of membership functions and may not scale well to highly complex problems.

On this page