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 () or False (). 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 .
Crisp Sets vs. Fuzzy Sets
To understand fuzzy logic, let us compare how sets are represented.
1. Representation & Notation
- Crisp Set: A membership function is binary:
- Fuzzy Set: A membership function is continuous:
In fuzzy set theory, a discrete fuzzy set is represented using Zadeh's Notation:
[!CAUTION] Zadeh Notation Warning:
- The slash
/is not a division operator; it acts as a separator linking the membership value to its corresponding element (i.e. ).- The plus signs
+and summation symbol do not represent arithmetic addition; they represent the union of the elements.
- Crisp Example: For a set of heights representing "Tall Men", a crisp threshold of gives:
- Fuzzy Example: Under Zadeh's fuzzy representation, we can write:
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 Variable | Typical Linguistic Values (Fuzzy Sets) |
|---|---|
| Project Funding | Inadequate (), Marginal (), Adequate () |
| Project Staffing | Small (), Large () |
| Risk Level | Low (), Normal (), High () |
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).
- Rule 2: IF it is Cloudy (Cloud Cover) AND Cool (Temperature), THEN drive Slow (Speed).
Crisp Inputs
- Temperature =
- Cloud Cover =
Step 1: Fuzzification
We project the crisp inputs onto the membership function curves of our fuzzy sets:
- Temperature ():
- Cloud Cover ():
Step 2: Rule Evaluation
We apply fuzzy logic operators to evaluate the antecedents (the IF parts).
- Fuzzy Conjunction (AND): Evaluated using the minimum operator ().
- Fuzzy Disjunction (OR): Evaluated using the maximum operator ().
Applying this to our rules:
- Rule 1 Evaluation: Sunny () Warm ():
Result: The rule fires, prescribing the driving speed to be Fast to a degree of .
- Rule 2 Evaluation: Cloudy () Cool ():
Result: The rule fires, prescribing the driving speed to be Slow to a degree of .
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
- Fast to a degree of
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 ) of the membership functions for the output speed are:
We compute the weighted mean of the centers of gravity:
Substituting our values:
The system commands the car to drive at exactly .
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.
Lecture 08.1: Rule-Based Expert Systems
An introduction to Expert Systems, their architecture, and the mechanics of Forward and Backward Chaining.
Lecture 09.1: Knowledge-Based Agents and Logic
Exploring how AI agents use explicit knowledge representation, Propositional Logic, and First-Order Logic to reason about the world.