• No se han encontrado resultados

“Modeling Growth of Escherichia coli O157:H7 in fresh-cut lettuce treated with Neutral Electrolyzed Water and under

In this section we present a brief review of fuzzy logic. However, we encourage the reader to refer to a textbook on the subject [JS97, Neg04] for further information. Fuzzy logic is an extension of classical (binary) logic that uses a continuous range of truth degrees in the real interval [0, 1], rather than the strict values of 0 and 1. In order to introduce fuzzy logic, first we define the concept of fuzzy sets.

34

3.2.1 Fuzzy Sets

A fuzzy set is a set whose elements have degrees of membership in the real interval [0, 1].

In classical set theory, an element either belongs to a set or not. The membership of an element x in a set A, in classical logic, is defined by an indicator function (a.k.a.

characteristic function). The value of the indicator function is 1 when x  A, and 0 when x

 A. In fuzzy logic, the degree of membership of an element in a set is indicated by a value in the real interval [0, 1]. This extension allows the gradual assessment of the membership of elements in a set.

The function that defines the degree of membership of an element x in a set A is mA(x), and therefore we denote the fuzzy set by the pair (A, mA(x)), or A(x) for short.

Example. Let x be the orientation (in degrees) of a 2D shape S. We can define the fuzzy sets HORIZONTAL and VERTICAL on x by the triangular membership functions as given in Figure 3.1.

(a) Membership function for the set horizontal (b) Membership function for the set vertical Figure 3.1 Examples of membership functions defined on variable orientation.

When the orientation x is 0° or 180°, it is fully included in the fuzzy set HORIZONTAL, and it is not included in the set VERTICAL. When x is 90°, it is fully included in the set

1

0 45 90 135 180 HORIZONTAL

0 45 90 135 180 1

VERTICAL

35

VERTICAL, and not included in the set HORIZONTAL. For these three values (0°, 90°, 180°), the memberships can be defined by the classical notion of set as well. However, when x is 22.5° for example, then its degree of membership to the set HORIZONTAL is 0.5, which can be interpreted as somewhat horizontal in linguistic terms.

3.2.2 Fuzzy Operators

The basic operations defined on crisp sets, namely intersection (AND), union (OR) and complement (NOT), can be generalized to fuzzy sets. The generalization to fuzzy sets can be achieved in more than one possible way. The most widely used fuzzy set operations that we will use in this work are called standard operations. The three standard fuzzy operations are standard fuzzy intersection, standard fuzzy union, and standard fuzzy complement.

Let A(x) and B(x) denote two fuzzy sets, that is the degree to which x belongs to A is mA(x), and the degree to which x belongs to B is mB(x).

The standard fuzzy complement for set A(x) denoted by cA(x) is defined as 1 – mA(x).

The standard fuzzy intersection for two set A(x) and B(x) denoted by (A ∩ B)(x) is defined as min[ mA(x), mB(x) ].

The standard fuzzy union for two set A(x) and B(x) denoted by (A ∪ B)(x) is defined as max[ mA(x), mB(x) ].

36

3.2.3 Fuzzy Rules

In fuzzy logic, we represent logic rules by a collection of IF-THEN statements. Each statement has the general form of IF P THEN Q, where the antecedent P is a single or compound fuzzy assignment statement, and so is Q. A single assignment statement has the general form of “x is Ai” and a compound assignment statement is constructed from single assignments and set operations for example “orientation is HORIZONTAL AND height is HIGH”. As can be seen, fuzzy rules facilitate the representation of linguistic rules. In order to make the representation of such rules even easier, we use fuzzy hedges, which are equivalent of the adverbs in natural languages. The most common types of fuzzy hedges are “very” and “somewhat” which are defined as follows. Let (A, mA(x)) denote a fuzzy set defined on the universe of discourse x, then:

[ ]

2

Of course there is more than one possible way to define these hedges. The purpose of

“very” is to concentrate the membership function, the purpose of “somewhat” is to dilate the membership function.

3.2.4 Fuzzy Inference System

The process of definition of the mapping from a given set of inputs to a set of outputs using fuzzy logic is called fuzzy inference. The relation between the set of inputs and

37

outputs is defined by fuzzy IF-THEN rules as explained in the previous section. The set of fuzzy rules combined with a method of fuzzy inference is called Fuzzy Inference System (FIS). There are two major types of FIS systems: Mamdani-type and Sugeno-type, of which the former one is the most commonly used and the one that we use in this work.

Mamdani’s inference method is based on “MIN-MAX” operations, therefore sometimes Mamdani’s inference method is referred to as MIN-MAX inference.

The first step in Mamdani’s inference is to compute the degree of membership of each input variable xi to all fuzzy sets that are defined on it. This step is called input fuzzification. Next, we compute the truth degree or the value of antecedent of each rule in the rule base. When P is a single assignment (i.e. orientation is HORIZONTAL), the value of antecedent is simply the value of the corresponding membership function. When P is a compound assignment statement (i.e. orientation is HORIZONTAL AND height is SHORT), the value of antecedent is obtained by applying the MIN (for AND) and MAX (for OR) operators to the truth degrees of each part of P. For example, if the truth degree (i.e. membership value) of “orientation is HORIZONTAL” is 0.7, and the truth degree of

“height is SHORT” is 0.9, then the antecedent value of the rule “IF orientation is HORIZONTAL AND height is SHORT THEN …” is min(0.7, 0.9) = 0.7.

After obtaining the value of antecedent, we compute the consequent membership function for each rule. This process is called fuzzy implication. In Mamdani’s inference, the implication operator is MIN. The MIN operator limits the membership function of the consequent to the value of antecedent. Formally, let P be the antecedent, vP(x) be the value of antecedent, and Q(x)≡(Q,mQ(x)) be the consequent. Then, the membership function of the consequent Q is defined to be min(vP(x), mQ(x)).

38

The next step is to aggregate the conclusions, that are the membership functions of the consequents of all rules in the rule base. In Mamdani’s inference, the aggregation operator is MAX, which is the standard fuzzy union operator. When we have more than one rule defining the relation between the input variables and an output variable, in fuzzy logic, all rules are fired (with different degrees of strength) and hence they collaborate to define the value of the output. As the rules are independent, and they are all equally important, the combination of them is defined as the union. As we mentioned in the previous section, in standard fuzzy, union can be obtained by the MAX operator.

The last step in Mamdani’s inference is defuzzification. Defuzzification is the process of transforming a fuzzy set into a single crisp value. In function approximation or decision problems, the output typically has to be expressed by a single value. For example, in fuzzy-based denoising, we want to eventually decide whether or not a connected component in image is a small noise that needs to be removed. There are many different methods of defuzzification including Center of Gravity (COG), Center of Area (COA), Middle of Maximum (MOM) etc. In this work, we use the COG which is one of the most popular defuzzification methods. Formally, let (A, mA(x)) be a fuzzy set defined on the universe of discourse x, then the defuzzified value of the set A, using the COG method, is defined to be

[

xmA(x)

] [

/

mA(x)

]

, which is the x-coordinate of the center of gravity of the membership function.