Artificial Intelligence 简明教程

Artificial Intelligence - Fuzzy Logic Systems

模糊逻辑系统(FLS)根据不完整、模棱两可、扭曲或不准确(模糊)的输入生成可接受但明确的输出。

Fuzzy Logic Systems (FLS) produce acceptable but definite output in response to incomplete, ambiguous, distorted, or inaccurate (fuzzy) input.

What is Fuzzy Logic?

模糊逻辑(FL)是一种类似于人类推理的推理方法。FL 的方法模仿了人类的决策方式,其中涉及 YES 和 NO 数字值之间的所有中间可能性。

Fuzzy Logic (FL) is a method of reasoning that resembles human reasoning. The approach of FL imitates the way of decision making in humans that involves all intermediate possibilities between digital values YES and NO.

计算机可以理解的传统逻辑块获取精确的输入,并生成明确的 TRUE 或 FALSE 输出,这相当于人类的 YES 或 NO。

The conventional logic block that a computer can understand takes precise input and produces a definite output as TRUE or FALSE, which is equivalent to human’s YES or NO.

模糊逻辑的发明者 Lotfi Zadeh 观察到,与计算机不同,人类决策包括 YES 和 NO 之间的可能性范围,例如 -

The inventor of fuzzy logic, Lotfi Zadeh, observed that unlike computers, the human decision making includes a range of possibilities between YES and NO, such as −

CERTAINLY YES

POSSIBLY YES

CANNOT SAY

POSSIBLY NO

CERTAINLY NO

模糊逻辑基于输入的可能性水平来实现明确的输出。

The fuzzy logic works on the levels of possibilities of input to achieve the definite output.

Implementation

  1. It can be implemented in systems with various sizes and capabilities ranging from small micro-controllers to large, networked, workstation-based control systems.

  2. It can be implemented in hardware, software, or a combination of both.

Why Fuzzy Logic?

模糊逻辑对于商业和实际用途很有用。

Fuzzy logic is useful for commercial and practical purposes.

  1. It can control machines and consumer products.

  2. It may not give accurate reasoning, but acceptable reasoning.

  3. Fuzzy logic helps to deal with the uncertainty in engineering.

Fuzzy Logic Systems Architecture

它有四个主要部分,如下图所示 -

It has four main parts as shown −

  1. Fuzzification Module − It transforms the system inputs, which are crisp numbers, into fuzzy sets. It splits the input signal into five steps such as −

LP

x is Large Positive

MP

x is Medium Positive

S

x is Small

MN

x is Medium Negative

LN

x is Large Negative

  1. Knowledge Base − It stores IF-THEN rules provided by experts.

  2. Inference Engine − It simulates the human reasoning process by making fuzzy inference on the inputs and IF-THEN rules.

  3. Defuzzification Module − It transforms the fuzzy set obtained by the inference engine into a crisp value.

fuzzylogic system

membership functions work on 模糊变量集。

The membership functions work on fuzzy sets of variables.

Membership Function

隶属度函数可以让您量化语言术语并在图形上表示模糊集合。在论域 X 上模糊集合 A 的一个 membership function 被定义为 μA:X → [0,1]。

Membership functions allow you to quantify linguistic term and represent a fuzzy set graphically. A membership function for a fuzzy set A on the universe of discourse X is defined as μA:X → [0,1].

在这里,X 的每个元素都被映射到 0 和 1 之间的一个值。它称为 membership valuedegree of membership 。它量化元素在 X 中对模糊集合 A 的隶属程度。

Here, each element of X is mapped to a value between 0 and 1. It is called membership value or degree of membership. It quantifies the degree of membership of the element in X to the fuzzy set A.

  1. x axis represents the universe of discourse.

  2. 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 use of complex functions does not add more precision in the output.

LP, MP, S, MN,LN 的所有隶属度函数如下所示−

All membership functions for LP, MP, S, MN, and LN are shown as below −

membership functions

三角隶属度函数形状在各种其他隶属度函数形状中是最常见的,例如梯形、单例和高斯形状。

The triangular membership function shapes are most common among various other membership function shapes such as trapezoidal, singleton, and Gaussian.

在此,对 5 级模糊器的输入变化范围从 -10 伏特到 +10 伏特。因此相应的输出也发生变化。

Here, the input to 5-level fuzzifier varies from -10 volts to +10 volts. Hence the corresponding output also changes.

Example of a Fuzzy Logic System

让我们考虑一个采用 5 级模糊逻辑系统的空调系统。该系统通过比较室内温度和目标温度值来调节空调的温度。

Let us consider an air conditioning system with 5-level fuzzy logic system. This system adjusts the temperature of air conditioner by comparing the room temperature and the target temperature value.

fuzzylogic ac system

Algorithm

  1. Define linguistic Variables and terms (start)

  2. Construct membership functions for them. (start)

  3. Construct knowledge base of rules (start)

  4. Convert crisp data into fuzzy data sets using membership functions. (fuzzification)

  5. Evaluate rules in the rule base. (Inference Engine)

  6. Combine results from each rule. (Inference Engine)

  7. Convert output data into non-fuzzy values. (defuzzification)

Development

Step 1 − Define linguistic variables and terms

Step 1 − Define linguistic variables and terms

语言变量是以简单单词或句子形式输入和输出的变量。对于室温来说,冷、暖、热等是语言术语。

Linguistic variables are input and output variables in the form of simple words or sentences. For room temperature, cold, warm, hot, etc., are linguistic terms.

温度 (t) = {非常冷、冷、暖、非常暖、热}

Temperature (t) = {very-cold, cold, warm, very-warm, hot}

该集合的每个成员都是一个语言术语,并且可以覆盖整体温度值的一部分。

Every member of this set is a linguistic term and it can cover some portion of overall temperature values.

Step 2 − Construct membership functions for them

Step 2 − Construct membership functions for them

温度变量的隶属度函数如下所示 −

The membership functions of temperature variable are as shown −

membership function ac

Step3 − Construct knowledge base rules

Step3 − Construct knowledge base rules

针对空气调节系统期望提供的室温值与目标温度值创建矩阵。

Create a matrix of room temperature values versus target temperature values that an air conditioning system is expected to provide.

RoomTemp. /Target

Very_Cold

Cold

Warm

Hot

Very_Hot

Very_Cold

No_Change

Heat

Heat

Heat

Heat

Cold

Cool

No_Change

Heat

Heat

Heat

Warm

Cool

Cool

No_Change

Heat

Heat

Hot

Cool

Cool

Cool

No_Change

Heat

Very_Hot

Cool

Cool

Cool

Cool

No_Change

以 IF-THEN-ELSE 结构的形式,构建一组规则到知识库中。

Build a set of rules into the knowledge base in the form of IF-THEN-ELSE structures.

Sr. No.

Condition

Action

1

IF temperature=(Cold OR Very_Cold) AND target=Warm THEN

Heat

2

IF temperature=(Hot OR Very_Hot) AND target=Warm THEN

Cool

3

IF (temperature=Warm) AND (target=Warm) THEN

No_Change

Step 4 − Obtain fuzzy value

Step 4 − Obtain fuzzy value

模糊集运算执行规则评估。用于 OR 和 AND 的运算分别是 Max 和 Min。组合所有评估结果以形成最终结果。此结果是一个模糊值。

Fuzzy set operations perform evaluation of rules. The operations used for OR and AND are Max and Min respectively. Combine all results of evaluation to form a final result. This result is a fuzzy value.

Step 5 − Perform defuzzification

Step 5 − Perform defuzzification

然后根据输出变量的隶属度函数执行去模糊化。

Defuzzification is then performed according to membership function for output variable.

defuzzified value

Application Areas of Fuzzy Logic

模糊逻辑的关键应用领域如下 −

The key application areas of fuzzy logic are as given −

Automotive Systems

Automotive Systems

  1. Automatic Gearboxes

  2. Four-Wheel Steering

  3. Vehicle environment control

Consumer Electronic Goods

Consumer Electronic Goods

  1. Hi-Fi Systems

  2. Photocopiers

  3. Still and Video Cameras

  4. Television

Domestic Goods

Domestic Goods

  1. Microwave Ovens

  2. Refrigerators

  3. Toasters

  4. Vacuum Cleaners

  5. Washing Machines

Environment Control

Environment Control

  1. Air Conditioners/Dryers/Heaters

  2. Humidifiers

Advantages of FLSs

  1. Mathematical concepts within fuzzy reasoning are very simple.

  2. You can modify a FLS by just adding or deleting rules due to flexibility of fuzzy logic.

  3. Fuzzy logic Systems can take imprecise, distorted, noisy input information.

  4. FLSs are easy to construct and understand.

  5. Fuzzy logic is a solution to complex problems in all fields of life, including medicine, as it resembles human reasoning and decision making.

Disadvantages of FLSs

  1. There is no systematic approach to fuzzy system designing.

  2. They are understandable only when simple.

  3. They are suitable for the problems which do not need high accuracy.