Fuzzy Logic and Fuzzy Systems

Guide to AI and Data Courses · Part II: Branches of AI
Fuzzy setsMembership functionsLinguistic rulesFuzzy inferenceFuzzy controlNeighboring courses
Sercan KÜLCÜ · Giresun University · Computer Engineering

Introduction

What Question Does It Ask?

How do we reason with concepts like "hot" or "fast" that have no sharp boundary?

Fuzzy logic drops the sharp line between belonging and not belonging to a set; it gives each element a degree of membership between 0 and 1. Rules can then be written with linguistic terms such as "hot" or "fairly fast", and these rules produce a numeric decision or control signal.

At a glance

Approach

partial membership and linguistic rules

Input

measurements, expert rules

Output

control signal or decision

Success measure

control quality, expert agreement

Math load

low-medium: set theory

Data needs

little; expert knowledge

Introduction

A Short History

1965

Zadeh publishes "Fuzzy Sets", introducing sets with partial membership.

1973

Zadeh introduces linguistic variables and approximate reasoning with fuzzy IF-THEN rules.

1975

Mamdani and Assilian control a steam engine with the first fuzzy controller.

1985

Takagi and Sugeno propose the fuzzy model whose rule outputs are functions (TS model).

1987

The Sendai subway in Japan opens, accelerating and braking under fuzzy control.

1993

Jang publishes ANFIS, which trains fuzzy rules like a neural network.

The Course

Core Concepts

Fuzzy set

Each element has a membership degree between 0 and 1.

Membership function

Triangle, trapezoid, Gaussian: maps a value to a degree.

Linguistic variable

A variable whose values are words: low, medium, high.

Fuzzy operators

Minimum for AND, maximum for OR, 1-µ for NOT.

Rule base

Rules like IF temperature is high THEN fan is fast.

Mamdani inference

Rule outputs are fuzzy sets, later defuzzified.

Sugeno inference

Rule outputs are functions of the inputs; fast to compute.

Defuzzification

Reducing the fuzzy result to one number: the centroid.

The Course

A Typical Workflow

Measurecrisp inputMap tomembershipfuzzificationApplyrulesIF-THENbaseAggregateoutput setDefuzzifycrisp output
Example: An air conditioner measures 27 °C in a room; this value belongs to "hot" with degree 0.7 and to "warm" with degree 0.3. The rules "if hot, cool strongly" and "if warm, cool moderately" fire with these degrees, their outputs are aggregated, and the centroid gives the compressor a single power value such as 72 percent.

The Course

What Does the Course Cover?

  1. Crisp and fuzzy sets; degree of membership
  2. Membership functions: triangular, trapezoidal, Gaussian
  3. Fuzzy set operations; t-norms and t-conorms
  4. Fuzzy relations and max-min composition
  5. The extension principle and fuzzy numbers
  6. Linguistic variables and hedges
  7. Fuzzy IF-THEN rules and approximate reasoning
  8. Mamdani inference and defuzzification methods
  9. Takagi-Sugeno inference
  10. Fuzzy controller design; comparison with PID
  11. Fuzzy clustering: fuzzy c-means
  12. Neuro-fuzzy systems: ANFIS

Skills you will gain

building fuzzy systems with scikit-fuzzyMATLAB Fuzzy Logic Toolboxchoosing and tuning membership functionswriting and testing a rule basesimulating closed-loop controltuning rules from data with ANFIS

A typical semester; the order and coverage vary between universities.

Try It

Fuzzy Rules Run the Air Conditioner

The air conditioner follows verbal rules such as "if it is hot and humid, run the fan fast". Change temperature and humidity; watch how strongly each rule fires and the resulting fan speed.

Expert knowledge was written as verbal rules; fuzzy logic fires each rule partially, aggregates the outputs and turns them into one number with the centroid. No mathematical model is needed.

Context

Prerequisites

Courses worth knowing before this one, and why they are needed.

CourseWhy it is needed
Artificial Intelligenceapproximate reasoning
Discrete Mathematicssets, relations and propositional logic
Programmingwriting functions and building simple simulations
Control Systemsfeedback and the PID controller

Context

Are You Ready for This Course?

Ask yourself; for every "no", the right-hand column shows where to start.

Ask yourselfIf not, start with
Can you explain union, intersection and complement of sets?Sets and propositional logic from discrete mathematics
Can you compute the area under a piecewise-defined function?Integrals and the centroid from calculus
Can you explain a feedback loop and what a PID controller does?An intro to control systems: feedback and PID
Can you write Python functions and step through a simple simulation?An intro programming course, then a short NumPy tutorial
If you can say "yes" to most of these, you are ready; one or two gaps can be closed during the semester.

Context

Neighbouring Courses

subfieldbuilds onshares methodsapplication

Overlap

Overlapping Courses

RelationCourseShared ground
subfieldThis course is a subfield of Artificial Intelligenceapproximate reasoning
shares methodsShares methods with Expert Systems and Knowledge RepresentationIF-THEN rule base, inference engine
shares methodsShares methods with Robotics and Robot Visionfuzzy controllers

Differences

Where It Differs (1/2)

CriterionFuzzy LogicProbability & StatisticsExpert Systems
Core questionHow do we reason with concepts like "hot" or "fast" that have no sharp boundary?How is uncertainty measured, and how do we draw reliable conclusions from limited data?How is an expert's knowledge written down and used for inference?
Approachpartial membership and linguistic rulesprobability models and inferencesymbolic logic and rules
Inputmeasurements, expert rulessample datafacts and expert rules
Outputcontrol signal or decisionestimate, confidence interval, test resultconclusion with justification
Success measurecontrol quality, expert agreementunbiasedness, power, significanceexpert agreement, explainability
Math loadlow-medium: set theorythe theory itselflow: propositional and predicate logic
Data needslittle; expert knowledgea samplelittle; a knowledge base
  • Probability & Statistics: Probability measures uncertainty about whether an event will happen; this course measures how far a concept applies, that is, a vague boundary.
  • Expert Systems: Expert systems mostly run rules with crisp logic; this course builds approximate reasoning where rules can be partly true.

Differences

Where It Differs (2/2)

CriterionFuzzy LogicRoboticsNeural Networks
Core questionHow do we reason with concepts like "hot" or "fast" that have no sharp boundary?How does a machine sense the physical world, know where it is and move?How do networks of simple units learn by adjusting their weights?
Approachpartial membership and linguistic rulessense-plan-act loopnetwork of simple weighted units
Inputmeasurements, expert rulessensor measurementsnumeric feature vector
Outputcontrol signal or decisionmotor commands, pathclass or numeric prediction
Success measurecontrol quality, expert agreementtask success, safetyloss and accuracy
Math loadlow-medium: set theoryhigh: transformations, controlmedium-high: derivatives, matrices
Data needslittle; expert knowledgephysical experiments and simulationmoderate
  • Robotics: Robotics covers control as a whole; this course teaches the fuzzy controller as a model-free option.
  • Neural Networks: Neural networks learn rules from data as unreadable weights; a fuzzy system's rules come from an expert and are readable.

Practice

Applications

Home appliances

Washing machines, air conditioners, rice cookers.

Transportation

Subway acceleration and braking, automatic gearboxes.

Industrial control

Kiln temperature, cement and chemical processes.

Cameras

Autofocus and image stabilization.

Decision support

Risk assessment, supplier selection.

Medicine

Approximate diagnosis from symptoms, dose advice.

Practice

Risks and Ethics

Arbitrary membership functions

Who placed the corners of a triangle, and why, is rarely documented; other shapes make the same rules decide differently.

Rule explosion

Rule count grows exponentially with inputs and terms; on combinations nobody wrote, the controller gives unforeseen outputs.

Stability without proof

A controller tuned by trial and error is seldom proven stable in closed loop, which is risky in systems such as brakes.

Subjectivity dressed as numbers

A fuzzy score in medicine or credit, presented as an exact measurement, turns an expert's bias into a scientific-looking number.

In depth: Explainable AI and AI Ethics.

Practice

Tools and Datasets

Tools and libraries

MATLAB Fuzzy Logic Toolboxscikit-fuzzyjFuzzyLogicfuzzyliteSimpful

Classic benchmark problems

Tipping problemInverted pendulumTruck backer-upperWashing machine controlWater tank levelMackey-Glass time series
Fuzzy systems are usually built from expert knowledge rather than data; data is used to fine-tune the rules in methods such as ANFIS.

Practice

Common Misconceptions

Common beliefIn fact
Fuzzy logic is imprecise, sloppy logic.Rules use vague concepts, but the computation is exact; the same input always gives the same output.
A membership degree is a probability.0.7 is the degree of being "hot", not the chance of being hot; degrees need not sum to 1.
Fuzzy logic is an old, abandoned field.It is widely used in appliances and industrial control, and its combination with neural networks continues.
A fuzzy system learns from data.A basic fuzzy system takes its rules from an expert; learning is added by hybrid methods such as ANFIS.

Next Steps

After This Course

Courses that build on or extend this one

This course is mostly an end point: it builds on the others.

Related careers

Control systems engineerEmbedded software engineerAutomation engineerDecision support analyst
Fuzzy logic shares the rule base with expert systems and control with robotics. After this course you can move to neuro-fuzzy systems to learn rules from data, or to probabilistic graphical models to handle uncertainty with probability.

Next Steps

Further Reading

  • Zadeh, "Fuzzy Sets", Information and Control 8(3), 1965.
  • Klir and Yuan, Fuzzy Sets and Fuzzy Logic: Theory and Applications, Prentice Hall, 1995.
  • Ross, Fuzzy Logic with Engineering Applications, 4th ed., Wiley, 2017.
  • Jang, Sun and Mizutani, Neuro-Fuzzy and Soft Computing, Prentice Hall, 1997.

The End

Chapter 9: Fuzzy Logic and Fuzzy Systems
← Previous chapter · Map of the field · Next chapter →
1 / 1 Sercan KÜLCÜ. All rights reserved.