II - Cognitive approach

59
1 II - Cognitive approach II - Cognitive approach A - Knowledge representation

description

II - Cognitive approach. A - Knowledge representation. 1 - Representation. People understand the world by building mental models. 2 - Knowledge. - PowerPoint PPT Presentation

Transcript of II - Cognitive approach

Page 1: II - Cognitive approach

1

II - Cognitive approachII - Cognitive approach

A - Knowledge representation

Page 2: II - Cognitive approach

2V 3.19

1 - Representation1 - Representation

People understand the world by building mental models

Page 3: II - Cognitive approach

3V 3.19

2 - Knowledge2 - Knowledge

Knowledge is an abstract concept. To memorize or use a piece of information, it is necessary to represent it. We must use a language. It’s the same for a computer system, in order to memorize and use knowledge, it is necessary to represent it as constructed as possible.

Knowledge representation is necessary to• keep knowledge,• exchange knowledge (to acquire, transmit),• modify knowledge,• use knowledge.

No perfect representation exists, every time it’s a compromise it depends on the field dealt with and the use.

Page 4: II - Cognitive approach

4V 3.19

2.1 - Different levels of knowledge2.1 - Different levels of knowledge

Structure• The carburettor is a part of the engine.

Classification• Bicycle is a kind of means of transportation.

Definition• Prime numbers are only divisible by one and themselves.

Law• The intensity multiplied by the voltage gives the impedance.

Rule• If the engine stops and ignition is correct you must suspect the fuel.

Strategy• When the patient is a child, consider infantile diseases first

Page 5: II - Cognitive approach

5V 3.19

2.2 - Knowledge and reasoning2.2 - Knowledge and reasoning

The transcription of a knowledge into a symbolic language has to allow its utilisation by a reasoning system.Therefore, reasoning associates two overlapped aspects :

• The structure of data representing the problem

• The associated method to use the information. The reasoning mechanism will allow to deduce dynamically new knowledge. Here is a great difference between a database and a knowledge based system. A

database doesn’t give you anything, but the things that have been explicitly taught.

Page 6: II - Cognitive approach

6V 3.19

2.3 - Knowledge representation families2.3 - Knowledge representation families

Page 7: II - Cognitive approach

7V 3.19

First example : the factorial functionFirst example : the factorial function

Figure 2.1 - Factorial function definition, both in procedural and declarative manners

Procedural

Factorial function of a given number : if the number is 1 then it's 1 otherwise it's the multiplication of this number by the factorial of it minus 1.

(de fact (n) (if (= n 1) 1 (* n (fact (- n 1)))))

Declarative

I declare that :

fact(1, 1).

and that :

fact (X, Z) :- fact (X-1, Y) Z is X * Y.

Page 8: II - Cognitive approach

8V 3.19

Second example : Second example : Adjective accordance in FrenchAdjective accordance in French

Figure 2.2 - Adjective accordance

Procedural

Take a noun, get its gender G, look for adjectives, if there are, take their gender Gi.Verify if G=every GiGet its ...

Declarative

I declare that :

"The adjective is in accordance with the noun".

sentence (Art,Adj,N,V) :- article (Art,G,Nb), adjective (Adj,G,Nb), noun (N,G,Nb), verb (V,Nb).

Page 9: II - Cognitive approach

9V 3.19

3 - Representation in logics3 - Representation in logics3.1 - Propositional calculus3.1 - Propositional calculus

A proposition is an assertion (with a given syntax) that can only be valued in two ways : right or wrong (true or false).

Example :

Figure 2.3 - “John is a man”

represents “John is a man”, assertion that can be true or false (here, we will assume it’s true)

A predicate can have several arguments :• job (jean, architect)• Temperature (machine2,lower_pump, 50)• Following (task2, task1)• ...

Man (John)

predicate argument

Page 10: II - Cognitive approach

10V 3.19

3.2 - Lack of propositional calculus3.2 - Lack of propositional calculus

This logic isn’t powerful enough to represent properties for a group of persons. For example how can we tell that ‘all sailors live near the sea’ without saying it for

each of them ?

Page 11: II - Cognitive approach

11V 3.19

3.3 - Predicate calculus3.3 - Predicate calculus

First order predicate calculus can be seen as an extension to propositional calculus.

It has the same kernel, but adds • The use of variables• The ability of quantify them

Interpretation• There exists, at least one x for which P is true :

x P(x)• Q is true for all the x in the domain :

x Q(x) Well formed formula, in predicate calculus, can have two states, just like in

propositional calculus : true or false.

Page 12: II - Cognitive approach

12V 3.19

ExamplesExamples

Y (dog(Y) dangerous(Y)) XYZ (father(X,Y) father(Y,Z) grandfather(X,Z))

(It reminds me of something) S (job(S,sailor) live(S,sea))

Page 13: II - Cognitive approach

13V 3.19

Reasoning in predicate calculusReasoning in predicate calculus

Page 14: II - Cognitive approach

14V 3.19

3.4 - Fuzzy logics3.4 - Fuzzy logics

Uncertain reasoning, fuzzy reasoning, incomplete reasoning… all those problem have their own logics.

Three prisoners, five hats (modal logics)

Page 15: II - Cognitive approach

15V 3.19

4 - Semantic networks (Quillian 68)4 - Semantic networks (Quillian 68)4.1 - Introduction4.1 - Introduction

This formalism comes from work on memory organisation. Semantic networks are especially used in natural language. In a semantic network, knowledge is figured by a graph, nodes stand for concepts, links for

relations between concepts. Two relations are preferred :

• Is a kind of (AKO) <• Is a (ISA) 

Figure 2.4 - “Bagheraa is a panther”

Bagheraa panther animalisa ako

Page 16: II - Cognitive approach

16V 3.19

4.2 - Reasoning in semantic networks4.2 - Reasoning in semantic networks

Reasoning in a semantic network is a graph extraction. It’s a structural correspondence.

Thus, It is possible, when looking at the graph below to answer the question :

“Where does the person, john gave the book to, live ?”

Figure 2.7 - Reasoning in a SN.

John give1actor

book

object

Mary

Oxford street

address

receiver

"Eva"

title

Page 17: II - Cognitive approach

17

II - Cognitive approachII - Cognitive approach

B - How does a

Knowledge Based System

work ?

Page 18: II - Cognitive approach

18V 3.19

6 - Rule based system6 - Rule based system6.1- Introduction6.1- Introduction

Page 19: II - Cognitive approach

19V 3.19

6 - Rule based system6 - Rule based system6.1- Introduction (2)6.1- Introduction (2)

Each rule has the following syntax

IF <premises> THEN <conclusions>

Which means that when all premises are true, it is possible to deduce that the conclusions are also true.

Knowledge is given to the system in a rule form (in a declarative way). There is a separation between the knowledge (the rules) and its utilisation (the

inference engine)

Page 20: II - Cognitive approach

20V 3.19

6.2 - The inference engine6.2 - The inference engine

o The inference engine order has the same level as the logical representation.

o Most of nowadays inference engine are‘first order’.

• Figure 2.9 - Inference engine order

Rules Example Engine

in proposition calculus

in predicate calculus

IF tank-car1-emptyTHEN out-of-fuel-car1

IF tank-car1 < 3THEN out-of-fuel-car1

IF tank(V) = 0THEN out-of-fuel(V)

0 order

0+ order

first order

Page 21: II - Cognitive approach

21V 3.19

6.3 - Functioning of an inference engine6.3 - Functioning of an inference engine

Page 22: II - Cognitive approach

22V 3.19

6.3.1 - Forward chaining6.3.1 - Forward chaining

The reasoning is led by data, this functioning is also called ‘saturation with the fact base’.

For example in a medical diagnose we could have...

• patient-age = 15 years old

• temperature = normal

• headache = awful

…and the system would look for all possible deductions.

Page 23: II - Cognitive approach

23V 3.19

Milou uses forward chainingMilou uses forward chaining

Page 24: II - Cognitive approach

24V 3.19

Three steps of forward chainingThree steps of forward chaining

Page 25: II - Cognitive approach

25V 3.19

Example Example

• FB : A,E, I

• RB : 1 - if A and B then C2 - if B then K3 - if G and A then B4 - if I et E then B5 - if E then J6 - if J and K then F7 - if E and D then G

Page 26: II - Cognitive approach

26V 3.19

Functioning of an inference engineFunctioning of an inference engine

• Cycle Rules Chosen Activated Factsrule rules base

{ } stops the engine. The final FB is : AEIBCKJF (all these facts are true)

Page 27: II - Cognitive approach

27V 3.19

6.3.2 - Backward chaining6.3.2 - Backward chaining

It’s a type of reasoning driven by a goal (hypothesis verification) Example

• Patient is a child

• He’s got red spots on his face

• He’s got a temperature

Verify “The child has a measles”

A goal is given, the inference engine tries to activate rules that conclude towards this goal. The premises of these rules become new goals to be solved.

Page 28: II - Cognitive approach

28V 3.19

Milou uses backward chainingMilou uses backward chaining

Page 29: II - Cognitive approach

29V 3.19

Example inExample inbackward chainingbackward chaining

With the same facts base as in forward chaining, let us try to prove the fact F.

Figure 2.13 - The AND/OR tree used in backward chaining

Page 30: II - Cognitive approach

30V 3.19

(formal) Explanations(formal) Explanations

Page 31: II - Cognitive approach

31V 3.19

(industrial) Explanations(industrial) ExplanationsPeugeot-Citroën’s expert system : SIRIUSPeugeot-Citroën’s expert system : SIRIUS

Page 32: II - Cognitive approach

32V 3.19

(industrial) Explanations (2)(industrial) Explanations (2)Peugeot-Citroën’s expert system : SIRIUSPeugeot-Citroën’s expert system : SIRIUS

Page 33: II - Cognitive approach

33V 3.19

6.3.3 - “Mixt” chaining6.3.3 - “Mixt” chaining

Some rule based systems can use both chaining : forward and backward. Just like a human who sometimes tries to deduce things without aims or who may also want to prove something before going further in his reasoning.

Page 34: II - Cognitive approach

34V 3.19

All examples given were taken from the propositional calculus. In the predicate calculus, inferences are more difficult because a same rule can be activated more than once.

The following rule written in the predicate calculus formalism :

• IF FATHER(x,y) AND FATHER(y,z) THEN GRANFATHER(x,z) Will be activated …… times on this fact base :

• FATHER(John,Louis)

• FATHER(John,Paul)

• FATHER(Paul,Herbert)

• FATHER(Louis,Yann)

• FATHER(Arthur, John)

6.4 - Nota-bene6.4 - Nota-bene

Page 35: II - Cognitive approach

35V 3.19

6.5 - Advantages6.5 - Advantages

Each rule is one part of the knowledge.It has to be independent from other rules.

• Modifications are easy It’s easy to follow the reasoning built by the machine

• Explanations are given to human The use of other logics (fuzzy for example) can introduce the idea of weight in

rules

Page 36: II - Cognitive approach

36V 3.19

7 - Expert Systems (E.S.)7 - Expert Systems (E.S.)7.1 - History7.1 - History

Expert Systems (ES) comes from rule based systems, but add other reasoning techniques or knowledge representation formalisms.

The first known is DENDRAL (1965, Feigenbaum, Stanford University). It was able to determine the chemical structure of an element from its chemical formula and its mass spectogram.

It was an enormous program written in Fortran. Every change in knowledge was very difficult to make, because physics knowledge and reasoning were closely linked in the code-program.

Page 37: II - Cognitive approach

37V 3.19

7 - Expert system (E.S.)7 - Expert system (E.S.)7.1 - History (2)7.1 - History (2)

The idea that has given birth to ES was to separate specific knowledge from the way of using it.

This idea is the foundation of all Expert Systems. The idea ‘came to life’ with

• MYCIN (1976, Shortliffe) blood illnesses diagnosis.

• PROSPECTOR (1979) Geology expert system

Page 38: II - Cognitive approach

38V 3.19

7.2 - MYCIN & E-MYCIN7.2 - MYCIN & E-MYCIN

Page 39: II - Cognitive approach

39V 3.19

7.3 - Expert System - Definition7.3 - Expert System - Definition

Software able to reach performances equal to a human, on a precise area, using a set of knowledge acquired from one or several experts of the considered area.

It is composed of (as a production system)• an inference engine (IE)• a fact base (FB)• a rule base RB)

One often finds, integrated to the IE:• a heuristic choice strategy of rules• a meta-knowledge (ex : meta-rule for the choice of other rules).

Feigenbaum’s definition

• ES are programs conceived to reason cleverly about tasks which are believed to require a considerable human expertise.

Page 40: II - Cognitive approach

40V 3.19

7.4 - Advantages7.4 - Advantages

Separation between knowledge and mechanism (algorithm) A piece of knowledge is a production rule

• knowledge can be ‘read’

• construction and evolution are easy

• explanation capacity by examining the series of rules that were used.

Page 41: II - Cognitive approach

41V 3.19

7.5 - Applications7.5 - Applications

ES bring assistance on problem resolution with the following characteristics:

• There is a great quantity of knowledge

• The knowledge on the area will change

• The symbolic calculation (by opposition to the numerical calculation) is the most important.

Page 42: II - Cognitive approach

42V 3.19

7.6 - Teaching7.6 - Teaching

Expert Systems can also be found in teaching. Not only does it know the solution of the exercise, but it also knows the method of resolution, which enables to explain it all.

Page 43: II - Cognitive approach

43V 3.19

7.7 - TD7.7 - TD

Page 44: II - Cognitive approach

44

II - Cognitive ApproachII - Cognitive Approach

C - Knowledge acquisition, knowledgemanagement

Page 45: II - Cognitive approach

45V 3.19

8 - Context8 - Context8.1 - Motivation in the choice of an ESS8.1 - Motivation in the choice of an ESS

The problem deals with qualitative information (not only quantitative). Knowledge is not only knowledge of good sense, but it’s got something intuitive. There exists one or several recognized experts, motivated and available, that

are able to solve the problem and to explain their way of reasoning. Economic reasons are not the only ones in favour of using ESS :

• The expertise is rare or fragile (overworked expert, leaving expert, retirement...)

• Decisions have to be made in difficult situations (quickly, when it’s hard to decide, stress...)

Page 46: II - Cognitive approach

46V 3.19

8.2 - Steps of an SE development8.2 - Steps of an SE development

Step 1: demonstrator• Development of a model (demonstrator) on a part of the problem studied. The

purpose is to prove that the problem can be solved with AI techniques. Step 2: prototype

• Development of a prototype, that integrates a complete knowledge base, but that doesn’t care about the real environment (i.e. : without interfaces). Tests.

Step 3: integration• Integration of the product in its final environment. Interfaces with other

software (bases on data, CAD programs, I/O processing…) that were simulated on the prototype are now effective.

Step 4: maintenance• In the case of knowledge that changes, updating the knowledge base, while

keeping the coherence with the operational base.

Page 47: II - Cognitive approach

47V 3.19

9 - Human means9 - Human means

An ES development needs two actors (or two groups of actors)

• an expert of the area considered

• a knowledge engineer These two actors will work together to develop the knowledge base. The expert,

that knows perfectly his problem, will answer the knowledge engineer’s questions, but above all, will explain his answers by giving the reasoning that drove him to them.

Page 48: II - Cognitive approach

48V 3.19

9.1 - Difference between an Expert 9.1 - Difference between an Expert and a Specialistand a Specialist

Page 49: II - Cognitive approach

49V 3.19

9.2 - Work9.2 - Work

The knowledge engineer creates a link between the expert and the machine, he mainly works with the expert, whose behaviour he observes and analysis behaviour, and with a computer to formalise knowledge information (with objects, rules...).

Figure 2.14 - The task of a knowledge engineer

Questions,problems

Answers,knowledge

Formalisation

Help

Page 50: II - Cognitive approach

50V 3.19

9.3 - Four steps in knowledge formalisation9.3 - Four steps in knowledge formalisation

(not counting methodological documents like specifications…)

Step 1 : Interviews with the expert, in order to determine the nature of reasoning.• useful to choose the engine order, 0 for diagnosis, 1 for scheduling…)

Step 2 : Note all the descriptors and concepts used by the expert.• for example, when using an object representation, it enables to create

classes, attributes, the hierarchy… Step 3 : Transcribe in the chosen language (depending on the ESS), the

knowledge that is useful to solve the problem. Step 4 : Correct and validate in presenting the same (new) problem to both the

expert and to the expert system. Compare results and explanations.

Page 51: II - Cognitive approach

51V 3.19

9.4 - A knowledge engineer’s9.4 - A knowledge engineer’s necessary qualities necessary qualities

Broadmindedness Diversified and vast knowledge to approach a new area Intellectual curiosity Humility (keep in mind ones ignorance) Aptitudes for communication Skill in convincing the expert to give his knowledge Do not try to substitute to the expert, even if his intellectual steps seem

understood Try to show underlying and sometimes unconscious reasoning of the expert Be able to quickly sort relevant information Sufficient knowledge in Artificial Intelligence, in order to choose the right

representation formalism or inference engine.

Page 52: II - Cognitive approach

52V 3.19

9.5 - Traditional knowledge extraction9.5 - Traditional knowledge extraction

Traditional knowledge extraction made with interviews, questions and case studies.

Several problems

• the knowledge engineer, to whom the expert explains the whole reasoning thinks about himself as an expert,

• The expert uses an ambiguous vocabulary whose implications are numerous,

• There is a guarantee of completion for information,

• Knowledge extraction is long and expensive.

Page 53: II - Cognitive approach

53V 3.19

10 - Software tools10 - Software tools

Besides the ESS, the knowledge engineer will use different software (knowledge formalisation and browsing tools).

Nowadays, most of ESS integrate such functionalities.

Page 54: II - Cognitive approach

54V 3.19

10.1 - Formalisation methods10.1 - Formalisation methods

Useful to

• Accelerate knowledge acquisition,

• Use the same language,

• Prove the completion of the knowledge base,

• Increase the system maintenance

Page 55: II - Cognitive approach

55V 3.19

10.2 - A method... What for ?10.2 - A method... What for ?

Figure 2.15 - A method ?

Boolean logic

Computer

Expert’s knowledge (in natural language)

Page 56: II - Cognitive approach

56V 3.19

10.3 - Two methods10.3 - Two methods

The KOD method

• Knowledge Oriented Design (Claude Vogel, CISI)

• Text transcription, linked with concepts such as taxa, acta, schema…

• Ascending methodology The KADS method

• Knowledge Acquisition and Design Support (European Esprit project, 95 men/year)

• Descending methodology

• Coherency verification functions

• Based on ‘libraries for every ‘kind of reasoning’

• Software tools exist (from Bull, Ilog, Cap Gemini)

Page 57: II - Cognitive approach

57V 3.19

10.5 - At last…10.5 - At last…

Figure 2.16 - Proportion of formalised knowledge

Page 58: II - Cognitive approach

58V 3.19

10.6 - Conclusion10.6 - Conclusion

ES use get easier and easier (thanks to their great use) but we mustn’t forget that• the knowledge base has to be built by hand, because no automatic tool exists,• the knowledge area is very ‘small’• the explored knowledge is often a rather superficial one, while the expert has

a depth knowledge,• the limitation in the kinds of reasoning used by a machine (forward and

backward chaining…). ‘Second generation’ ESS now integrate

• increased structured knowledge representation,• easier use of underlying phenomenon• additions of other AI techniques (natural language, image processing..)

Page 59: II - Cognitive approach

59V 3.19

10.7 - Something to remember10.7 - Something to remember