Download - ftp.it.murdoch.edu.auftp.it.murdoch.edu.au/units/ICT619/Topic_notes/Topic3A Fuzzy Syste… · Web viewFuzzy logic enables reasoning using approximations but this does not imply vague

Transcript

ICT619 Intelligent SystemsTopic 3: Fuzzy Systems

PART A Introduction Applications Fuzzy sets and fuzzy logic Probability and fuzzy logic Fuzzy reasoning Design of a fuzzy controller

PART B Building fuzzy systems Advantages and limitations of fuzzy systems Case Studies

document.doc 1 ICT619 S2-05

Introduction

Most rules in real life are designed to deal with attributes and outcomes that are meant to be clearly distinguishable. Most categories of objects and properties are determined by using thresholds or hard boundaries separating distinct ranges of values, with each such range associated with any one category or property.

But in many situations it is difficult to apply such clear cut boundaries. Application of such boundaries, even if possible, quite often goes against common sense. For example, if temperatures of 26 degrees or above are regarded as warm, and those below 26 degrees as cool, this temperature classification rule makes more sense for a temperature of 17 degrees than it does for a temperature of 25 degrees. This rule dictates something for certain temperatures that goes against common sense.

It is obvious that rules of categorisation with hard boundaries are unsatisfactory as they fail to reflect the inherent imprecision of real life objects and attributes. This has led to the conclusion that imprecision can be handled more effectively if rules themselves are defined using imprecise or fuzzy boundaries. For example, a temperature of 25 degrees is warm to a much greater extent than it is cool. Expressions in everyday language often use imprecise terms such as strong, cold, very and low without actually defining exact boundaries within which they apply – simply because such definitions would require us to stipulate hard boundaries that would go against common sense.

Rules with hard boundaries are based on traditional set theory and two-valued (binary) logic where any proposition is either true or false, any element either belongs to a set or it does not. In 1965 Lotfi Zadeh of the University of California proposed an alternative “fuzzy” logic and associated fuzzy set theory, which can be used for approximate reasoning. In it, elements can belong to a set “to a degree”, giving rise to degrees of memberships, which can be any value between 0 (meaning definitely not a member) to 1 (definitely a member). Instead of being either true or false, a proposition in fuzzy logic can be both true and false to certain degrees!

Fuzzy logic and fuzzy rule based systems, which are based on fuzzy logic, provide a methodology for reasoning that can handle imprecision in rules and assertions expressed by human experts. Fuzzy logic enables reasoning using approximations but this does not imply vague or fuzzy outputs for problem solutions. The imprecisely stated inputs are transformed into precise numerical inputs that eventually produce precise numerical outputs.

Regardless of the controversy generated about the mathematical foundation of fuzzy systems, intelligent control and decision support systems based on fuzzy logic have proved their superiority over conventional hard logic based systems.

Fuzzy system applications

Fuzzy logic and systems based on it are an actively investigated topic in many fields including engineering and computer science, business and management, psychology, philosophy, and mathematics.

Fuzzy system applications may be grouped into two categories:1. Fuzzy control systems2. Fuzzy decision support systems

A control system continuously receives sensor inputs such as speed, distance, temperature, pressure etc, and utilises these to vary some output variables such as amount of electric current flowing into an electric motor or rate of fuel supply to an engine. The objective is to achieve a smoother, more effective and efficient operation, for example, a self-regulated air conditioner that maintains desirable temperature and humidity with less fluctuation and greater energy efficiency.

Fuzzy decision support systems, unlike their control system counterparts are not as time critical, and are used to make recommendations to aid decision making, usually in a business environment.

document.doc 2 ICT619 S2-05

Probably the most renowned fuzzy system in use today is the subway in the Japanese city of Sendai. Since 1987, a fuzzy control system has been in operation to keep the trains running safely, smoothly and more efficiently than possible under manual control.

Fuzzy control systems have appeared in numerous products such as domestic appliances and motor cars manufactured by the Japanese. Matsushita’s fuzzy vacuum cleaner, washing machine and camcorders are examples of such appliances.

Mitsubishi designed a fuzzy control system for lifts, improving their efficiency at handling crowds all wanting to be in the lift at the same time. Nissan uses fuzzy automatic transmission and fuzzy antilock brakes in its cars. Sony’s fuzzy TV set automatically adjusts sharpness, contrast, brightness and colour.

Fuzzy intelligent systems in businessAlthough it is relatively early days, fuzzy logic, in the form of fuzzy expert systems, is proving to be a powerful tool in business knowledge based systems and decision support. Fuzzy ES have been successfully applied to large real world applications in

Transportation Managed health care Financial services such as insurance risk assessment and company stability analysis Product marketing and sales analysis Extraction of information from databases (data mining) Resource and project management

In general, intelligent systems based on fuzzy logic are less complex, smaller, easier to build, implement, maintain and extend than similar systems built using conventional expert systems.

Fuzzy sets and fuzzy logic

Fuzzy sets In classical logic, the boundary between what is in a set and what is outside is sharp. For example, all people earning $75,000 or higher may belong to (be a member of) the set high-income earner. Anyone earning less than $75,000 is not in the set high-income earner, even if that person earns $74,900! Because of the sharpness of the set boundary, such sets are known as crisp sets.

The nature of the membership graph for a crisp set is illustrated using the above example in the diagram below.

As the domain (in this case income) value increases, the degree of membership in the set high-income earner remains false (zero), but suddenly jumps to 1 (true) as income reaches $75000.

For a fuzzy set, the membership value lies within the range zero (no membership) to 1 (complete membership). For example, the membership graph of the fuzzy set high-income earner may have the shape shown below. According to this membership function, someone earning $30,000 will have a membership value of 0.1, and an earning of $74,900 will give a membership value of 0.998. All

document.doc 3 ICT619 S2-05

High-income earner

$25K

1

Degree of membership

$50K $75K0

High-income earner

$25K

1

Degree of membership (membership value)

$50K $75K0

incomes at or below $25,000 have the membership value zero and all those at or above $75,000 have membership value 1.

The diagram below shows the membership functions of two example fuzzy sets warm and hot. These two membership functions are bell-shaped, Depending on the application, fuzzy set membership functions can have different shapes including S-shape, triangle, trapezoid and so on.

By allowing continuous valued degrees of membership, fuzzy sets enable the handling of imprecise concepts such as high, weak, warm and medium, which are commonly encountered in real life problems.

Fuzzy logic and probability

There has been a lot of discussion about the nature of fuzzy logic ever since it appeared in the 70s. Many are quite dismissive about fuzzy logic and regard it as just a form of probability. They are also sceptical about the soundness of its basis and its reliability – and the term “fuzzy” has not helped in this regard. But as outlined below, despite their apparent similarity, there is an important difference between the two paradigms.

Both fuzzy logic and probability deal with the issue of uncertainty. Both use a continuous 0 to 1 scale for measuring uncertainty, but with a fundamental difference.

Probability deals with likelihood – the chance of something happening or something having a certain property. Fuzzy logic deals not with likelihood of something having a certain property, but the degree to which it has that property. For example, if we toss a coin, probability attempts to predict the likelihood of it landing with the head or tail face up. Once the coin has landed, there is nothing ambiguous about the outcome of the tossing event – probability is no longer applicable, nor necessary.

document.doc 4 ICT619 S2-05

Degree of membership (membership value)

High-income earner

$25K

1

$50K $75K0

Warm1

Degrees centigrade

0

Degree of membership

10 15 20 25 30 35 40 45

Hot

If on the other hand, we had a badly defaced coin, there would be uncertainty as to whether a face is actually the head or the tail. It is in this situation that fuzzy logic plays its role by stating the degree to which the face in question might be the head or tail. In other words, fuzzy logic concerns not the likelihood of the event (head or tail), but the degree to which the event has happened.

Fuzzy set theory and fuzzy logic provide a mathematical tool for handling uncertainty as described above. Despite the controversy it has generated, there is certainly no fuzziness about its usefulness as a powerful tool for solving problems.

Fuzzy reasoning

The fuzzy model of a problem consists of a series of unconditional and conditional fuzzy propositions. These are similar in form to those in conventional expert systems. An unconditional fuzzy proposition has the form

x is Ywhere x is a linguistic variable1 and Y is the name of a fuzzy set. x is called a linguistic variable because its value in the proposition is expressed by a human expert using a word (linguistic expression) rather than a number. For example,

salary is high

During the reasoning process, the truth value of this proposition is given by the degree of membership of salary in the fuzzy set high. This membership value is computed from the actual case-specific numeric value with which salary is instantiated, and the fuzzy membership function high.

A fuzzy conditional proposition or rule has the formIF w is Z THEN x is Y

It is interpreted as: x is a member of Y to the degree that w is a member of Z. In other words, the consequent (RHS) of the rule is applied or executed only to the extent that the antecedent (LHS) is true. For example in the rule

IF years_in_job is high THEN salary is highthe membership value of salary in the fuzzy set high is determined by the membership value of years_in_job in set high. So for example, if the antecedent has a truth value of 0.5, the strength of the consequent will also be 0.5, and the fuzzy region2 for the set high for salary will be truncated to level 0.5.

In reasoning using fuzzy logic, a number of fuzzy propositions is evaluated for their degrees of truth, and all those having some truth contribute to the final output state of the solution variable.

Unlike conventional expert systems, where statements are executed serially, fuzzy logic systems are based on the parallel processing principle. In other words, all rules are fired even if not all of them contribute to the final outcome and some may contribute only partially. For example, in determining the value of the solution variable salary in the above example, the contribution of the rule

IF years_in_job is high THEN salary is highto making it high will be to a degree of 0.5.

A number of other rules may also contribute to varying degrees to the truth value of a high salary. All these truth values, represented visually by corresponding fuzzy regions, are combined to give the aggregate truth value for high salary (see min-max rule below about how these truth values combined).

Continuing with the salary example, there will also be other rules which will be fired to give truth values for propositions salary is medium and salary is low. The ultimate solution value of the variable salary is determined once again through a combination process, this time aggregating the fuzzy spaces for high, medium and low salary.

The numerical output value for a solution variable is computed from the aggregated fuzzy output region through a process known as defuzzification. It is worth noting that although the reasoning

1 “A variable whose values are words or sentences in a natural or artificial language” - Zadeh2 The fuzzy region of a set is the area covered by its membership graph.

document.doc 5 ICT619 S2-05

process is carried out using fuzzy rules and inferencing, the values input by the user and that produced by the fuzzy system are non-fuzzy numerical values. The input values are fuzzified (converted into various fuzzy set membership values) to allow fuzzy reasoning, and then the resulting fuzzy (set membership) values are transformed into exact numerical values to make them applicable to the problem at hand. Min-max rule

Fuzzy rules of inference are used to combine the fuzzy regions produced by the application of many rules run in parallel. The most common rule for this purpose is known as the min-max rule.

Min-max rules of implicationThe consequent region of a fuzzy rule is restricted to the antecedent (LHS) truth or membership value. Given the fuzzy rule

IF a is X THEN b is Y If the membership value of a in X is 0.5, then the degree of truth of the consequent (membership value of b in Y) will be 0.5.

When the LHS of the rule consists of a number of fuzzy propositions, the composite membership value of the LHS is the minimum of the memberships of all of the propositions on the LHS. This minimum truth value from the LHS is applied to that of the consequent (RHS). As an example, given the rule

IF a is X AND b is Y THEN c is Z

If the membership value of a in X is 0.5, and that of b in Y is 0.2, the degree of truth of the consequent (membership value of c in Z) will be 0.2.

If a number of rules lead to different membership values for an output variable, the maximum of these values is taken as the membership value. For example, given a number of rules producing different truth values T1, T2, .., Tn for the membership of c in Z, the aggregated truth value is maximum(T1, T2, .., Tn ).

For example if application of the following rules lead to differing membership values (shown in parentheses) for the output variable risk in the fuzzy set medium:

IF age is middle THEN risk is medium (0.3)IF asset is medium THEN risk is medium (0.2)IF credit_history is reasonable THEN risk is medium (0.8)

Then, variable risk will have a membership value of max(0.3, 0.2, 0.8) or 0.8 in medium.

In this particular case, the person whose risk is being evaluated is probably either a young or an old person (age membership value in middle is only 0.3), with an asset which is either rather large or rather small (asset membership value in medium is only 0.2), and a reasonable credit record (credit_history membership value in reasonable is 0.8).

Defuzzification

With the application of a host of similar rules for the person in the above example, the membership values for his/her risk in the small and high sets will also be similarly evaluated using the min-max rules. Suppose these values are 0.4 for small, 0.8 for medium, and 0.2 for high. These membership values will truncate the fuzzy spaces for the sets small, medium and high. These fuzzy regions are combined to give the aggregated fuzzy space for the output variable risk as shown below.

document.doc 6 ICT619 S2-05

Degree of membership SMALL

0.4

1MEDIUM

0.8

HIGH0.2

Risk

Defuzzification is the process of taking the aggregated fuzzy region for the output variable – in this case risk, and assigning an exact numerical value to it. There are a number of methods of doing this, and the most common one among them is known as the clipped centroid or centre of gravity method.

The centre of gravity is simply the weighted average of the output membership function. The result R is calculated using the formula

Where di is the ith domain value, m(di) is the membership value for that domain point. In this example, the domain in question is that of the variable risk, with i in the range 0 … 100. The diagram below illustrates the centroid method of defuzzification.

The operation of a fuzzy system is shown in the schematic diagram below.

Who decides fuzzy set membership functions

It is worth noting that the assignment of a fuzzy set membership value to a linguistic variable depends on the corresponding fuzzy set membership function, and fuzzy systems do not provide a formal

document.doc 7 ICT619 S2-05

Percentage of risk

Degree of membershipm(x)

0 10 20 30 40 50 60 70 80 90 100

0

1Risk

Numeric input

Fuzzification Fuzzy membership values

Fuzzy reasoning

DefuzzifyNumeric output

Aggregated fuzzy region

0

procedure for designing these functions. Rather, the fuzzy sets are defined using practical experience and intuition. What fuzzy logic does is to provide a methodology for dealing with these variables and fuzzy sets once the primitives have been established.

Design of a fuzzy controller

The actions of a fuzzy controller are defined by a rule base. There are five steps in the construction of this rule base:

1. Identify and list the input variables and their ranges,2. Identify and list the output variables and their ranges,3. Define a fuzzy membership function for each of the input and output variable,4. Construct the rule base that will govern the controller’s operation,5. Determine how the control actions will be combined to form the executed action.

The above steps are illustrated with a simplified example problem below.

The controller is to be used to smoothly slow and stop a train that is travelling at any speed and is at any distance from the station.

Step 1: Identify and list the linguistic input variables and their rangesThere are two input variables: train speed and distance to station. There are five ranges each of speed (km/hr) and distance (m):

SPEED

Range of linguistic values: Low HighFast 40 120Medium Fast 10 50Slow 2 15Very Slow 0 4Stopped 0 0

DISTANCE

Range of linguistic values: Low HighFar 2,000 ∞Medium Far 100 3,000Near 5 200Very Near 0 10At 0 1.5

Step 2: Identify and list the linguistic output variables and their numeric rangesThere are two input variables: train throttle and train brake. There are five ranges each of train throttle (%) and brake (%):

THROTTLE

Range of linguistic values: Low HighFull 80% 100%Medium 25% 85%Slight 5% 30%Very Slight 0 7%No 0 0

document.doc 8 ICT619 S2-05

BRAKE

Range of linguistic values: Low HighFull 80% 100%Medium 25% 85%Slight 5% 30%Very Slight 0 7%No 0 0

Step 3: Define a set of fuzzy membership functions for each of the input and output variablesThe low and high values are used to define trapezoidal membership functions for each of the input ranges. The height of each function is 1.0 and the function bounds do not exceed the high and low ranges listed for each range.

document.doc 9 ICT619 S2-05

Step 4: Construct the rule base that will govern the controller’s operationA rule base is represented as a matrix of combinations of each of the input range variable. At each matrix position is each of the two output range variables related to the input variables. The rule base matrix for this simple example problem has only 12 rules that describe the interaction between input and output variables. Each entry in the rule base is defined by AND-ing together the inputs to produce each individual output response. As an example, the shaded matrix entry above means

IF speed is stopped AND IF distance is at THEN full brake

IF speed is stopped AND IF distance is at THEN no throttle

Step 5: Determine how the control actions will be combined to form the executed action at the action interface

The rule combination procedure used in this example is the centroid defuzzification described already. Consider the inputs:

speed = 2 km/hrdistance = 1 m.

The first task is to determine which membership functions are activated and to what degree. Four membership functions are activated: the distance functions for AT and Very Near and the speed functions for Very Slow and Slow. The membership of the speed of 2 km/hr in the fuzzy set for Very Slow is 1.0 and the membership of the speed of 2 km/hr in the fuzzy set for Slow is 0.2. Mathematically, they are denoted as

MVery Slow(2) = 1.0,MSlow(2) = 0.2.

document.doc 10 ICT619 S2-05

Similarly, the membership valus for the distance of 1 m in the fuzzy set for At and Very Near are:

MVery Near(1) = 0.4,MAt(1) = 0.8.

This results in four rules firing in the rule base matrix as shown in figure below (the rule numbers are shown in the lower right corner of the matrix entry):

Next, the membership values are combined together using the AND (min) operator for each rule combination:

Rule 1: MVery Slow AND MAt = min(1.0, 0.8) = 0.8,

Rule 2: MSlow AND MAt = min(0.2, 0.8) = 0.2,

Rule 3: MVery Slow AND MVery Near = min(1.0, 0.4) = 0.4,

Rule 3: MSlow AND MVery Near = min(0.2, 0.4) = 0.2.

The values 0.8, 0.2, 0.4 and 0.2 are the firing strengths of rules 1 to 4, respectively, for the input (2,1).

Next the output value for each rule is determined by truncating the corresponding output membership function using its firing strength. The resulting aggregated fuzzy output region for the rules for variable brake is shown in figure below.

document.doc 11 ICT619 S2-05

Finally, defuzzification using the centroid method yields an output value of 78 percent application of the brake.

Fuzzy Controller Operation

During operation, input values are continually sampled and presented to the fuzzy controller. The fuzzy controller then repeats the process described above in Step 5:

Determine the fuzzy membership values activated by the inputs

Determine which rules are activated (fired) in the rule base matrix

Combine the membership values for the activated rules using the AND operator

Determine the aggregated fuzzy region for each output variable

Use defuzzification to compute the values for each output variable.

document.doc 12 ICT619 S2-05

REFERENCES

Cox, E., The Fuzzy Systems Handbook, AP Professional, San Diego 1999. Dhar, V., & Stein, R., Seven Methods for Transforming Corporate Data into Business

Intelligence., Prentice Hall 1997, pp. 126-148, 203-210. Mcneill, F., & Thro, E., Fuzzy Logic a Practical Approach, AP Professional, Boston 1994. Medsker,L., Hybrid Intelligent Systems, Kluwer Academic Press, Boston 1995. Negnevitsky, M. Artificial Intelligence A Guide to Intelligent Systems, Addison-Wesley 2005. Sangalli, A., The Importance of being Fuzzy, Princeton University Press, 1998. Zahedi, F., Intelligent Systems for Business, Wadsworth Publishing, Belmont, California,

1993.

document.doc 13 ICT619 S2-05