Lecture 2: Fuzzy Expert Systems - PowerPoint PPT Presentation

1 / 57
About This Presentation
Title:

Lecture 2: Fuzzy Expert Systems

Description:

1. Nature of Inexact Knowledge. 1.1 General Description (Importance) ... Often, human needs to manipulate data, which are not precisely specified. ... – PowerPoint PPT presentation

Number of Views:259
Avg rating:3.0/5.0
Slides: 58
Provided by: cyr11
Category:

less

Transcript and Presenter's Notes

Title: Lecture 2: Fuzzy Expert Systems


1
Lecture 2 Fuzzy Expert Systems
2
Outline
  • Nature of Inexact Knowledge
  • System Description
  • Inference Engine
  • Linguistic Approximation
  • Sample Cases
  • Conclusion

3
1. Nature of Inexact Knowledge
  • 1.1 General Description (Importance)
  • Much human knowledge is vague and imprecise
  • Often, human needs to manipulate data, which are
    not precisely specified.
  • Lack of tools to perform precise measures
  • Impossible to specify precisely
  • e.g.
  • Approximately 20 strokes
  • Human fuzzy concepts
  • Reliability of information
  • Similar experience
  • Expert opinions
  • Incomplete information

4
1.1 General Description (Importance)
  • 1.1 General Description (Importance) (Cont)
  • Provide a better interface between human and
    computer
  • In knowledge-based systems, there are two common
    causes of uncertain information (fuzziness
    uncertainty)

5
1.2 Fuzziness Uncertainty
  • 1.2.1 Uncertainty (how sure about the
    information)
  • Occurs when a piece of information is not
    absolutely certain
  • Usually represented by a numerical value
  • e.g.
  • X is a bird (0.8) ? it indicates the uncertainty
    ranges from 1 to 1
  • If x is a bird then it can fly (0.9) ? it
    indicates the uncertainty in the degrees of
    association

6
1.2 Fuzziness Uncertainty
  • 1.2.2 Fuzziness (impreciseness of information)
  • Occurs when the boundary of a piece of
    information is not clear cut
  • Examples of fuzzy terms
  • John is young
  • If price is high then profit should be good

7
1.2 Fuzziness Uncertainty
  • 1.2.3 Both the uncertainty and fuzziness may
    occur simultaneously in some situations.
  • e.g.
  • John is tall. (0.8)
  • If price is high then profit should be good. (0.9)

8
1.2 Fuzziness Uncertainty
  • 1.2.4 Sometimes even the uncertainty can also be
    fuzzy
  • e.g.
  • John is heavy (around 0.7).
  • heavy is a fuzzy term and around 0.7 is a fuzzy
    uncertainty.

9
1.3 Different Approaches to Deal with Inexact
Knowledge
  • 1.3.1 Bayesian approach (deal with uncertainty)
  • Difficult to collect all the prior, conditional
    and joint probabilities required.
  • All possible outcomes must be disjoint
  • Depends on the availability

10
1.3 Different Approaches to Deal with Inexact
Knowledge
  • 1.3.2 Confirmation Theory (deal with
    uncertainty)
  • Use certainty factor (CF)
  • The CF of the conclusion is obtained through the
    propagation of CFs of the evidence and the rules.

CF MB -MD where MB measure of belief and
MD measure of disbelief
e.g. If X is a bird then it can fly S1
(CF0.9) Now suppose X is a bird
(CF0.8) Then conclusion (h)
It can fly (CF 0.80.9
0.72)
11
1.3 Different Approaches to Deal with Inexact
Knowledge
  • Evidence Combination
  • If another rule S2 also supports the same
    conclusion with CF0.85, the two CFs will be
    combined to give an overall estimate of
    certainty. The formula is

MBh, S1?S2 MBh, S1 MBh, S2 (1-MBh,
S1) CF1 CF2 (1 - CF1)
CF1 CF2 - (CF1 CF2)
? the overall certainty is 0.72
0.85 (1- 0.72) 0.96
  • Do not require a large volume of statistical
    data
  • Potentially applicable to many other areas
  • Can be applied recursively with more CFs

12
1.3 Different Approaches to Deal with Inexact
Knowledge
  • 1.3.3 Certainty Factors
  • Can only deal with uncertainty
  • Eliminate the need of prior probabilities
  • Adopted in many shells (e.g. EMYCIN, S1)

13
1.3 Different Approaches to Deal with Inexact
Knowledge
  • 1.3.4 Dempster Shafer Theory of Evidence
  • Can only deal with uncertainty
  • Involve a large amount of computation
  • Becomes very complex when the inference chain is
    long

14
1.3 Different Approaches to Deal with Inexact
Knowledge
  • 1.3.5 Fuzzy Logic
  • Can handle fuzziness
  • Fuzzy sets to represent fuzzy concepts
  • e.g. Tall

15
1.3 Different Approaches to Deal with Inexact
Knowledge
  • Fuzzy sets defining Tall
  • Some fuzzy expressions (e.g. very tall and
    quite tall) can also be represented by fuzzy
    sets obtained by applying arithmetic operations
    on the basic fuzzy set (i.e. fuzzy set of tall)
  • Can handle approximate (fuzzy) reasoning

16
2. System Description
  • 2.1 General Description
  • An expert system building tool (shell), code
    named Z-II, (FLESS, Dovala), capable of handling
    two kinds of inexact knowledge fuzziness and
    uncertainty
  • Domain knowledge expressed in rules and facts

17
2.1 General Description (Cont)
  • Any mix of fuzzy or normal terms in rules
  • Non-fuzzy antecedent and non-fuzzy consequence
  • e.g. If the sex is male then the code should be 1
  • Fuzzy antecedent and fuzzy consequence
  • e.g. If the price is quite high then the profit
    should be rather good
  • Non-fuzzy antecedent and fuzzy consequence
  • If you are a CUHK student then you are clever
  • Fuzzy antecedent and non-fuzzy consequence
  • If you are tall then you will be accepted as a
    fireman

18
2.1 General Description (Cont)
  • Fuzzy or normal uncertainty for rules / facts
  • e.g. If the price is quite high then the profit
    should be rather good.
  • With certainty ? around 0.8
  • Z-II interprets the knowledge base and gathers
    relevant data by asking questions automatically
    during consultation
  • Programming environment
  • PC using C
  • Windows

19
2.1 General Description (Cont)
20
2.2 Knowledge Representation
  • 2.2.1 Object
  • E.g. Tom is tall
  • Basic entity in the system
  • Instantiate to single or multiple values during
    consultation
  • Possess a number of predefined slots - specifying
    the properties of the object.

21
2.2 Knowledge Representation
  • 2.2.1 Object (Cont)
  • E.g.

22
2.2 Knowledge Representation
  • 2.2.2 Fuzzy Terms (Fuzzy Term Management Module)
  • Fuzzy term/expressions can be involved in rules
    facts
  • Modelled by fuzzy sets
  • Knowledge engineers give the fuzzy set
    representing the basic fuzzy concept
  • Defaults fuzzy sets are provided
  • FLESS generates the fuzzy sets representing the
    fuzzy terms/expressions based on fuzzy logic
    operators.
  • e.g. "very tall" - taking the square of each
    possibility values of the fuzzy set representing
    "tall"
  • A fuzzy set implemented by a list of numbers.
    (interpolation)

23
2.2 Knowledge Representation
  • 2.2.3 Fuzzy Uncertainty
  • Fuzzy uncertainty like around 0.8, close to
    1.0 modeled by fuzzy numbers
  • Fuzzy number a real number fuzzy set which is
    both convex and normal
  • Fuzzy number can perform arithmetic operations
    (e.g. addition, multiplication) to give another
    fuzzy number as the result

24
2.2 Knowledge Representation
  • 2.2.3.1 Fuzzy Number Arithmetic
  • Fuzzy number addition ()

Max(Min(.))
  • Fuzzy number subtraction (-)
  • Fuzzy number multiplication ()

25
2.2 Knowledge Representation
  • 2.2.3.1 Fuzzy Number Arithmetic (Cont)
  • Fuzzy number division (/)
  • Minimum of fuzzy number min_fn
  • Maximum of fuzzy number max_fn

26
2.2 Knowledge Representation

where
  • In Z-IIe, fuzzy numbers are assumed generally to
    be trapezoidal and implemented as a list of 4
    numbers.
  • Trapezoidal fuzzy numbers are adequate to
    capture the fuzzy uncertainties in human
    intuition.
  • The above fuzzy arithmetic operations can handle
    this approximate representation of fuzzy numbers.

27
2.2 Knowledge Representation
  • 2.2.3.1 Fuzzy Number Arithmetic (Cont)

Examples Consider the following numeric example,
with a fuzzy number in N
28
()
mC(1) (0 ?0.3) ? (0 ?0.1) 0 mC(2)(0 ?0.6) ?
(0.1 ?0.3) ? (0.3 ?0) 0.1 mC(3)(0 ?1) ? (0.1
?0.6) ? (0.3 ?0.3) ? (0.8 ?0) 0.3
C A () B
29
mC(1) (0 ?0.3) ? (0 ?0.1) 0 mC(2)(0 ?0.6) ?
(0.1 ?0.3) ? (0.3 ?0) 0.1 mC(3)(0 ?1) ? (0.1
?0.6) ? (0.3 ?0.3) ? (0.8 ?0) 0.3
C A () B
30
e.g. mAB(8)max(m(24), m(2. 3. ),
.) where m(24) min(1, 1), min(m (2.) m
(3.)lt 1, )
The calculations of ABC are as follows mC(1)
(0 ?0.3) ? (0 ?0.1) 0 mC(2)(0 ?0.6) ? (0.1
?0.3) ? (0.3 ?0) 0.1 mC(3)(0 ?1) ? (0.1 ?0.6)
? (0.3 ?0.3) ? (0.8 ?0) 0.3


slightly convex
slightly concave
Approximation using 3 point calculations is good
enough
31
2.2 Knowledge Representation
  • 2.2.4 Rules
  • A rule is antecedent propositions implies ?
  • consequent propositions (fuzzy/normal
    uncertainty)
  • allows multiple propositions in antecedent and
    consequent parts
  • the body is an object and well-built is a value
    (fuzzy)
  • Any mix of fuzzy and normal propositions

( proposition ) e.g. rule 01
IF (the body is well-built OR the height is
tall) AND the person is healthy THEN the
weight of the person is heavy WITH CERTAINTY ?
close to 1.0
32
2.2 Knowledge Representation
  • 2.2.5 System Properties Management Module
  • Chaining Method forward, backward
  • Inference Relation Rs Rg Rsg
  • Threshold Value
  • Goals
  • Fact Manager (Review Management Module)
  • Facts How
  • What if Why
  • Object Manager
  • Type
  • Fuzzy
  • Single Valued
  • Multiple Valued
  • Yes No
  • Numeric
  • Variable

33
3. Inference Engine
  • 3.1 Reasoning Chain
  • Backward reasoning (chaining) during consultation
  • A rule
  • Search those rules whose consequent propositions
    have the goal object (by UPDATED-BY-RULES slot of
    the goal object)

Rule_01 IF (the body is well-built OR he height
is tall) AND the person is healthy THEN the
weight of the person is heavy A goal object The
weight of the person (PERSON WEIGHT)
34
3.1 Reasoning Chain (Cont)
  • History Tree (reasoning tree) is built
  • forward evaluation (based on fuzzy logic) if the
    objects involve fuzzy concepts.

heavy
healthy
tall
well-built
35
3.2 Rule Evaluation
  • Rule Evaluation
  • If A is non-fuzzy (V1V1)
  • V2V2
  • FN3FN1FN2 where is multiplication of two
    fuzzy numbers.

36
3.2 Rule Evaluation
  • If A is fuzzy and C is fuzzy
  • Let F1 and F2 be fuzzy sets representing V1 and
    V2 respectively
  • A fuzzy relation R formed by taking
    some operators on F1 and F2
  • Let F1 and F2 be fuzzy sets representing V1
    and V2 respectively
  • F2 F1 o R where o is fuzzy
    composition
  • FN3 FN1 FN2
  • If A is fuzzy and C is non-fuzzy
  • V2 V2
  • Let F1 and F1 be fuzzy sets representing V1 and
    V1 respectively
  • FN3FN1FN2 M
  • where M is the similarity between
    F1 and F1

37
(No Transcript)
38
3.2 Rule Evaluation
(iv) If A is non-fuzzy numeric, a
fuzzy COMPARISON can be used by setting
V1 to a fuzzy number.
FN3FN1FN2 D where D is the Degree
of Matching
39
3.2.1 Fuzzy comparisons
  • Consider the following rule
  • IF body weight ? 80
  • THEN over-weight is true
  • WITH CERTAINTY ?1.0
  • This rule will not be fired even the following
    fact is established
  • Body weight is 79.5

40
3.2.1 Fuzzy comparisons
  • Z-II allows fuzzy comparisons exemplified by the
    following rule in ABVAB
  • e.g.
  • RULE-CODE weight S10
  • IF body weight ? 70 80
  • THEN over-weight is true
  • WITH CERTAINTY ? 1.0
  • If there is a fact like
  • body weight is y 75
  • The degree of matching of this fact and the
  • antecedent of rule weight s-10 is shown as
  • follows

Degree of Matching, D 0.5 FNconclusion FN1
FN2 D
41
Other types of fuzzy comparisons
lt with 2 numbers e.g. If A lt a1, a2
gt with 2 numbers e.g. If A lt a1, a2
with a range of numbers e.g. If A a1, a2
with a triangle fuzzy number e.g. If A a1,
a2, a3
42
Other types of fuzzy comparisons
with a trapezoidal fuzzy numbers e.g. If A
a1, a2, a3, a4
lt gt with a range of fuzzy number
lt gt with a triangle fuzzy number
lt gt with a trapezoidal fuzzy number
43
3.2.2 Uncertainty Propagation
  • the uncertainty (modeled by fuzzy number) is
    manipulated using formula in confirmation theory
  • e.g.
  • if X is a bird then it can fly (around 0.9)
  • X is a bird (very close to 0.7)
  • Conclusion it can fly (quite close to 0.63)

44
3.2.3 Compound Propositions
  • compound propositions involving ANDs, ORs are
    considered in the antecedents of rules.
  • e.g.
  • IF a man is tall and his body is fat
  • THEN his weight is heavy (around 0.9)
  • A man is very tall (near 0.8)
  • His body is very fat (near 0.7)
  • Conclusion his weight is very heavy
  • (around 0.63)

OR Max_fn
45
3.2.4 Other Features in Rules
  • V1 V2 can be a system or external function or
    expression.
  • Each proposition can have a weight and / or
    threshold value.
  • E.g.
  • (rule x8a
  • If (((sfield is yes 0.25 CF0.2)
  • and (skill is good 0.75)
  • or (accounting is good))
  • then Faculty is business)
  • Certainty is about 0.8

46
3.2.4 Other Features in Rules
  • Examples (Cont)
  • (rule 9a
  • If (mathsmark gt mean (classroom.dbf, (db3
    file), math))
  • then maths is good)
  • Certainty is 0.9
  • (rule 9b
  • If (use_dbf is yes)
  • then english _getengval( ) )

system functions abs, cos, exp, tan, freq, log,
log10, max, mean, min, pow, rms, sin, sqrt,
standv, sum
47
3.3 Rules with Multiple Propositions
(i)
48
3.3 Rules with Multiple Propositions
(i)
  • FNc (min_fn(FN1, FN2)) FNR
  • AND
  • where
  • min_fn taking minimum of two fuzzy
    members
  • Multiplication of two
    fuzzy numbers

49
3.3 Rules with Multiple Propositions
Example IF (A1 OR A2) AND A3 THEN C where A1,
A2, A3 and C are propositions Given facts A1,
A2 and A3
50
3.4 Evidences Combination
where C conclusion from R1 A1 C
conclusion from R2 A2
  • The overall uncertainty FNR for CR
  • FNR FN1 FN2 (FN1 FN2)
  • where
  • fuzzy number addition
  • - fuzzy number subtraction
  • fuzzy number multiplication

51
4. Linguistic Approximation
  • The possibility distribution of each linguistic
    value can be uniquely identified by its
    imprecision (area) and location (center of
    gravity).
  • Thus given the imprecision and the location
    of a fuzzy set, the corresponding linguistic
    value can be matched and selected.

52
4.1 Linguistic Approximation for Fuzzy Certainty
Factors
Figure 3. Linguistic approximation table for
fuzzy certainty factors.
The one closest to the fuzzy number in this table
is selected and the word certain is appended
after the linguistic term. For instance
53
4.1 Linguistic Approximation for Fuzzy Certainty
Factors
  • This linguistic approximation table is determined
    with the aid of linguistic experts who judge the
    certainty and impression of each hedge chosen
    in Figure 3.
  • When Z-II presents the conclusion to end users,
    the associated fuzzy certainty factors can be
    given in either or both types of linguistic
    expressions. The first type gives a more exact
    information while the second one conveys a more
    natural expression. (see the SAMPLE CONCLUSION
    section)

54
5. Sample Case
  • a sample expert system has been successfully
    built
  • some examples of rules

RULE CODE r1 IF your interest in reading science
book OR magazine is high THEN your interest in
pure science is high WITH CERTAINTY ? 0.9 RULE
CODE r2 IF the overall examination performance
for engineering is good THEN the choice of a
university faculty should be engineering WITH
CERTAINTY ?around 0.8 RULE CODE r3 IF the mark
obtained for Use of English Test lt50 60 THEN the
result of English is bad WITH CERTAINTY ?around
1.0 RULE CODE r4 IF the result of physics is
very good AND the result is mathematics is
good THEN the overall examination performance for
engineering is good WITH CERTAITY ? 1.0
55
5.1 Sample Conclusion
My recommendations for the choice of a
university faculty are given in preference
order as follows- It is very certain (0.97)
that the choice of faculty is pure science. It
is quite certain (0.87) that the faculty of
engineering. It is almost certain (close to
0.78) that the faculty of arts. It is rather
certain (about 0.76) that the medicine. It
is indeed certain (0.9) that the chance of
entering pure science faculty is fuzzily very
high.
56
5.1 Sample Conclusion
  • Review Management Module
  • A review on the case data (facts) can be made at
    any time during consultation. The users may
    decide to modify some case data after a review.
    The Review Management Module provides routines to
    monitor and trace the relevant rules and facts.
  • Responsible for tracing the reasoning chain when
    explanations are required. Provides explanations
    to mainly 2 types of requests
  • (1) WHY a fact is required by the system
  • (2) HOW a fact is established.
  • Their implementations are based on analyzing the
    history tree built.
  • Finally, this module can handle WHAT IF
    reviews, which find out WHAT conclusions will be
    deducted IF facts are changed.

57
The End
Write a Comment
User Comments (0)
About PowerShow.com