You are on page 1of 70

Fuzzy system is an alternative to traditional notions of set membership and logic that has its origins in ancient Greek

philosophy, and applications at the leading edge of Artificial Intelligence. Yet, despite its long-standing origins, it is a relatively new field, and as such leaves much room for development. This lesson will present the foundations of fuzzy systems, along with some of the more noteworthy objections to its use, with examples drawn from current research in the field of Artificial Intelligence. Ultimately, it will be demonstrated that the use of fuzzy systems makes a viable addition to the field of Artificial Intelligence, and perhaps more generally to formal mathematics as a whole.

Fuzzy systems, including fuzzy logic and fuzzy set theory, provide a rich and meaningful addition to standard logic. The mathematics generated by these theories is consistent, and fuzzy logic may be a generalization of classic logic. The applications which may be generated from or adapted to fuzzy logic are wide-ranging, and provide the opportunity for modelling of conditions which are inherently imprecisely defined, despite the concerns of classical logicians. Many systems may be modelled, simulated, and even replicated with the help of fuzzy systems, not the least of which is human reasoning itself.

This term paper titled Fuzzy Logic is based on the Current Development on Fuzzy Logic and has been produced for educational and research purpose from the public domain information. Any commercial reproduction is not solicited.

Fuzzy Logic | Page - 1

Contents
The Problem: Real-World Vagueness Historic Fuzziness Basic Concepts Objections Applications The Fuzzy Logic Explained Introduction to Fuzzy Control Building a Fuzzy Controller Fuzzy Rules Fuzzy Database in a Nutshell Fuzzy Sets Revisited Fuzzy Numbers Fuzzy Image Processing Fuzzy Geometry Fuzzy Grammars Membership Functions Fuzzy Subsets Logic Operations Possibility Theory Biblical References Page - 03 Page - 04 Page - 05 Page - 09 Page - 10 Page - 12 Page - 16 Page - 26 Page - 33 Page - 39 Page - 42 Page - 48 Page - 50 Page - 52 Page - 53 Page - 55 Page - 61 Page - 63 Page - 65 Page - 69

Fuzzy Logic | Page - 2

The Problem: Real-World Vagueness


Natural language abounds with vague and imprecise concepts, such as Sally is tall, or It is very hot today. Such statements are difficult to translate into more precise language without losing some of their semantic value: for example, the statement Sallys height is 152 cm. does not explicitly state that she is tall, and the statement Sallys height is 1.2 standard deviations about the mean height for women of her age in her culture is fraught with difficulties: would a woman 1.1999999 standard deviations above the mean be tall? Which culture does Sally belong to, and how is membership in it defined? While it might be argued that such vagueness is an obstacle to clarity of meaning, only the most staunch traditionalists would hold that there is no loss of richness of meaning when statements such as Sally is tall are discarded from a language. Yet this is just what happens when one tries to translate human language into classic logic. Such a loss is not noticed in the development of a payroll program, perhaps, but when one wants to allow for natural language queries, or knowledge representation in expert systems, the meanings lost are often those being searched for. For example, when one is designing an expert system to mimic the diagnostic powers of a physician, one of the major tasks is to codify the physicians decision-making process. The designer soon learns that the physicians view of the world, despite her dependence upon precise, scientific tests and measurements, incorporates evaluations of symptoms, and relationships between them, in a fuzzy, intuitive manner: deciding how much of a particular medication to administer will have as much to do with the physicians sense of the relative strength of the patients symptoms as it will their height/weight ratio. While some of the decisions and calculations could be done using traditional logic, we will see how fuzzy systems affords a broader, richer field of data and the manipulation of that data than do more traditional methods.

Fuzzy Logic | Page - 3

Historic Fuzziness
The precision of mathematics owes its success in large part to the efforts of Aristotle and the philosophers who preceded him. In their efforts to devise a concise theory of logic, and later mathematics, the so-called Laws of Thought were posited. One of these, the Law of the Excluded Middle, states that every proposition must either be True or False. Even when Parmenides proposed the first version of this law (around 400 B.C.) there were strong and immediate objections: for example, Heraclitus proposed that things could be simultaneously True and not True. It was Plato who laid the foundation for what would become fuzzy logic, indicating that there was a third region (beyond True and False) where these opposites tumbled about. Other, more modern philosophers echoed his sentiments, notably Hegel, Marx, and Engels. But it was Lukasiewicz who first proposed a systematic alternative to the bi-valued logic of Aristotle In the early 1900s, Lukasiewicz described a three-valued logic, along with the mathematics to accompany it. The third value he proposed can best be translated as the term possible, and he assigned it a numeric value between True and False. Eventually, he proposed an entire notation and axiomatic system from which he hoped to derive modern mathematics. Later, he explored four-valued logics, five-valued logics, and then declared that in principle there was nothing to prevent the derivation of an infinite-valued logic. Lukasiewicz felt that three- and infinite-valued logics were the most intriguing, but he ultimately settled on a four-valued logic because it seemed to be the most easily adaptable to Aristotelian logic. Knuth proposed a three-valued logic similar to Lukasiewiczs, from which he speculated that mathematics would become even more elegant than in traditional bi-valued logic. His insight, apparently missed by Lukasiewicz, was to use the integral range [-1, 0 +1] rather than [0, 1, 2]. Nonetheless, this alternative failed to gain acceptance, and has passed into relative obscurity. It was not until relatively recently that the notion of an infinite valued logic took hold. In 1965 Lotfi A. Zadeh published his seminal work Fuzzy Sets which described the mathematics of fuzzy set theory, and by extension fuzzy logic. This theory proposed making the membership function (or the values False and True) operate over the range of real numbers [0.0, 1.0]. New operations for the calculus of logic were proposed, and showed to be in principle at least a generalization of classic logic. It is this theory which we will now discuss.
Fuzzy Logic | Page - 4

Basic Concepts
The notion central to fuzzy systems is that truth values (in fuzzy logic) or membership values (in fuzzy sets) are indicated by a value on the range [0.0, 1.0], with 0.0 representing absolute Falseness and 1.0 representing absolute Truth. For example, let us take the statement: Jane is old.

At this juncture it is important to point out the distinction between fuzzy systems and probability. Both operate over the same numeric range, and at first glance both have similar values: 0.0 representing False (or non-membership), and 1.0 representing True (or membership). However, there is a distinction to be made between the two statements: The probabilistic approach yields the natural-language statement, There is an 80% chance that Jane is old, while the fuzzy terminology corresponds to Janes degree of membership within the set of old people is 0.80. The semantic difference is significant: the first view supposes that Jane is or is not old (still caught in the Law of the Excluded Middle); it is just that we only have an 80% chance of knowing which set she is in. By contrast, fuzzy terminology supposes that Jane is more or less old, or some other term corresponding to the value of 0.80. Further distinctions arising out of the operations will be noted below.

The next step in establishing a complete system of fuzzy logic is to define the operations of EMPTY, EQUAL, COMPLEMENT (NOT), CONTAINMENT, UNION (OR), and INTERSECTION (AND). Before we can do this rigorously, we must state some formal definitions:

Definition 1: Let X be some set of objects, with elements noted as x. Thus, X = {x}.

Definition 2: A fuzzy set A in X is characterized by a membership function mA(x) which maps each point in X onto the real interval [0.0, 1.0]. As mA(x) approaches 1.0, the grade of membership of x in A increases.

Definition 3: A is EMPTY iff for all x, mA(x) = 0.0.


Fuzzy Logic | Page - 5

Definition 4: A = B iff for all x: mA(x) = mB(x) [or, mA =mB].

Definition 5: mA = 1 - mA.

Definition 6: A is CONTAINED in B iff mA <= mB.

Definition 7: C = A UNION B, where: mC(x) = MAX(mA(x), mB(x)).

Definition 8: C = A INTERSECTION B where: mC(x) = MIN(mA(x), mB(x)).

It is important to note the last two operations, UNION (OR) and INTERSECTION (AND), which represent the clearest point of departure from a probabilistic theory for sets to fuzzy sets. Operationally, the differences are as follows: For independent events, the probabilistic operation for AND is multiplication, which (it can be argued) is counterintuitive for fuzzy systems. For example, let us presume that x = Bob, S is the fuzzy set of smart people, and T is the fuzzy set of tall people. Then, if mS(x) = 0.90 and uT(x) = 0.90, the probabilistic result would be:
mS(x) * mT(x) = 0.81 whereas the fuzzy result would be: MIN(uS(x), uT(x)) = 0.90 .

The probabilistic calculation yields a result that is lower than either of the two initial values, which when viewed as the chance of knowing makes good sense. However, in fuzzy terms the two membership functions would read something like Bob is very smart and Bob is very tall. If we presume for the sake of argument that very is a stronger term than quite, and that we would correlate quite with the value 0.81, then the semantic difference becomes obvious. The probabilistic calculation would yield the statement If Bob is very smart, and Bob is very tall, then Bob is a quite tall, smart person. The fuzzy calculation, however, would yield If Bob is very smart, and Bob is very tall, then Bob is a very tall, smart person. Another problem arises as we incorporate more factors into our equations (such as the fuzzy set of heavy people, etc.). We find that the ultimate result of a series of ANDs approaches 0.0, even if all factors are initially high. Fuzzy theorists argue that this is wrong: that five factors of the value 0.90 (let us say, very) ANDed together, should yield a value
Fuzzy Logic | Page - 6

of 0.90 (again, very), not 0.59 (perhaps equivalent to somewhat). Similarly, the probabilistic version of A OR B is (A+B - A*B), which approaches 1.0 as additional factors are considered. Fuzzy theorists argue that a sting of low membership grades should not produce a high membership grade instead, the limit of the resulting membership grade should be the strongest membership value in the collection. Other values have been established by other authors, as have other operations. Baldwin [1] proposes a set of truth value restrictions, such as unrestricted (mX = 1.0), impossible (mX = 0.0), etc.

The skeptical observer will note that the assignment of values to linguistic meanings (such as 0.90 to very) and vice versa, is a most imprecise operation. Fuzzy systems, it should be noted, lay no claim to establishing a formal procedure for assignments at this level; in fact, the only argument for a particular assignment is its intuitive strength. What fuzzy logic does propose is to establish a formal method of operating on these values, once the primitives have been established.

Hedges
Another important feature of fuzzy systems is the ability to define hedges, or modifier of fuzzy values. These operations are provided in an effort to maintain close ties to natural language, and to allow for the generation of fuzzy statements through mathematical calculations. As such, the initial definition of hedges and operations upon them will be quite a subjective process and may vary from one project to another. Nonetheless, the system ultimately derived operates with the same formality as classic logic. The simplest example is in which one transforms the statement Jane is old to Jane is very old. The hedge very is usually defined as follows: mveryA(x) = mA(x)^2

Thus, if mOLD(Jane) = 0.8, then mVERYOLD(Jane) = 0.64. Other common hedges are more or less [typically SQRT(mA(x))], somewhat, rather, sort of, and so on.
Fuzzy Logic | Page - 7

Again, their definition is entirely subjective, but their operation is consistent: they serve to transform membership/truth values in a systematic manner according to standard mathematical functions.

A more involved approach to hedges is best shown through the work of Wenstop in his attempt to model organizational behavior. For his study, he constructed arrays of values for various terms, either as vectors or matrices. Each term and hedge was represented as a 7element vector or 7x7 matrix. He ten intuitively assigned each element of every vector and matrix a value between 0.0 and 1.0, inclusive, in what he hoped was intuitively a consistent manner. For example, the term high was assigned the vector 0.0 0.0 0.1 0.3 0.7 1.0 1.0 and low was set equal to the reverse of high, or 1.0 1.0 0.7 0.3 0.1 0.0 0.0 Wenstop was then able to combine groupings of fuzzy statements to create new fuzzy statements, using the APL function of Max-Min matrix multiplication. These values were then translated back into natural language statements, so as to allow fuzzy statements as both input to and output from his simulator. For example, when the program was asked to generate a label lower than sort of low, it returned very low; (slightly higher) than low yielded rather low, etc.

The point of this example is to note that algorithmic procedures can be devised which translate fuzzy terminology into numeric values, perform reliable operations upon those values, and then return natural language statements in a reliable manner. Similar techniques have been adopted by others, primarily in the study of fuzzy systems as applicable to linguistic approximation. APL appears to be the language of choice, owing to its flexibility and power in matrix operations.

Fuzzy Logic | Page - 8

Objections
It would be remarkable if a theory as far-reaching as fuzzy systems did not arouse some objections in the professional community. While there have been generic complaints about the fuzziness of the process of assigning values to linguistic terms, perhaps the most cogent criticisms come from Haack A formal logician, Haack argues that there are only two areas in which fuzzy logic could possibly be demonstrated to be needed, and then maintains that in each case it can be shown that fuzzy logic is not necessary.

The first area Haack defines is that of the nature of Truth and Falsity: if it could be shown, she maintains, that these are fuzzy values and not discrete ones, then a need for fuzzy logic would have been demonstrated. The other area she identifies is that of fuzzy systems utility: if it could be demonstrated that generalizing classic logic to encompass fuzzy logic would aid in calculations of a given sort, then again a need for fuzzy logic would exist. In regards to the first statement, Haack argues that True and False are discrete terms. For example, The sky is blue is either true or false; any fuzziness to the statement arises from an imprecise definition of terms, not out of the nature of Truth.

As far as fuzzy systems utility is concerned, she maintains that no area of data manipulation is made easier through the introduction of fuzzy calculus; if anything, she says, the calculations become more complex. Therefore, she asserts, fuzzy logic is unnecessary. Fox has responded to her objections, indicating that there are three areas in which fuzzy logic can be of benefit: as a requisite apparatus (to describe real-world relationships which are inherently fuzzy); as a prescriptive apparatus (because some data is fuzzy, and therefore requires a fuzzy calculus); and as a descriptive apparatus (because some inferencing systems are inherently fuzzy).

His most powerful arguments come, however, from the notion that fuzzy and classic logics need not be seen as competitive, but complementary. He argues that many of Haacks objections stem from a lack of semantic clarity, and that ultimately fuzzy statements may be translatable into phrases which classical logicians would find palatable.

Fuzzy Logic | Page - 9

Lastly, Fox argues that despite the objections of classical logicians, fuzzy logic has found its way into the world of practical applications, and has proved very successful there. He maintains, pragmatically, that this is sufficient reason for continuing to develop the field.

Applications

Areas in which fuzzy logic has been successfully applied are often quite concrete. The first major commercial application was in the area of cement kiln control, an operation which requires that an operator monitor four internal states of the kiln, control four sets of operations, and dynamically manage 40 or 50 rules of thumb about their interrelationships, all with the goal of controlling a highly complex set of chemical interactions. One such rule is If the oxygen percentage is rather high and the free-lime and kiln-drive torque rate is normal, decrease the flow of gas and slightly reduce the fuel rate (see Zadeh). A complete accounting of this very successful system can be found in Umbers and King.

The objection has been raised that utilizing fuzzy systems in a dynamic control environment raises the likelihood of encountering difficult stability problems: since in control conditions the use of fuzzy systems can roughly correspond to using thresholds, there must be significant care taken to insure that oscillations do not develop in the dead spaces between threshold triggers. This seems to be an important area for future research.

Other applications which have benefited through the use of fuzzy systems theory have been information retrieval systems, a navigation system for automatic cars, a predicative fuzzy-logic controller for automatic operation of trains, laboratory water level controllers, controllers for robot arc-welders, feature definition controllers for robot vision, graphics controllers for automated police sketchers, and more.

Expert systems have been the most obvious recipients of the benefits of fuzzy logic, since their domain is often inherently fuzzy. Examples of expert systems with fuzzy logic
Fuzzy Logic | Page - 10

central to their control are decision-support systems, financial planners, diagnostic systems for determining soybean pathology, and a meteorological expert system in China for determining areas in which to establish rubber tree orchards. Another area of application, akin to expert systems, is that of information retrieval.

Fuzzy Logic | Page - 11

The Fuzzy Logic Explained

Fig: Fuzzy Definition of Small vs Non-Fuzzy Definition of Small

Fuzzy logic has rapidly become one of the most successful of todays technologies for developing sophisticated control systems. The reason for which is very simple. Fuzzy logic addresses such applications perfectly as it resembles human decision making with an ability to generate precise solutions from certain or approximate information. It fills an important gap in engineering design methods left vacant by purely mathematical approaches (e.g. linear control design), and purely logic-based approaches (e.g. expert systems) in system design. While other approaches require accurate equations to model realworld behaviors, fuzzy design can accommodate the ambiguities of real-world human language and logic. It provides both an intuitive method for describing systems in human terms and automates the conversion of those system specifications into effective models.

Fuzzy Logic | Page - 12

What does Fuzzy Logic offer?


The first applications of fuzzy theory were primarily industrial, such as process control for cement kilns. However, as the technology was further embraced, fuzzy logic was used in more useful applications. In 1987, the first fuzzy logic-controlled subway was opened in Sendai in northern Japan. Here, fuzzylogic controllers make subway journeys more comfortable with smooth braking and acceleration. Best of all, all the driver has to do is push the start button! Fuzzy logic was also put to work in elevators to reduce waiting time. Since then, the applications of Fuzzy Logic technology have virtually exploded, affecting things we use every day. Take for example, the fuzzy washing machine . A load of clothes in it and press start, and the machine begins to churn, automatically choosing the best cycle. The fuzzy microwave, Place chili, potatoes, or etc in a fuzzy microwave and push single button, and it cooks for the right time at the proper temperature. The fuzzy car, maneuvers itself by following simple verbal instructions from its driver. It can even stop itself when there is an obstacle immediately ahead using sensors. But, practically the most exciting thing about it, is the simplicity involved in operating it.

Background
Ancient Greece
The success of modern mathematics is largely due to the efforts of Aristotle and the philosophers who preceded him. In their efforts to devise a concise theory of logic, and later mathematics, the so-called Laws of Thought were invented. One of these, the Law of the Excluded Middle, stated that every proposition must either be True or False, A or not-A, either this or not this. For example, a typical rose is either red or not red.

It cannot be red and not red. Every statement or sentence is true or false or has the truth value 1 or 0. Even then, there already were strong and immediate objections to this proposal. In fact, almost two centuries earlier, Buddha saw the world filled with contradictions, that things could be a certain degree true and a certain degree false at the same

Fuzzy Logic | Page - 13

time. However, it was Plato who laid the foundation for what would become fuzzy logic, indicating that there was a third region (beyond True and False) where these opposites tumbled about.

The world is getting fuzzier


In the early 1900s, Lukasiewicz came and proposed a systematic alternative to the bivalued logic( bivalence) of Aristotle. He described a three-valued logic, which can best be translated as the term possible, and assigned it a numeric value between True and False. Knuth, a former student of Lukasiewicz proposed a three-valued logic apparently missed by Lukasiewicz, whiched used an integral range [-1, 0 +1] rather than [0, 1, 2]. Nonetheless, this alternative failed to gain acceptance, and has passed into relative obscurity.

Its Heeere
It was not until relatively recently that the theory of fuzzy logic was discovered. Lotfi A. Zadeh, a professor of UC Berkeley in California, soon to be known as the founder of fuzzy logic observed that conventional computer logic was incapable of manipulating data representing subjective or vague human ideas such as an attractive person or pretty hot. Fuzzy logic, hence was designed to allow computers to determine the distinctions among data with shades of gray, similar to the process of human reasoning. In 1965, Zadeh published his seminal work Fuzzy Sets which described the mathematics of fuzzy set theory, and by extension fuzzy logic. This theory proposed making the membership function (or the values False and True) operate over the range of real numbers [0.0, 1.0]. Fuzzy logic was now introduced to the world. Although, the technology was introduced in the United States, the scientist and researchers there, ignored it mainly because of its unconventional name. They refused to take something which sounded so child-like seriously. Some mathematicians argued that fuzzy logic was merely probability in disguise. Only stubborn scientists or ones who worked in discrete continued researching it. While the US and certain parts of Europe ignored it, fuzzy logic was excepted with open arms in Japan, China and most Oriental countries. It may be surprising to some that the worlds largest numbers of fuzzy researchers
Fuzzy Logic | Page - 14

are in China with over 10,000 scientists. Japan, though currently positioned at the leading edge of fuzzy studies falls second in manpower, followed by Europe and the USA. Hence, it can be said that the popularity of fuzzy logic in the Orient reflects the fact that Oriental thinking more easily accepts the concept of fuzziness. And because of this, the US, by some estimates, trail Japan by at least ten years in this forefront of modern technology.

What do we all mean fuzzy??

Before illustrating the mechanisms which make fuzzy logic machines work, it is important to realize what fuzzy logic actually is. Fuzzy logic is a superset of conventional(Boolean) logic that has been extended to handle the concept of partial truthtruth values between completely true and completely false. As its name suggests, it is the logic underlying modes of reasoning which are approximate rather than exact. The importance of fuzzy logic derives from the fact that most modes of human reasoning and especially common sense reasoning are approximate in nature.

The essential characteristics of fuzzy logic as founded by Zader Lotfi are as follows. In fuzzy logic, exact reasoning is viewed as a limiting case of approximate reasoning. In fuzzy logic everything is a matter of degree. Any logical system can be fuzzified In fuzzy logic, knowledge is interpreted as a collection of elastic or, equivalently , fuzzy constraint on a collection of variables Inference is viewed as a process of propagation of elastic constraints.

The third statement hence, define Boolean logic as a subset of Fuzzy Logic.

Fuzzy Logic | Page - 15

Introduction to Fuzzy Control


Fuzzy logic has become a common buzzword in machine control. However, the term itself inspires a certain skepticism, sounding equivalent to half-baked logic or bogus logic. Some other nomenclature might have been preferable, but its too late now, and fuzzy logic is actually very straightforward. Fuzzy logic is a way of interfacing inherently analog processes, that move through a continuous range of values, to a digital computer, that likes to see things as well-defined discrete numeric values. For example, consider an antilock braking system, directed by a microcontroller chip. The microcontroller has to make decisions based on brake temperature, speed, and other variables in the system.

The variable temperature in this system can be divided into a range of states, such as: cold, cool, moderate, warm, hot, very hot. Defining the bounds of these states is a bit tricky. An arbitrary threshold might be set to divide warm from hot, but this would result in a discontinuous change when the input value passed over that threshold.

Fig: Fuzzy Logic in Temperature

The way around this is to make the states fuzzy, that is, allow them to change gradually from one state to the next. You could define the input temperature states using membership functions such as the following: With this scheme, the input variables state no longer jumps abruptly from one state to the next. Instead, as the temperature changes, it loses value in one membership function while gaining value in the next. At any one time, the truth value of the brake temperature will

Fuzzy Logic | Page - 16

almost always be in some degree part of two membership functions: 0.6 nominal and 0.4 warm, or 0.7 nominal and 0.3 cool, and so on.

The input variables in a fuzzy control system are in general mapped into by sets of membership functions similar to this, known as fuzzy sets. The process of converting a crisp input value to a fuzzy value is called fuzzification. A control system may also have various types of switch, or ON-OFF, inputs along with its analogue inputs, and such switch inputs of course will always have a truth value equal to either 1 or 0, but the scheme can deal with them as simplified fuzzy functions that are either one value or another. Given mappings of input variables into membership functions and truth values, the microcontroller then makes decisions for what action to take based on a set of rules, each of the form: IF brake temperature IS warm AND speed IS not very fast THEN brake pressure IS slightly decreased.

In this example, the two input variables are brake temperature and speed that have values defined as fuzzy sets. The output variable, brake pressure, is also defined by a fuzzy set that can have values like static, slightly increased, slightly decreased, and so on. This rule by itself is very puzzling since it looks like it could be used without bothering with fuzzy logic, but remember the decision is based on a set of rules: All the rules that apply are invoked, using the membership functions and truth values obtained from the inputs, to determine the result of the rule. This result in turn will be mapped into a membership function and truth value controlling the output variable. These results are combined to give a specific (crisp) answer, the actual brake pressure, a procedure known as defuzzification.

This combination of fuzzy operations and rule-based inference describes a fuzzy expert system. Traditional control systems are based on mathematical models in which the the control system is described using one or more differential equations that define the system response to its inputs. Such systems are often implemented as proportionalintegralFuzzy Logic | Page - 17

derivative (PID) controllers. They are the products of decades of development and theoretical analysis, and are highly effective. If PID and other traditional control systems are so welldeveloped, why bother with fuzzy control? It has some advantages. In many cases, the mathematical model of the control process may not exist, or may be too expensive in terms of computer processing power and memory, and a system based on empirical rules may be more effective. Furthermore, fuzzy logic is well suited to low-cost implementations based on cheap sensors, low-resolution analog-to-digital converters, and 4-bit or 8-bit one-chip microcontroller chips. Such systems can be easily upgraded by adding new rules to improve performance or add new features. In many cases, fuzzy control can be used to improve existing traditional controller systems by adding an extra layer of intelligence to the current control method.

Fuzzy Control in Detail


Fuzzy controllers are very simple conceptually. They consist of an input stage, a processing stage, and an output stage. The input stage maps sensor or other inputs, such as switches, thumbwheels, and so on, to the appropriate membership functions and truth values. The processing stage invokes each appropriate rule and generates a result for each, then combines the results of the rules. Finally, the output stage converts the combined result back into a specific control output value. The most common shape of membership functions is triangular, although trapezoids and bell curves are also used, but the shape is generally less important than the number of curves and their placement. From three to seven curves are generally appropriate to cover the required range of an input value, or the universe of discourse in fuzzy jargon. As discussed earlier, the processing stage is based on a collection of logic rules in the form of IF-THEN statements, where the IF part is called the antecedent and the THEN part is called the consequent. Typical fuzzy control systems have dozens of rules. Consider a rule for a thermostat: IF (temperature is cold) THEN (heater is high)

Fuzzy Logic | Page - 18

This rule uses the truth value of the temperature input, which is some truth value of cold, to generate a result in the fuzzy set for the heater output, which is some value of high. This result is used with the results of other rules to finally generate the crisp composite output. Obviously, the greater the truth value of cold, the higher the truth value of high, though this does not necessarily mean that the output itself will be set to high, since this is only one rule among many. In some cases, the membership functions can be modified by hedges that are equivalent to adjectives. Common hedges include about, near, close to, approximately, very, slightly, too, extremely, and somewhat. These operations may have precise definitions, though the definitions can vary considerably between different implementations. Very, for one example, squares membership functions; since the membership values are always less than 1, this narrows the membership function. Extremely cubes the values to give greater narrowing, while somewhat broadens the function by taking the square root. In practice, the fuzzy rule sets usually have several antecedents that are combined using fuzzy operators, such as AND, OR, and NOT, though again the definitions tend to vary: AND, in one popular definition, simply uses the minimum weight of all the antecedents, while OR uses the maximum value. There is also a NOT operator that subtracts a membership function from 1 to give the complementary function. There are several different ways to define the result of a rule, but one of the most common and simplest is the max-min inference method, in which the output membership function is given the truth value generated by the premise. Rules can be solved in parallel in hardware, or sequentially in software. The results of all the rules that have fired are defuzzified to a crisp value by one of of several methods. There are dozens in theory, each with various advantages and drawbacks.

The centroid method is very popular, in which the center of mass of the result provides the crisp value. Another approach is the height method, which takes the value of the biggest contributor. The centroid method favours the rule with the output of greatest area, while the height method obviously favours the rule with the greatest output value. The example below demonstrates max-min inference and centroid defuzzification for a system with input variables x, y, and z and an output variable n. Note that mu is standard fuzzy-logic nomenclature for truth value:

Fuzzy Logic | Page - 19

Notice how each rule provides a result as a truth value of a particular membership function for the output variable. In centroid defuzzification the values are ORd, that is, the maximum value is used and values are not added, and the results are then combined using a centroid calculation. Fuzzy control system design is based on empirical methods, basically a methodical approach to trial-and-error. The general process is as follows: Document the systems operational specifications and inputs and outputs. Document the fuzzy sets for the inputs. Document the rule set. Determine the defuzzification method. Run through test suite to validate system, adjust details as required. Complete document and release to production.

Fuzzy Logic | Page - 20

As a general example, consider the design of a fuzzy controller for a steam turbine. The block diagram of this control system appears as follows:

Fig: Design of a Fuzzy Controller for a Steam Turbine

There are two input variables, temperature and pressure, and a single output variable, the turbine throttle setting. The turbines operation can be reversed, so the throttle setting can be positive or negative. The fuzzy set mappings are shown below:

Fuzzy Logic | Page - 21

Fig: Fuzzy Set Mappings of Fuzzy Controller for a Steam Turbine

The throttle settings are defined as follows: N3: Large negative. N2: Medium negative. N1: Small negative. Z: Zero. P1: Small positive. P2: Medium positive. P3: Large positive.

Fuzzy Logic | Page - 22

The rule set includes such rules as: Rule 1: IF temperature IS cool AND pressure IS weak, THEN throttle is P3. Rule 2: IF temperature IS cool AND pressure IS low, THEN throttle is P2. Rule 3: IF temperature IS cool AND pressure IS ok, THEN throttle is Z. Rule 4: IF temperature IS cool AND pressure IS strong, THEN throttle is N2.

In practice, the controller accepts the inputs and maps them into their membership functions and truth values. These mappings are then fed into the rules. If the rule specifies an AND relationship between the mappings of the two input variables, as the examples above do, the minimum of the two is used as the combined truth value; if an OR is specified, the maximum is used. The appropriate output state is selected and assigned a membership value at the truth level of the premise. The truth values are then defuzzified. For an example, assume the temperature is in the cool state, and the pressure is in the low and ok states. The pressure values ensure that only rules 2 and 3 fire. Rule 2 is evaluated as follows:

Fuzzy Logic | Page - 23

Rule 3 is evaluated as follows:

Fuzzy Logic | Page - 24

The two outputs are then combined:

The output value will adjust the throttle and then the control cycle will begin again to generate the next value.

Fuzzy Logic | Page - 25

Building a Fuzzy Controller


Consider implementing with a microcontroller chip a simple feedback controller:

A fuzzy set is defined for the input error variable e, and the derived change in error from the previous error input, delta, as well as the output, as follows:

LP: large positive SP: small positive ZE: zero

Fuzzy Logic | Page - 26

SN: small negative LN: large negative

If the error ranges from -1 to +1, with the analog-to-digital converter used having a resolution of 0.25, then the input variables fuzzy set (which, in this case, also applies to the output variable) can be described very simply as a table, with the error / delta / output values in the top row and the truth values for each membership function arranged in rows beneath:

Fig: Table of Error Range This table is a little tricky to interpret. It simply defines each of the elements of the fuzzy set (LP through LN) in terms of the values (mu) that they have relative to the given values in the top row. It is important to remember that for the error / delta variables, the top row values are used to generate the mu values, while for the output variable, the mu values are used to generate the top row values. Suppose this fuzzy system has the following rule base: rule 1: IF e = ZE AND delta = ZE THEN output = ZE rule 2: IF e = ZE AND delta = SP THEN output = SN rule 3: IF e = SN AND delta = SN THEN output = LP rule 4: IF e = LP OR delta = LP THEN output = LN

Fuzzy Logic | Page - 27

These rules are typical for control applications in that the antecedents consist of the logical combination of the error and delta signals, while the consequent is a control command output. These rules can also be a little tricky to interpret. For example, what rule 1 says is that if the error value is the ZE fuzzy set element and the delta, or change from last error, value is the ZE fuzzy set element, then the output is also the ZE fuzzy set element. What is very tricky is that plugging actual numeric values into this rule does not give, at least directly, an actual value for the output setting. The value for the output setting is defined by rule 1 as ZE. Looking at the fuzzy value table shows that ZE has its maximum value corresponding to the value of 0 on the top row of the table, and so this rule always gives an output setting of 0. Similarly, rule 2 always gives an output setting of SN or -0.5, rule 3 always gives an output setting of LP or 1, and rule 4 always gives an output setting of LN or -1. The thing to remember is that the actual output is a combination of the outputs of these four rules, weighted by the values by the appropriate mu values provided by the rule calculation, using the centroid calculation:
SUM( I = 1 TO 4 OF ( mu(I) * output(I) ) ) / SUM( I = 1 TO 4 OF mu(I) )

The result of this calculation gives the actual output setting. Now, suppose that at a given time we have: error = 0.25 delta = 0.5

Then the corresponding mu values can be obtained by simply taking them from the appropriate columns of the fuzzy set table:

Fig: Fuzzy Set Table of Error

Fuzzy Logic | Page - 28

These values can then be plugged into the rules to give output values. Taking the first rule: rule 1: IF e = ZE AND delta = ZE THEN output = ZE

The weighting for the output, mu(1), is produced with the simple calculation: mu(1) = MIN( 0.7, 0.3 ) = 0.3

As mentioned above, the output value of this rule is always 1: output(1) = 0 The other rules give: rule 2: IF e = ZE AND delta = SP THEN output = SN mu(2) = MIN( 0.7, 1 ) = 0.7 output(2) = -0.5

rule 3: IF e = SN AND delta = SN THEN output = LP mu(3) = MIN( 0.0, 0.0 ) = 0 output(3) = 1

rule 4: IF e = LP OR delta = LP THEN output = LN mu(4) = MAX( 0.0, 0.3 ) = 0.3 output(4) = -1

The centroid computation yields: mu(1)*output(1) + mu(2)*output(2) + mu(3)*output(3) + mu(3)*output(3) --------------------------------------------------------------------------------------------------------------mu(1) + mu(2) + mu(3) + mu(4)

( 0.3 * 0 ) + ( 0.7 * -0.5 ) + ( 0 * 1 ) + ( 0.3 * -1 ) = --------------------------------------------------------------------------------------0.3 + 0.7 + 0 + 0.3

0 - 0.35 + 0 - 0.3 = -------------------------------------------1.3

= -0.65 / 1.3

= -0.5

Fuzzy Logic | Page - 29

for the final control output. . Of course the hard part is figuring out what rules actually work correctly in practice.

* If you have problems figuring out the centroid equation, remember that a centroid is defined by summing all the moments (location times mass) around the center of gravity and equating the sum to zero. So if X0 is the center of gravity, Xi is the location of each mass, and Mi is each mass, this gives:

0 = ( X1 - X0 ) * M1 + ( X2 - X0 ) * M2 + ... + ( Xn - X0 ) * Mn

0 = ( X1 * M1 + X2 * M2 + ... + Xn * Mn ) - X0 * ( M1 + M2 + .. + Mn )

X0 * ( M1 + M2 + ... + Mn ) = ( X1 * M1 + X2 * M2 + ... + Xn * Mn )

( X1 * M1 + X2 * M2 + ... + Xn * Mn ) X0 =-------------------------------------------------------------------------( M1 + M2 + ... + Mn )

In our example, the values of mu correspond to the masses, and the values of X to location of the masses.

Fuzzy Logic | Page - 30

Is Fuzzy Controller better?

Testing of the Controller


The fuzzy controller has been tested under seven different kinds of traffic conditions from very heavy traffic to very lean traffic. 35 random chosen car densities were grouped according to different periods of the day representing those traffic conditions.

Performance Evaluation
The performance of the controller was compared with that of a conventional controller and a human expert. The criteria used for comparison were number of cars allowed to pass at one time and average waiting time. A performance index which maximises the traffic flow and reduces the average waiting time was developed. A means of calculating the average waiting time was also developed, however, a detailed calculation of this evaluation is beyond the scope of this article. All three traffic controller types were compared and can be summarized with the following graph of performance index in all seven traffic categories.

Fig: Performance Index for 7 Different Traffic Categories

Fuzzy Logic | Page - 31

The fuzzy controller passed through 31% more cars, with an average waiting time shorter by 5% than the theoretical minimum of the conventional controller. The performance also measure 72% higher. This was expected. However, in comparison with a human expert the fuzzy controller passed through 14% more cars with 14% shorter waiting time and 36% higher performance index. Result: Machine beats Man!!!! In conclusion, as Man gets hungry in finding new ways of improving our way of life, new, smarter machines must be created. Fuzzy logic provides a simple and efficient way to meet these demands and the future of it is limitless.

Fuzzy Logic | Page - 32

Fuzzy Rules
If-Then Rules
Fuzzy sets and fuzzy operators are the subjects and verbs of fuzzy logic. These if-then rule statements are used to formulate the conditional statements that comprise fuzzy logic. A single fuzzy if x is A then y is B if n rule assumes the form where A and B are linguistic values defined by fuzzy sets on the ranges (universes of discourse) X and Y, respectively. The if-part of the rule x is A is called the antecedent or premise, while the then-part of the rule y is B is called the consequent or conclusion. An example of such a rule might be If service is good then tip is average Note that good is represented as a number between 0 and 1, and so the antecedent is an interpretation that returns a single number between 0 and 1. On the other hand, average is represented as a fuzzy set, and so the consequent is an assignment that assigns the entire fuzzy set B to the output variable y. In the if-then rule, the word is gets used in two entirely different ways depending on whether it appears in the antecedent or the consequent. In MATLAB terms, this is the distinction between a relational test using == and a variable assignment using the = symbol. A less confusing way of writing the rule was: If service == good then tip = average

In general, the input to an if-then rule is the current value for the input variable (in this case, service) and the output is an entire fuzzy set (in this case, average). This set will later be defuzzified, assigning one value to the output. The concept of defuzzification is described in the next section. Interpreting an if-then rule involves distinct parts: first evaluating the antecedent (which involves fuzzifying the input and applying any necessary fuzzy operators) and second applying that result to the consequent (known as implication). In the case of two-valued or binary logic, if-then rules dont present much difficulty. If the premise is true, then the conclusion is true. If we relax the restrictions of two-valued logic and let the antecedent be a fuzzy statement, how does this reflect on the conclusion? The

Fuzzy Logic | Page - 33

answer is a simple one. if the antecedent is true to some degree of membership, then the consequent is also true to that same degree. In other words in binary logic: p q (p and q are either both true or both false.) in fuzzy logic: 0.5 p 0.5 q (Partial antecedents provide partial implication.) The antecedent of a rule can have multiple parts, in which case all parts of the antecedent are: If sky is gray and wind is strong and barometer is falling, then ... calculated simultaneously and resolved to a single number using the logical operators described in the preceding section. The consequent of a rule can also have multiple parts.

If temperature is cold then hot water valve is open and cold water valve is shut in which case all consequents are affected equally by the result of the antecedent. How is the consequent affected by the antecedent? The consequent specifies a fuzzy set be assigned to the output. The implication function then modifies that fuzzy set to the degree specified by the antecedent. The most common ways to modify the output fuzzy set are truncation using the min function (where the fuzzy set is chopped off as shown below) or scaling using the prod function (where the output fuzzy set is squashed). Both are supported by the Fuzzy Logic Toolbox, but let us use truncation for the examples in this section.

Summary of If-Then Rules

Interpreting if-then rules is a three-part process which is explained in detail in the next section: 1. Fuzzify inputs: Resolve all fuzzy statements in the antecedent to a degree of membership between 0 and 1. If there is only one part to the antecedent, this is the degree of support for the rule.

Fuzzy Logic | Page - 34

2. Apply fuzzy operator to multiple part antecedents: If there are multiple parts to the antecedent, apply fuzzy logic operators and resolve the antecedent to a single number between 0 and 1. This is the degree of support for the rule. 3. Apply implication method: Use the degree of support for the entire rule to shape the output fuzzy set. The consequent of a fuzzy rule assigns an entire fuzzy set to the output. This fuzzy set is represented by a membership function that is chosen to indicate the qualities of the consequent. If the antecedent is only partially true, (i.e., is assigned a value less than 1), then the output fuzzy set is truncated according to the implication method.

All fuzzy evaluations are based on the rules in the symbolic representation. Linguistic variables, membership functions, hedges and fuzzy operations are referenced by their respective symbolic names. Symbolic representation of the rules allows easy understanding of the rules and simplifies the debugging process. Fuzzy rules are represented by text strings in the following format:
<label> if LV1 is <hedge ...> MF1 <and/or LV2 is <hedge ...> MF2 and/or ...> then LVN is <hedge ...> MFN ... < and rule label weight is <hedge ...> weightMF> <label> set LV1 is <hedge ...> MF1 <and LV2 is <hedge ...> MF2 ...> <and rule label weight is <hedge ...> weightMF>

label - a text label assigned to a rule. A rules weight (default is 1.0) is changed by executing expression rule label weight is weightMF in the right part of a rule. The same label can be assigned to more than one rule. In this case weight change will affect all of the labeled rules.

Example start: if angle is ... if - a service word indicating the beginning of the left part (evaluation part) of a fuzzy rule. LV - a linguistic variable. Linguistic variables are addressed by their names. Each linguistic variable has one or more associated membership functions. is - a service word separating linguistic variable and hedges/membership function. hedge - the engine has 3 predefined hedges: not, very and somewhat. The user can define arbitrary hedges and use them in rules.

Fuzzy Logic | Page - 35

Example if weather is not very nice ... MF - a membership function. Membership functions are addressed by their names. Each membership function is defined as a trapezoid. and/or service words indicating logical operation to be performed on the neighboring fuzzy expressions. Priority of the and/or operations decreases from left to right and may be changed by applying parenthesis. The engine supports arbitrary number of expressions on the left part, arbitrary nesting and and/or operations.

Example if angle is wide or (angle is normal and (speed is high or speed is normal)) ... then - a service word separating left part of expression from the right part (execution part). Result obtained from evaluation of the left part is used to perform fuzzy assignments in the right part. The form of fuzzy expressions is the same as in the evaluation part, except assignment is performed instead of evaluation. During the assignment, hedges apply to the result of evaluation part. Application of the hedges is local for each fuzzy expression. If more than one assignment is to be performed, then fuzzy expression should be separated by the service word and

Example ...then power is very low and steering is toTheLeft rule - a service word indication that a rules weight will be changed in this expression. This word is followed by a label for the rule whose weight is about to be changed. Example ... then rule start: weight is low ... weight - this is a reserved linguistic variable. Linguistic variable weight is defined by the user and serves for the purpose of changing a rules weight. A copy of this LV is created for each unique label. Changes of weight are performed by defuzzification of the copy assigned to a particular label, thus multiple weight changes are carried out in fuzzy manner. How much a rules weight will be changed depends both on definition of membership functions for weight, evaluation result after application of hedges and number of assignments.

Fuzzy Logic | Page - 36

Example
LinguisticVariable weight=new LinguisticVariable(weight); weight.add(low,0,0,0.2,0.3); ... fuzzyEngine.evaluateRule(start: if angle is wide then rule start: is low); weight

When weight assignment is performed on the same rule that assigns the weight (see Example) then only one iteration of weight change is performed, i.e. it does not fall into an endless loop of weight change. set - a service word for unconditional assignments. If set is encountered instead of if, result of the left part evaluation is assumed to be 1.0 and all assignments are performed for that value.

Example set power is low ...

In general, one rule by itself doesnt do much good. Whats needed are two or more rules that can play off one another. The output of each rule is a fuzzy set. The output fuzzy sets for each rule are then aggregated into a single output fuzzy set. Finally the resulting set is defuzzified, or resolved to a single number. The next section shows how the whole process works from beginning to end for a particular type of fuzzy inference system called a Mamdani type. Human beings make decisions based on rules. Although, we may not be aware of it, all the decisions we make are all based on computer like if-then statements. If the weather is fine, then we may decide to go out. If the forecast says the weather will be bad

Fuzzy Logic | Page - 37

today, but fine tomorrow, then we make a decision not to go today, and postpone it till tomorrow. Rules associate ideas and relate one event to another.

Fuzzy machines, which always tend to mimic the behaviour of man, work the same way. However, the decision and the means of choosing that decision are replaced by fuzzy sets and the rules are replaced by fuzzy rules. Fuzzy rules also operate using a series of ifthen statements. For instance, if X then A, if y then b, where A and B are all sets of X and Y. Fuzzy rules define fuzzy patches, which is the key idea in fuzzy logic. A machine is made smarter using a concept designed by Bart Kosko called the Fuzzy Approximation Theorem(FAT). The FAT theorem generally states a finite number of patches can cover a curve as seen in the figure below. If the patches are large, then the rules are sloppy. If the patches are small then the rules are fine.

Fig: Fuzzy Patches

In a fuzzy system this simply means that all our rules can be seen as patches and the input and output of the machine can be associated together using these patches. Graphically, if the rule patches shrink, our fuzzy subset triangles gets narrower. Simple enough? Yes, because even novices can build control systems that beat the best math models of control theory. Naturally, it is math-free system.

Fuzzy Logic | Page - 38

Fuzzy Database in a Nutshell


Let us look at the following questions that are related to a new kind of databases called fuzzy databases. This is a research field of increasing interest. In these kinds of databases imprecise and incomplete information is stored with a certainty measure of acceptance. The theory related to the mentioned kind of database has the concepts of fuzzy relations (i.e. fuzzy relvars) and related to them fuzzy set definitions that are also stored in relvars.

Let us take a project to be developed by the students related, for example, to fuzzy databases for a library, in which the software developed could answer the following kind of questions: Get all new database books that have very much about the concept of integrity. Note those words new and very much that have its related fuzzy set definitions. In this context I would like to know your opinion about this kind of databases, obviously, related to the perspective from the Relational Model.

Fuzzy databases is a topic Ive been meaning to investigate for a long while now. Right now, my ignorance of the subject is almost total. Sticking my neck out, however, Id still like to offer a couple of observationsfrom, as you put it, the perspective from the Relational Model (of course!)even though the observations in question might strike readers more knowledgeable than I am in this area as pretty trivial, possibly even wrong. You say fuzzy databases let us store imprecise and incomplete information ... with a certainty measure of acceptance. It seems to me, however, that storing such information with a certainty measure of acceptance means were really storing something that isnt imprecise or incomplete at all, but instead precise and complete! For example: the statement Bill Gates is very rich is accurate but not very precise. In other words, its a fuzzy proposition at least, lets assume it is for the sake of the discussion, though it does seem to me that fuzziness is in the eye of the beholder to some extent.* I mean, I could define a relvar of degree one called VERY_RICH, and interpret the fact that a tuple containing the name Bill Gates appears in that relvar as meaning that Bill Gates is very rich, without ever having to be specific as to exactly what very rich means. The statement Theres a 75% chance that Bill Gates is very rich is precise (I dont know whether its accurate)and this proposition isnt fuzzy at all. More generally, the proposition q = The measure of acceptance for proposition p is x is
Fuzzy Logic | Page - 39

precise, given a specific proposition to substitute for p and a specific measure to substitute for x (in other words, given values for p and x). Now, in the relational world, we know that propositions can be represented by tuples. Invoking The Information Principle , therefore, I would say that a relational view of the foregoing simply means that the entire proposition q must be represented by a tuple in the conventional relational fashion. In particular, the acceptance measure x must be represented by an attribute within that tuple, not in any other way. Representing x in any other way would be reminiscent of those (numerous) proposals for temporal data supportsee, e.g., TSQL2in which the time dimension is not represented by regular relational attributes but by what might be called hidden attributes instead.

Recently, new applications have emerged that require database management systems with uncertainty capabilities, e.g. heterogeneous database environments, multimedia databases, imputation and knowledge discovery, knowledge base management systems, and design environments with an underlying database management system (DBMS). Many of these applications assume an object-oriented DBMS (OODBMS) as a basis due to its rich modelling capabilities. Although we assume an object-oriented system, our results are not limited to OODBMSs.

Many of the existing approaches to modelling uncertainty in DBMSs are based on thetheory of fuzzy sets for fuzzy DBMSs (fDBMSs). They mainly address fuzzy relational DBMSs since fuzzy ooDBMSs are still a currenttopic of research. Although the need for handling uncertainty in DBMSs has already been recognized earlier, commercial DBMSs are slowly { if at all { incorporating corresponding capabilities. The main reason lies in the fact, that, on one hand, high performance is a necessary precondition for the acceptance of such systems by end users, and, on the other hand, performance issues have been quite neglected in research on fDBMSs so far.With our work, we fill this gap by addressing the problem of efficiently querying a fuzzy database. In fact, for the access of fuzzy data and the evaluation of fuzzy queries, the usual index structures are no longer useful due to the expanded internal representation and evaluation of fuzzy attribute values or query predicates.. This is also true for querying fuzzy constraints in DBMSs, where a fuzzy constraint is understood as the restriction of the domain of an attribute.

Fuzzy Logic | Page - 40

In all existing approaches to fDBMSs, a fuzzy attribute value is represented by a single possibility distribution. In practice, however, it is unrealistic to assume that an attribute can be described by a single fuzzy set, it is rather described by a complex expression of linguistic terms containing conjunction, disjunction and negation mapped onto fuzzy sets. This linguistic description should not be lost, although the complex expression can be represented by a single fuzzy set by applying the corresponding fuzzy operators. We already consider this requirement from applications, e.g. design applications, on efficient index structures for fDBMSs in this lesson. Thus, the representation of an attribute by a single fuzzy set is seen as a special case of this more general case. The index structures, proposed in this lesson, are based on the technique of superimposed coding, which was originally developed for mechanical retrieving systems in libraries. Roberts made the first use of this concept for partial match retrieval in computer systems.

Most previous approaches with respect to fuzzy queries have addressed the case that the level-cuts of the fuzzy attribute values as well as of the fuzzy query predicates are characterized by a closed interval, and that there is a linear order imposed on the attributes domain. This is also true for the little existing work on index structures for fDBMSs.. Let me, instead, address the case that the domain of the attributes is finite. Further assumptions with respect to the possibility distributions are not made. Our work ha s in common with the work presented in [2] that it makes use of existing indexing techniques in DBMSs, and that it uses the same basic indexing principles. These are presented in the next section. However, our work goes far beyond that in [2] by not only providing a concept for index structures but by additionally providing detailed cost models and measurements to prove the correctness of the cost models and the efficiency of the index structures. In most cases concerning the use of superimposed coding only superset predicates are discussed, since only partial match queries are considered. It has been shown recently, that the technique of superimposed coding is suitable for fast set comparisons including super and subset predicates in OODBMSs. In the context of fuzzy retrieval we need subset as well as intersection predicates. Therefore, I supplement the technique of superimposed coding by adding the evaluation of intersection set predicates.

Fuzzy Logic | Page - 41

Fuzzy Sets
Sets
a. Classical Sets

Either an element belongs to the set or it does not. For example, for the set of integers, either an integer is even or it is not (it is odd). However, either you are in the USA or you are not. What about flying into USA, what happens as you are crossing? Another example is for black and white photographs, one cannot say either a pixel is white or it is black. However, when you digitize a b/w figure, you turn all the b/w and gray scales into 256 discrete tones. Classical sets are also called crisp (sets). Lists: A = {apples, oranges, cherries, mangoes} A = {a1,a2,a3 } A = {2, 4, 6, 8, } Formulas: A = {x | x is an even natural number} A = {x | x = 2n, n is a natural number} Membership or characteristic function.

b. Fuzzy Sets

Admits gradation such as all tones between black and white. A fuzzy set has a graphical description that expresses how the transition from one to another takes place. This graphical description is called a membership function.

In mathematics, the concept of set is very simple, but very important. A set is simply a collection of things. The things can be most anything you want - numbers, names of autos, you name it. Things either belong to the set or dont belong, similar to the idea in logic that statements are either true or false. In 1965, Lotfi Zadeh proposed the idea of a fuzzy set ; a

Fuzzy Logic | Page - 42

fuzzy set is one to which objects can belong to different degrees, called grades of membership. in FLOPS, we measure the confidence that the member belongs to the fuzzy set as a number ranging from zero (absolutely false) to 1000 (absolutely true).

This simple idea of different grades of membership in a fuzzy set is extremely helpful in constructing expert systems. We will be concerned with fuzzy sets of descriptive words, where the grade of membership represents our confidence that the descriptor is true of whatever we are considering. Usually, we will use the term confidence rather than grade of membership. This permits us to use ordinary language in describing things in a precise way. As an example, consider a fuzzy set speed, with members Slow, Medium and Fast.

Of course, we have to define in some way how to go back and forth between the description of speed in numbers and the description of speed in words. This is done through defining membership functions, which look something like this:

Fuzzy Logic | Page - 43

is classified as Fast, Medium or Slow. Leaving a good deal of overlap on the adjacent membership functions is a very good idea; it lends robustness to the reasoning system. Membership functions need not be made up of straight lines; curvilinear shapes are available. Other useful fuzzy sets are not descriptions of numbers, but of (in a broad sense) categories. These fuzzy sets are not word descriptors of how much, but are answers to what is it? For example, fuzzy set color might have members Red, Green and Blue. Fuzzy set car might have members Ford, Chevrolet, Toyota and Buick. In fuzzy sets like speed and color it is very likely that two or more descriptors might have non-zero confidences at the same time; that is fine, since we are seldom certain that one descriptor is entirely right and the others are entirely wrong. These are ambiguities, and as mentioned above they lend strength to the reasoning process. But in other fuzzy sets like car, it is not possible for a car to be both a Buick and a Chevrolet. In this case, if more than one member has a non-zero confidence, we have a contradiction. Contradictions need to be resolved before leaving our program, often by examining more data.

Fuzzy logic starts with the concept of a fuzzy set. A fuzzy set is a set without a crisp, clearly defined boundary. It can contain elements with only a partial degree of membership. To understand what a fuzzy set is, first consider what is meant by what we might call a classical set. A classical set is a container that wholly includes or wholly excludes any given element. For example, the set of days of the week unquestionably includes Monday, Thursday, and Saturday. It just as unquestionably excludes butter, liberty, and dorsal fins, and so on.

We call this set a classical set because it has been around for such a long time. It was Aristotle who first formulated the Law of the Excluded Middle, which says X must either be in set A or in set not-A. Another version runs like this.

Fuzzy Logic | Page - 44

Of any subject, one thing must be either asserted or denied.

Here is a restatement of the law with annotations: Of any subject (say Monday), one thing (being a day of the week) must be either asserted or denied (I assert that Monday is a day of the week). This law demands that opposites, the two categories A and not-A, should between them contain the entire universe.

Everything falls into either one group or the other. There is no thing that is both a day of the week and not a day of the week. Now consider the set of days comprising a weekend. The diagram below is one attempt at classifying the weekend days.

Most would agree that Saturday and Sunday belong, but what about Friday? It feels like a part of the weekend, but somehow it seems like it should be technically excluded. So in the diagram above Friday tries its best to sit on the fence. Classical or normal sets wouldnt tolerate this kind of thing. Either youre in or youre out. Human experience suggests something different, though: fence sitting is a part of life.

Of course were on tricky ground here, because were starting to take individual perceptions and cultural background into account when we define what constitutes the weekend. But this is exactly the point. Even the dictionary is imprecise, defining the weekend as the period from Friday night or Saturday to Monday morning. Were entering the realm where sharp edged yes-no logic stops being helpful. Fuzzy reasoning becomes valuable exactly when were talking about how people really perceive the concept weekend as opposed to a simple-minded classification useful for accounting purposes only. More than anything else, the following statement lays the foundations for fuzzy logic.

Fuzzy Logic | Page - 45

In fuzzy logic, the truth of any statement becomes a matter of degree. Any statement can be fuzzy. The tool that fuzzy reasoning gives is the ability to reply to a yes-no question with a not-quite-yes or-no answer. This is the kind of thing that humans do all the time (think how rarely you get a straight answer to a seemingly simple question) but it is a rather new trick for computers.

How does it work? Reasoning in fuzzy logic is just a matter of generalizing the familiar yes-no (Boolean) logic. If we give true the numerical value of 1 and false the numerical value of 0, were saying that fuzzy logic also permits in-between values like 0.2 and 0.7453. For instance:

Below on the left is a plot that shows the truth values for weekend-ness if we are forced to respond with an absolute yes or no response. On the right is a plot that shows the truth value for weekend-ness if we are allowed to respond with fuzzy in-between values. Technically, the representation on the right is from the domain of multivalued logic (or multivalent logic). If I ask the question Is X a member of set A? the answer might be yes, no, or any one of a thousand intermediate values in between. In other words, X might have partial membership in A. Multivalued logic stands in direct contrast to the more familiar concept of two-valued (or bivalent yes-no) logic. Two-valued logic has played a central role in the history of science since Aristotle first codified it, but the time has come for it to share the stage. To return to our example, now consider a continuous scale time plot of weekendness shown below.
Fuzzy Logic | Page - 46

By making the plot continuous, were defining the degree to which any given instant belongs in the weekend rather than an entire day. In the plot on the left, notice that at midnight on Friday, just as the second hand sweeps past 12, the weekendness truth value jumps discontinuously from 0 to 1. This is one way to define the weekend, and while it may be useful to an accountant, it doesnt really connect with our real-world experience of weekend-ness.

The plot on the right shows a smoothly varying curve that accounts for the fact that all of Friday, and, to a small degree, parts of Thursday, partake of the quality of weekend-ness and thus deserve partial membership in the fuzzy set of weekend moments. The curve that defines the weekend-ness of any instant in time is a function that maps the input space (time of the week) to the output space (weekend-ness). Specifically it is known as a membership function..

As another example of fuzzy sets, consider the question of seasons. What season is it right now? In the northern hemisphere, summer officially begins at the exact moment in the earths orbit when the North Pole is pointed most directly toward the sun. It occurs exactly once a year, in late June. Using the astronomical definitions for the season, we get sharp boundaries as shown on the left in the figure that follows. But what we experience as the seasons vary more or less continuously as shown on the right below (in temperate northern hemisphere climates).

Fuzzy Logic | Page - 47

Fuzzy Numbers
The final major member of our fuzzy systems arsenal is the fuzzy number. A fuzzy number is simply an ordinary number whose precise value is somewhat uncertain. Here, for example, is a fuzzy two.

A fuzzy number is a subset of the universe of a numerical number. For instance fuzzy real number is a fuzzy subset of the domain of real numbers. A fuzzy integer is a subset of domain of integers. An example of fuzzy integer, about-20 is as shown in the figure.

Here our confidence that numbers 1.5 or less belong to the fuzzy 2 is zero, as is our confidence that numbers 2.5 or greater belong to the fuzzy 2. Our confidence that 1.6 belongs to the fuzzy 2 is 200; for 1.7, 400; and so on to confidence 1000 for 2. For numbers greater
Fuzzy Logic | Page - 48

than 2, the confidence declines as the number increases, being 800 for 2.1, 600 for 2.2, and so on to zero confidence for 2.5. A very convenient way to describe fuzzy numbers is to use modifying words. For example, the fuzzy two shown in Figure 1 could be completely specified by roughly 2. Other modifying words available are nearly, about and crudely, with progressively larger uncertainties. These words are called hedges in fuzzy math circles. With fuzzy numbers, we can make approximate comparisons.

It is quite possible, for example, to ask if an input persons age is approximately equal to about 30. This is often very useful when our data or imprecise, or when we dont want the rigidity of accepting a person 30 years old but rejecting one thirty years plus one day old. A very convenient way to describe fuzzy numbers is to use modifying words. For example, the fuzzy two shown in Figure 2 could be completely specified by roughly 2. Other modifying words available are nearly, about and crudely, with progressively larger uncertainties. These words are called hedges in fuzzy math circles. With fuzzy numbers, we can make approximate comparisons. It is quite possible, for example, to ask if an input persons age is approximately equal to about 30. This is often very useful when our data or imprecise, or when we dont want the rigidity of accepting a person 30 years old but rejecting one thirty years plus one day old.

Fuzzy Logic | Page - 49

Fuzzy Image Processing


Fuzzy image processing is not a unique theory. It is a collection of different fuzzy approaches to image processing. Nevertheless, the following definition can be regraded as an attempt to determine the boundaries:

Fuzzy image processing is the collection of all approaches that understand, represent and process the images, their segments and features as fuzzy sets. The representation and processing depend on the selected fuzzy technique and on the problem to be solved. Fuzzy image processing has three main stages: image fuzzification, modification of membership values, and, if necessary, image defuzzification.

The fuzzification and defuzzification steps are due to the fact that we do not possess fuzzy hardware. Therefore, the coding of image data (fuzzification) and decoding of the results (defuzzification) are steps that make possible to process images with fuzzy techniques. The main power of fuzzy image processing is in the middle step (modification of membership values,). After the image data are transformed from gray-level plane to the membership plane (fuzzification), appropriate fuzzy techniques modify the membership values. This can be a fuzzy clustering, a fuzzy rule-based approach, a fuzzy integration approach and so on.

Why Fuzzy Image Processing?


Many colleagues (not only the opponents of fuzzy logic) ask why we should use fuzzy techniques in image processing. There are many reasons to do this. The most important of them are as follows: Fuzzy techniques are powerful tools for knowledge representation and processing Fuzzy techniques can manage the vagueness and ambiguity efficiently In many image processing applications, we have to use expert knowledge to overcome the difficulties (e.g. object recognition, scene analysis). Fuzzy set theory
Fuzzy Logic | Page - 50

and fuzzy logic offer us powerful tools to represent and process human knowledge in form of fuzzy if-then rules. On the other side, many difficulties in image processing arise because the data/ tasks/results are uncertain. This uncertainty, however, is not always due to the randomness but to the ambiguity and vagueness. Beside randomness which can be managed by probability theory we can distinguish between three other kinds of imperfection in the image processing. Grayness ambiguity Geometrical fuzziness Vague (complex/ill-defined) knowledge

These problems are fuzzy in the nature. The question whether a pixel should become darker or brighter than it already is, the question where is the boundary between two image segments, and the question what is a tree in a scene analysis problem, all of these and other similar questions are examples for situations that a fuzzy approach can be the more suitable way to manage the imperfection.

It can be described with the subsets yellow, orange, red, violet and blue: colour = {yellow, orange, red, violet, blue}

The non-crisp boundaries between the colours can be represented much better. A soft computing becomes possible.

History of Fuzzy Image Processing


A pictorial object is a fuzzy set which is specified by some membership function defined on all picture points. From this point of view, each image point participates in many memberships. Some of this uncertainty is due to degradation, but some of it is inherentIn fuzzy set terminology, making figure/ground distinctions is equivalent to transforming from membership functions to characteristic functions.

Fuzzy Logic | Page - 51

Theory of Fuzzy Image Processing


Fuzzy image processing is a collection of different areas of fuzzy set theory, fuzzy logic and fuzzy measure theory. The following topics represent the most important theoretical components of fuzzy image processing: Fuzzy Geometry (Metric, topology, ...)

Fuzzy Geometry
The digital geometry plays a key role in many image processing applications. Generally, the gray-level images will be thresholded to calculate geometrical measures such as area, perimeter, diameter, compactenss etc. of an object. Since the images or their segments have ill-defined or non-crisp boundaries, it is sometimes appropriate to consider them as fuzzy sets. Azriel Rosenfeld has introduced the concept of fuzzy digital geometry: The standard approach to image analysis and recognition begins by segmenting the image into regions and computing various properties of and relationships among these regions. However, the regions are not always crisply defined; it is sometimes more appropriate to regard them as fuzzy subsets of the image... It is not always obvious how to measure geometrical properties of fuzzy sets, but definitions have been given and basic properties established for a variety of such properties and relationships, including connectedness and surroundedness, convexity, are, perimeter and compactness, extent and diameter (A. Rosendfeld, The Fuzzy Geometry of Image Subsets).

For instance, if we have to calculate the elongatedness of an object, the thresholding step is often not optimal (loss of information, see Fig.5). Therefore, it is more suitable to operate on the original gray-level image and not commit ourselves to such crisp classifications.

Fuzzy Logic | Page - 52

Fig: Gray-level Image vs Binary Image

Fuzzy Grammars

Combined Approaches (Neural fuzzy/fuzzy neural approaches, fuzzy genetic algorithms, fuzzy wavelet analysis) Extension of classical methods (Fuzzy Hough transform, fuzzy median filtering, ...)

To use the these components systematically, we need to develop a new image understanding. The image fuzzification, therefore, plays a pivotal role in all image processing systems that apply any of these components. It can be distinguishesd between the following kinds of image fuzzification:

Histogram-based gray-level fuzzification (or briefly histogram fuzzification)

Example: brightness in image enhancement

Fuzzy Logic | Page - 53

Local fuzzification (Example: edge detection) Feature fuzzification (Scene analysis, object recognition)

Fuzzy approach

Brief Description Fuzzy clustering is the oldest fuzzy approach to image

Fuzzy Clustering Algorithms

segmentation. Algorithms such as fu zzy c-means (FCM, Bezdek) and possibilistic c-means (PCM, Krishnapuram & Keller) can be used to build clusters (segments). The class membership of pixels can be interpreted as similarity or compatibility with an ideal objectinterpret the image features as linguistic variables, then we If we or a certain property.

Fuzzy Rule-Based Approach

can use fuzzy if-then rules to segment the image into different regions. A simple fuzzy segmentation rule may seem as follows:IF the pixel is darkAND its neighbourho od is also dark AND homogeneousTHEN it belongs to the background. Fuzzy integrals can be used in different forms:

Fuzzy Integrals

Segmentation by weightening the features (fuzzy measures represent the importance of particular features)Fusion of the results of different segmentation algorithms (optimal use of individual adavatages)

Segmentation by fusion of different sensors (e.g. multispectral images, fuzzy measures represent the

relevance/importance of entropy) and Measures of Fuzziness Mesaures of fuzziness (e.g. fuzzyeach sensor) image information and image information (e.g. fuzzy divergence) can be also used in segmentation and thresholding tasks (see the example below). Fuzzy geometrical measures such as fuzzy compactness (A. R Fuzzy Geometry osenfeld) and index of area coverage (S.K. Pal and A. Ghosh) can be used to measure the geometrical fuzziness of different regions of an image. The optimization of these measure (e.g. minimization of fuzzy compactness regarding to the cross-over point of membership function) can be applied to make fuzzy and/or crisp pixel classifications.
Fuzzy Logic | Page - 54

Membership Functions
A membership function (MF) is a curve that defines how each point in the input space is mapped to a membership value (or degree of membership) between 0 and 1. The input space is sometimes referred to as the universe of discourse, a fancy name for a simple concept.

One of the most commonly used examples of a fuzzy set is the set of tall people. In this case the universe of discourse is all potential heights, say from 3 feet to 9 feet, and the word tall would correspond to a curve that defines the degree to which any person is tall. If the set of tall people is given the welldefined (crisp) boundary of a classical set, we might say all people taller than 6 feet are officially considered tall. But such a distinction is clearly absurd. It may make sense to consider the set of all real numbers greater than 6 because numbers belong on an abstract plane, but when we want to talk about real people, it is unreasonable to call one person short and another one tall when they differ in height by the width of a hair.

Fig: Tall Concept in Real World

But if the kind of distinction shown above is unworkable, then what is the right way to define the set of tall people? Much as with our plot of weekend days, the figure following shows a smoothly varying curve that passes from not-tall to tall. The output-axis is a number known as the membership value between 0 and 1. The curve is known as a membership function and is often given the designation of . This curve defines the transition from not tall to tall. Both people are tall to some degree, but one is significantly less tall than the other.

Fuzzy Logic | Page - 55

Subjective interpretations and appropriate units are built right into fuzzy sets. If I say Shes tall, the membership function tall should already take into account whether Im referring to a six-year-old or a grown woman. Similarly, the units are included in the curve. Certainly it makes no sense to say Is she tall in inches or in meters?

Membership Functions in Fuzzy Logic


The only condition a membership function must really satisfy is that it must vary between 0 and 1. The function itself can be an arbitrary curve whose shape we can define as a function that suits us from the point of view of simplicity, convenience, speed, and efficiency.

A classical set might be expressed as A = {x | x > 6}

A fuzzy set is an extension of a classical set. If X is the universe of discourse and its elements are denoted by x, then a fuzzy set A in X is defined as a set of ordered pairs. A = {x, A(x) | x X} A(x) is called the membership function (or MF) of x in A. The membership function maps each element of X to a membership value between 0 and 1.

The Fuzzy Logic includes 11 built-in membership function types. These 11 functions are, in turn, built from several basic functions: piecewise linear functions, the Gaussian distribution function, the sigmoid curve, and quadratic and cubic polynomial curves. By convention, all membership functions have the letters mf at the end of their names.

The simplest membership functions are formed using straight lines. Of these, the simplest is the triangular membership function, and it has the function name trimf. it is nothing more than a collection of three points forming a triangle. The trapezoidal membership function, trapmf, has a flat top and really is just a truncated triangle curve. These straight line membership functions have the advantage of simplicity.

Fuzzy Logic | Page - 56

Fig: trimf and trapmf

Two membership functions are built on the Gaussian distribution curve: a simple Gaussian curve and a two-sided composite of two different Gaussian curves. The two functions are gaussmf and gauss2mf.

The generalized bell membership function is specified by three parameters and has the function name gbellmf. The bell membership function has one more parameter than the Gaussian membership function, so it can approach a non-fuzzy set if the free parameter is tuned. Because of their smoothness and concise notation, Gaussian and bell membership functions are popular methods for specifying fuzzy sets. Both of these curves have the advantage of being smooth and nonzero at all points.

Fig: gaussmf, gauss2mf, gbellmf

Although the Gaussian membership functions and bell membership functions achieve smoothness, they are unable to specify asymmetric membership functions, which are important in certain applications. Next we define the sigmoidal membership function, which is either open left or right. Asymmetric and closed (i.e. not open to the left or right) membership functions can be synthesized using two sigmoidal functions, so in addition to the basic sigmf, we also have the difference between two sigmoidal functions, dsigmf, and the product of two sigmoidal functions psigmf.

Fuzzy Logic | Page - 57

Fig: sigmf, dsigmf, psigmf

Polynomial based curves account for several of the membership functions in the . Three related membership functions are the Z, S, and Pi curves, all named because of their shape. The function zmf is the asymmetrical polynomial curve open to the left, smf is the mirror-image function that opens to the right, and pimf is zero on both extremes with a rise in the middle.

Fig: zmf, pimf, smf

There is a very wide selection to choose from when youre selecting your favorite membership function. And the Fuzzy Logic also allows you to create your own membership functions if you find this list too restrictive. On the other hand, if this list seems bewildering, just remember that you could probably get along very well with just one or two types of membership functions, for example the triangle and trapezoid functions. The selection is wide for those who want to explore the possibilities, but exotic membership functions are by no means required for perfectly good fuzzy inference systems.

Fuzzy Logic | Page - 58

Manual Methods for Determining Membership Functions


There are various statistical techniques for determining the membership functions. Watanabe asserts that these fall into two broad categories: use of frequencies or by direct estimation. Put simply, the frequency method obtains a membership function by measuring the percentage of people in a group (typically experts in a particular domain) who answer yes to a question about whether an object belongs to a particular set. Direct estimation methods take a different approach by asking experts to grade an event on a scale. Watanabe conducted some experiments on the two approaches and concluded that the use of direct estimation methods is the preferred route of the two. These two methods are covered by Turksen [31] when he reviews the various methods and research into the acquisition of membership functions. In particular he considers four different approaches: direct rating, polling, set valued tatistics and reverse rating.

Automatic Methods for Determining Membership Functions


The automatic generation of membership functions covers a wide variety of different approaches. Essentially what makes automatic generation different from the manual methods is that either the expert is completely removed from the process or the membership functions are fine-tuned based on an initial guess by the expert. To further confuse matters, certain control applications are improved by this fine tuning happening in real time. It is therefore difficult to categorise the different methods. For the purposes of this report the categorisation will be by technique used rather than application or method. As described earlier, the emphasis is on the use of modern soft computing techniques (in particular genetic algorithms and neural networks), however mention is made, where appropriate, of other approaches.

Membership Functions and Decision Models


When building up a fuzzy system the key features to produce an effective system are the definition of opportune fuzzy sets and rules, but when a fuzzy set is defined we have to formalise its membership function. This step is very critical and it considerably affects the
Fuzzy Logic | Page - 59

performance of the whole system. Unfortunately formal methods to determine the most appropriate functions dont exist, so their definition is left to heuristic considerations depending on the problem. In the following part we describe how I define the opportune membership functions of the fuzzy set A = Estimations with low errors

To define such a function the following considerations have been carried out: 1. A(x) takes as argument an error estimation 2. A(0) = 1 3. A(x) has to be monotonically decreasing 4. A(x) = 0 , for x tending to infinite 5. A(x) has to satisfy a decision model The last heuristic is very important because it is essential to define the membership function. In this way four criteria, to which correspond different membership functions, have been defined. All these criteria can easily be visualised in a n-dimensional space in which the axes represent the errors committed by the n models.

The second and the third criteria are parametric and the user can experiment with the behaviour of the criteria by changing the value of the parameter on which they depend. The values of the parameters are shown normalized between 0 and 1. The resulting drawn figure represents the section of a three dimensional space with a plane f(x,y)=k in which the function f is the centre of gravity function for defuzzification. In such a space the red area represents the choice of an estimation, the blue area represents the choice of the other estimation, the green area represents the uncertainty zone in which the average is performed, the black curves represent the place of the points in which the same decision has been taken. Such curves have been named iso-decisional curves. In the figure the reader has to suppose a conventional system of axes with the origin in the lower left corner in which each axis represents the increasing error of one estimation. From experimental results and from a theoretical point of view the Linear Divergent model has demonstrated to be the best and hence for the fuzzy set A = Estimations with low errors we adopted as membership function the equation which corresponds with the Linear Divergent decision model. A(x) = a/(a+x)

Fuzzy Logic | Page - 60

Determining the Membership Functions


As described earlier, a fuzzy set is fully defined by its membership function. How best to determine the membership function is the first question that has to be tackled. For most control applications the sets that will have to be defined are easily identifiable. For other applications they will have to be determined by knowledge acquisition from an expert or group of experts. Once the names of the fuzzy sets have been established, one must consider their associated membership functions.

Fuzzy logic is a superset of conventional (Boolean) logic that has been extended to handle the concept of partial truth -truth values between completely true and completely false. It was introduced by Dr. Lotfi Zadeh of UC/Berkeley in the 1960s as a means to model the uncertainty of natural language. (Note: Lotfi, not Lofti, is the correct spelling of his name.)

Zadeh says that rather than regarding fuzzy theory as a single theory, we should regard the process of fuzzification as a methodology to generalize ANY specific theory from a crisp (discrete) to a continuous (fuzzy) form. Thus recently researchers have also introduced fuzzy calculus, fuzzy differential equations, and so on.

Fuzzy Subsets
Just as there is a strong relationship between Boolean logic and the concept of a subset, there is a similar strong relationship between fuzzy logic and fuzzy subset theory.

In classical set theory, a subset U of a set S can be defined as a mapping from the elements of S to the elements of the set {0, 1}, U: S {0, 1} This mapping may be represented as a set of ordered pairs, with exactly one ordered pair present for each element of S. The first element of the ordered pair is an element of the set S, and the second element is an element of the set {0, 1}. The value zero is used to represent non-membership, and the value one is used to represent membership. The truth or
Fuzzy Logic | Page - 61

falsity of the statement x is in U is determined by finding the ordered pair whose first element is x. The statement is true if the second element of the ordered pair is 1, and the statement is false if it is 0. Similarly, a fuzzy subset F of a set S can be defined as a set of ordered pairs, each with the first element from S, and the second element from the interval [0,1], with exactly one ordered pair present for each element of S. This defines a mapping between elements of the set S and values in the interval [0,1].

The value zero is used to represent complete non-membership, the value one is used to represent complete membership, and values in between are used to represent intermediate DEGREES OF MEMBERSHIP. The set S is referred to as the UNIVERSE OF DISCOURSE for the fuzzy subset F. Frequently, the mapping is described as a function, the MEMBERSHIP FUNCTION of F. The degree to which the statement is true is determined by finding the ordered pair whose first element is x. The DEGREE OF TRUTH of the statement is the second element of the ordered pair. x is in F

In practice, the terms membership function and fuzzy subset get used interchangeably.

Thats a lot of mathematical baggage, so heres an example. Lets talk about people and tallness. In this case the set S (the universe of discourse) is the set of people. Lets define a fuzzy subset TALL, which will answer the question to what degree is person x tall? Zadeh describes TALL as a LINGUISTIC VARIABLE, which represents our cognitive category of tallness. To each person in the universe of discourse, we have to assign a degree of membership in the fuzzy subset TALL. The easiest way to do this is with a membership function based on the persons height.

Note: Membership functions used in most applications almost never have as simple a shape as tall(x). At minimum, they tend to be triangles pointing up, and they can be much more complex than that. Also, the discussion characterizes membership functions as if they always are based on a single criterion, but this isnt always the case, although it is quite common. One could, for example, want to have the membership function for TALL depend on both a persons height and their age (hes tall for his age). This is perfectly legitimate, and occasionally used in practice. Its referred to as a two-dimensional membership function, or a
Fuzzy Logic | Page - 62

fuzzy relation. Its also possible to have even more criteria, or to have the membership function depend on elements from two completely different universes of discourse.

Logic Operations
Now that we know what a statement like X is LOW means in fuzzy logic, how do we interpret a statement like X is LOW and Y is HIGH or (not Z is MEDIUM) The standard definitions in fuzzy logic are: truth (not x) = 1.0 - truth (x) truth (x and y) = minimum (truth(x), truth(y)) truth (x or y) = maximum (truth(x), truth(y))

Some researchers in fuzzy logic have explored the use of other interpretations of the AND and OR operations, but the definition for the NOT operation seems to be safe. Note that if you plug just the values zero and one into these definitions, you get the same truth tables as you would expect from conventional Boolean logic. This is known as the EXTENSION PRINCIPLE, which states that the classical results of Boolean logic are recovered from fuzzy logic operations when all fuzzy membership grades are restricted to the traditional set {0, 1}. This effectively establishes fuzzy subsets and logic as a true generalization of classical set theory and logic. In fact, by this reasoning all crisp (traditional) subsets ARE fuzzy subsets of this very special type; and there is no conflict between fuzzy and crisp methods. Some examples -assume the same definition of TALL as above, and in addition, assume that we have a fuzzy subset OLD defined by the membership function: old (x) = { 0, if age(x) < 18 yr. (age(x)-18 yr.)/42 yr., if

18 yr. <= age(x) <= 60 yr. 1, if age(x) > 60 yr. }

And for compactness, let a = X is TALL and X is OLD b = X is TALL or X is OLD c = not (X is TALL)

Fuzzy Logic | Page - 63

Fuzzy Logic | Page - 64

Possibility Theory
Possibility theory is a new form of information theory that is related to but independent of both fuzzy sets and probability theory. Technically, a possibility distribution is a normal fuzzy set (at least one membership grade equals 1). For example, all fuzzy numbers are possibility distributions. However, possibility theory can also be derived without reference to fuzzy sets.

The rules of possibility theory are similar to probability theory, but use either MAX/MIN or MAX/TIMES calculus, rather than the PLUS/TIMES calculus of probability theory. Also, possibilistic NONSPECIFICITY is available as a measure of information similar to the stochastic ENTROPY.

Fuzzy set theory has at least two advantages:


It allows imprecise knowledge to be modelled, such that an approximation of a numerical value (about 3.80 meters), or a vague information expressed, for instance in natural language (high). Very few methodologies allow this sort of modelling. It is the only way to deal, within the same framework, with knowledge numerically provided by measuring devices, and knowledge symbolically expressed by a human observer for instance.

However, fuzzy set theory does not allow imprecision and uncertainty to be handled with the same formalism. But these two types of imperfection in knowledge are closely linked, if only because, in many cases, the more accuracy is required for the terms of an assertion, the less certain becomes the assertion.

The following example of conversation illustrates this concept: - How old is he? - About twenty - Are you sure? - Absolutely!
Fuzzy Logic | Page - 65

- This is really imprecise! - Well, in fact, I think he is 31, but I am not sure.

Moreover, a reasoning based on imprecise knowledge often generates uncertainties on the final decision that must be taken.

The following reasoning illustrates this problem: 1. Being over 18, makes one eligible to vote. 2. We know that Peter is about 18, is he allowed to vote? 3. It is quite possible, but not certain.

Possible and Expected Solution Sets

Possibility theory was introduced in 1978 by L.A. Zadeh [Zadeh, 1978], in connection with the fuzzy set theory, to allow a reasoning to be carried out on imprecise or vague knowledge, making it possible to deal with uncertainties on this knowledge.

The developments of this introduction constitute a method of formalizing nonprobabilistic uncertainties on events. I.e. a means of assessing to what extent the occurrence of an event is possible and to what extent we are certain of its occurrence, without, however, knowing the evaluation of the probability of this occurrence. This can happen, for instance, when there is no similar event to be referred to.

Fuzzy Logic | Page - 66

Example Suppose that we ask the following question: Will Mr. Manojit be at his office on Monday 6th January?

To answer this question, it is difficult to know if we must take into account: 1. what Mr. Manojit did every previous Monday, or 2. what he does the first Monday of the month, or 3. the first Monday of the year, or 4. what he uses to do on January, and so on. The uncertainty of an event is described in possibility theory at the same time : by the degree of possibility of this event and by the degree of possibility of the opposite event

These two degrees are only slightly related.

Possibility allows the representation of both the inaccuracy (as fuzzy subsets) and the quantification of uncertainty (as a pair of numbers possibility-necessity).

Comparison between Possibility and Probability


Possibility and necessity measures, like probability measures, constitute tools to represent uncertainty.

Their properties are different, but they are however comparable. In the same way, the properties of possibility distributions can be compared with the properties of probability distributions: probability measures summarize a body of precise and varied knowledge, while possibility measures reflect a vague but coherent knowledge.

Fuzzy Logic | Page - 67

The possibility functions are more natural for the representation of the feeling of incertitude: very precise information is not expected absolutely from someone, but we do hope for the greatest possible coherence in his remarks. On the other hand, precise but fluctuating data more usually result from the observation of a physical phenomenon. Probability on the one hand, and possibility-necessity on the other hand, correspond to two extreme, therefore ideal situations. Table 17 shows the main points of comparison. It can be seen that the identities have a similar form. The differences arise from the fact that any addition in probability theory is replaced, in possibility theory, by a maximum, and that any product is replaced by a minimum. Identical properties are subjected to fewer constraints in possibility theory than in probability theory. Moreover, the values of measures and distributions are selected with more freedom in the case of possibility than in the case of probability.

Fuzzy Logic | Page - 68

Biblical References
J.F. Baldwin, Fuzzy logic and fuzzy reasoning, in Fuzzy Reasoning and Its Applications, E.H. Mamdani and B.R. Gaines (eds.), London: Academic Press, 1981. Selected References on Fuzzy Set Theory Generally & Ai Applications An Introduction to Fuzzy Logic and Fuzzy Sets Series: Advances in Soft Computing Buckley, James J., Eslami, Esfandiar 2002, X, 285 pp. 50 figs., 14 tabs., Softcover ISBN: 3-7908-1447-4 Jain, R. Fuzzyism and real world problems. In P.P. Wang & S.K. Chang (Eds.), Fuzzy Sets, New York: Plenum Press. Zadeh, L.A. (1965) Fuzzy sets. Information and Control, Vol. 8, pp. 338-353. Zadeh, L.A. (1978) PRUF - A meaning representation language for natural languages. International Journal of Man-Machine Studies, Vol. 10, pp. 395-460. Zadeh, L.A. (1983) The role of fuzzy logic in the management of uncertainty in expert systems. Memorandum No. UCB/ERL M83/41, University of California, Berkeley. K. T. Atanassov, Intuitionistic fuzzy sets, Fuzzy Sets and Systems, v.20 n.1, p.87-96, August 1986. Bargiela and W. Pedrycz, Granular Computing, Kluwer Academic Publishers, 2002. Bardossy and L. Duckstein, Fuzzy Rule-Based Modelling with Application to Geophysical, Biological and Engineering Systems, CRC Press, 1995. S. Benferhat, D. Dubois, S. Kaci and H. Prade, Bipolar possibility theory in preference modeling: Representation, fusion and optimal solutions. Information Fusion, an International Journal on Multi-Sensor, Multi-Source Information Fusion, 2005. D. Dubois and H. Prade, Possibility Theory, Plenum Press, New York, 1988. D. Dubois and H. Prade (eds.), Fuzzy Information Engineering: A Guided Tour of Applications, John Wiley and Sons, 1996. J. A. Goguen, L-fuzzy sets, J. Math. Anal. Appl. 18, 145-174, 1967.

Fuzzy Logic | Page - 69

J. A. Goguen, The logic of inexact concepts, Synthese, Vol. 19, 325-373, 1969. P. Hajek, Metamathematics of Fuzzy Logic; Trends in Logic, Kluwer Academic Publishers, Dordrecht, Vol. 4, 308 pp., 1998.

E. P. Klement, R. Mesiar and E. Pap, Triangular Norms, Trends in Logic, Vol. 8, 2000. E. H. Mamdani and S. Assilian, An experiment in linguistic synthesis with a fuzzy logic controller, International Journal of Man-Machine Studies, Vol. 7, 1-13, 1975. J. Mendel, Uncertain Rule-Based Fuzzy Logic Systems: Introduction and New Directions, Prentice Hall, New Jersey, 2000. V. Novak, I. Perfilieva and J. Mockor, Mathematical principles of fuzzy logic, Kluwer, Boston/Dordrecht, 1999. V. Novak and I. Perfilieva (eds.), Discovering the World with Fuzzy Logic; Studies in fuzziness and soft computing, Heidelberg, New York: Physica-Verlag, Vol. 57, 302-304, 2000. W. Pedrycz and F. Gomide, An Introduction to Fuzzy Sets. Analysis and Design. MIT Press, Cambridge, MA, 1998. T. Y. Lin, Granular Computing: From rough sets and neighborhood systems to information granulation and computing in words, European Congress on Intelligent Techniques and Soft Computing, 1602-1606, 1997. W. Pedrycz and F. Gomide, Introduction to fuzzy sets, MIT Press, Cambridge, MA, 1998. E. Turunen, Mathematics Behind Fuzzy Logic, Physica-Verlag Heidelberg New Your, 1999.

Fuzzy Logic | Page - 70

You might also like