Top Banner
Introduction to Expert Systems Dr. Salah Gad Foda 2001
34
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Introduction to Expert Systems

Dr. Salah Gad Foda

2001

Page 2: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Introduction:

There has been a tremendous development in the field of expert

systems, also known as knowledge-based systems, for the

past few decades. Expert systems development tools or

shells are now standard inclusion of computer software

packages. Applications for expert systems do abound in

various areas such as economics, tax preparation and

planning, operations research, management, medical

diagnosis, mining, food industry, computers design, and

engineering applications; to mention only a few.Expert Systems

Page 3: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Definition of Artificial Intelligence:

AI is the study and creation of machines that exhibit humanlike qualities, including the ability to reason.

Subfields of AI: Natural language processing Robotics Perceptive systems (e.g. vision) Expert systems Artificial neural networks Intelligent software (“ordinary” software with embedded

AI features such as grammar checkers).

Expert Systems

Page 4: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

What is an expert system?

An expert system may be defined as a computer program that

models and exhibits, within a specific domain, a degree of

expertise in problem solving that is comparable to that of a

human expert. It should, however, be emphasized that one

can develop expert systems and derive conclusions from them

through a strictly manual process. Thus, the essence of an

expert system is constituted of the formation of a model of

knowledge base.

Expert Systems

Page 5: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

In short, an expert system is a program that seeks to capture expertise in limited domains of knowledge and experience and to apply this expertise to solving problems.

Building an expert system involves the following: knowledge engineer extracts knowledge from experts develops expert system using highly iterative process

(because experts often can not, or sometimes do not, describe what they do know)

helpful user interface facility for the user to question the program learning from experience and an ability to give a reasoned

explanation for conclusions that have been reached.

Expert Systems

Page 6: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Structure of an Expert System:

Expert Systems

Page 7: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Knowledge engineers are those who develop and implement

expert systems solution for appropriate engineering

applications. Thus, the primary role of an expert engineer is to

acquire and represent, in the form of knowledge base, the

rules employed by a human expert in the solution of a

particular problem. More precisely, Knowledge engineers

develop models for knowledge bases. Once this has been

done, knowledge engineers will select an expert system

software package to perform the inference process. Inference

is simply the derivation of conclusions for the given problem.

Expert Systems

Page 8: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

What can expert systems do?

There are several features that distinguish problems suitable for tackling with expert systems:

Experts in the field perform measurably better than non-experts. Picking lottery numbers would not be a good problem domain; choosing winning horses would.

Expertise in the field is not common. If there are lots of experts, there's probably no point in building a system to emulate them.

The problem has a small, well-defined knowledge domain. The knowledge of the expert is stable. Rapidly changing fields, such

as fashion design, are not suitable. The knowledge in the domain is at least partially heuristic. Problem attributes are symbolic rather than numeric Knowledge base is transparent and visible There is a need to cope with uncertainty in solving the problem. Analytical solutions are precluded by combinatorial explosion

Expert Systems

Page 9: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

What tasks can expert systems perform?

Expert Systems

Design Configuring objects under constraints. Typical applications: computer configuration, architectural design.

Diagnosis System infers malfunctions from observations. Typical applications: medical, electronics.

Debugging System suggests remedies for malfunctions. Typical applications: not common.

Planning System designs future actions. Typical applications: scheduling, routing, agent behavior.

Page 10: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Expert Systems

Control System interprets, predicts, diagnosis, remedies and monitors execution, often in real time. Typical applications: air traffic control.

Repair System develops and carries out plans to administer remedies. Typical applications: aerospace, automotive.

Monitoring System compares observations to features crucial to outcomes. Typical applications: statistical process control, financial systems, nuclear power plants.

Interpretation System infers situation descriptions from observations. Typical applications: surveillance, speech understanding, image analysis, chemical structure determination.

Page 11: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

What are the advantages of using expert systems?

Permanence - An expert system never forgets (which is why they are best for static domains)

Reproducibility - much easier to copy than human experts Efficiency - expert systems are cheap to use and can spread

development costs over many users Consistency - an expert system will give the same answer to the same

problem every time (human experts are often influenced by more recent information)

Documentation - most expert systems can offer a detailed hard copy of the decision-making process employed to reach a conclusion

Completeness - an expert system will always consider all relevant information, every time

Speed - on large, complex problems, the speed of an expert system can be many times that of a human expert

Breadth - an expert system can capture the knowledge and experience of more than one expert (although this can lead to conflicts)

Expert Systems

Page 12: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

What are the disadvantages of using expert systems?

Stupidity - Expert systems are substantially less idiot-tolerant than human experts. You put garbage in, you get garbage out. "Common sense" is extremely hard to put into an expert system.

Creativity - None. If a solution is not in the bounds of the system, it will not be selected.

Learning - Very few expert systems learn, and none do without substantial feedback on previous results. Learning is largely the domain of Case Based Reasoning (CBR) and Artificial Neural Network systems (ANNs).

Domain bounds - If the problem is outside the intended domain, solution impossible.

Expert Systems

Page 13: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Expert Systems Tools

Free Expert Systems Tools Programming Languages

Page 14: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Freeware expert systems tools?

CLIPS (C Language Integrated Production System)

Description: A forward-chaining rule-based tool written in C by NASA. It can be easily embedded in other applications and includes an object-oriented language called COOL.

Platforms: DOS, Windows, VMS, Mac, and UNIX. Source: The latest version is available from the

CMU AI Repository or Nortwestern University. Reference: Additional information is available at

http://www.tnt.uni-hannover.de/data/www/soft/case/lang/clips/ Contact: For problems with usage or installation of CLIPS

contact NASA's Client/Server Systems Branch Help Desk.

Expert Systems

Page 15: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

DynaCLIPS (Dynamic CLIPS Utilities)

Description: A number of tools are available to be linked with

CLIPS. DYNACLIPS is a set of blackboard, dynamic knowledge exchange, and agent tools implemented as a set of libraries that can be linked with CLIPS.

Platforms: Same as CLIPS. Source: The latest version is available from the CMU AI

Repository. Reference: Additional information is available from the CMU AI

Repository.

Contact: [email protected]

Expert Systems

Page 16: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

FuzzyCLIPS Description: This version of CLIPS provides handling of fuzzy

concepts and reasoning, in addition to the other CLIPS features.

Platforms: Same as CLIPS. Source: The latest version is available from the National

Research Council of Canada. Reference: Additional information is available from the

National Research Council of Canada. Contact: mailto:%[email protected]

Expert Systems

Page 17: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

BABYLON Description: This is a modular, configurable, hybrid

environment for developing expert systems. It provides the following knowledge representation formalisms: frames, rules, logic (Prolog) and constraints. It requires Common Lisp.

Platforms: Mac, and UNIX. Source: The latest version is available from

ftp://ftp.gmd.de:/gmd/ai-research/Software/Babylon/ Reference: Additional information is available from

ftp://ftp.gmd.de:/gmd/ai-research/Software/Babylon/README

Expert Systems

Page 18: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

ES Description:The ES Expert system development tool supports

backward/forward chaining, and fuzzy set relations. Platforms: PC. Source: The latest version is available from

ftp://ftp.uu.net/pub/ai/expert-sys/summers.tar.Z. Reference: For additional information see the

October/November 1990 issue of BYTE.

Expert Systems

Page 19: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

GEST (Generic Expert System Tool)

Description: This shell can be used in a variety of problem domains and supports backward and forward chaining. Its knowledge representation schemes include frames, rules and procedures. Support is also present for fuzzy logic and certainty factor maintenance. It includes a blackboard architecture. The user interface utilizes the Symbolics windowing system and is menu and mouse driven.

Platforms: Symbolics Lisp Machines, Genera 7.2. Source: N/A. Contact: [email protected].

Expert Systems

Page 20: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Languages optimized for expert systems and AI:

Prolog Prolog is a language of facts, relations and rules. Facts are things

like raining or umbrella. Relations express relationships between facts, for example is-carrying(john,umbrella) might be used to express the concept that John is carrying an umbrella. Prolog rules express inferences that can be made from facts.

Thus the rule armed(X):- is_carrying(X,gun). Note the :- construction, which loosely means 'IF', and the use of a variable, X (all Prolog variables begin with upper case to distinguish them from facts, which begin with lower case). Translated, this rule means "IF x is carrying a gun, THEN x is armed".

Prolog works by backward chaining, and can express complex logical problems with very few rules (but can't easily operate as a procedural language).

Expert Systems

Page 21: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

LISP LISP is a list processing language. Everything in lisp is treated as a list of

symbols. Even the program itself is a list. There's a free evaluation version of Common LISP.

Scheme Scheme is a statically scoped and properly tail-recursive dialect of the Lisp

programming language invented by Guy Lewis Steele Jr. and Gerald Jay Sussman. It was designed to have an exceptionally clear and simple semantics and few different ways to form expressions. A wide variety of programming paradigms, including imperative, functional, and message passing styles, find convenient expression in Scheme.

KEE KEE is the basis upon which Kappa-PC was built.

Smalltalk There is a version called Dolphin Smalltalk which comes with online tutorial

and help, but is restricted as it is a cut-down commercial product.

Expert Systems

Page 22: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Problem Solving

Searching Techniques Game Theory Prepositional Logic

Page 23: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Searching for Solutions:

DefinitionsProblem: A goal and a set of means to achieve the defined goal is

called a problem.

Search: The process of exploring different possible sequences to reach the “best” sequence to meet the goal is called a search.

Search Cost: Search cost is usually defined in terms of computational time and memory required to reach a solution.

In general a search strategy is measured according to the following criteria:

Completeness – guarantees of solutions? Time complexity – computational cost? Space complexity – memory cost? Optimality – best sequence if different sequences exist?

Expert Systems

Page 24: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Search Trees:

Nodes – (a,b,c,…,g) Root – (a) Leaves – (d,e,f,g)

Expert Systems

a

f

edc

b

g

Page 25: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Search Complexity:

Complexity Theory is concerned with tractability or intractability of computational sequences.

P Problems – All deterministic search sequences with O(nk) execution steps are called polynomial or P problems.

NP Problems – Class of nondeterministic search algorithms with polynomial complexity.

NP-hard Problems – Class of search algorithms whose complexities grow exponentially with size of their input, e.g. O(2n), O(n3 2n), etc.

Examples:Simple search has O(n) complexity.

Binary search has O(log2 n) complexity.

Matrix multiplication has O(n3) complexity. Expert Systems

Page 26: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Search Strategies:

Breadth-First Search – Nodes at depth d in the search tree are expanded before nodes at depth d+1.

Depth-First Search – Start with deepest level node expansion till hitting a dead end then go back and expand nodes at a shallower level.

Heuristic Search – Hill climbing is a good example where next step is determined with an evaluation

function.

Expert Systems

Page 27: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Coin Example:

Expert Systems

Page 28: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Table: Coin Attributes

Expert Systems

Coin Color Shape Size

1 Dinar Gold Circle 2.4cm

1 Dinar Gold Hexagon 3.1cm

½ Dinar Gold Hexagon 2.8cm

½ Dinar Silver & Gold Hexagon 2.8cm

¼ Dinar Gold Hexagon 2.6cm

10 Piasters Silver Circle 2.7cm

5 Piasters Silver Circle 2.5cm

2.5 Piasters Silver Circle 2.1cm

1 Piaster Bronzy Circle 2.4cm

Page 29: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Decision Trees:

No use for shape attribute in some parts of the tree.Expert Systems

2.6cm2.8cm

Circle

2.4cm

CircleHexagonHexagon

2.8cm2.4cm

Circle

Gold

Bronzy Gold & Silver

Silver

Hexagon

Circle

3.1cm

2.1cm 2.5cm

2.7cm

ColorColor

ShapeShape

SizeSize

½ D½ D1 P1 P

2.5 p2.5 p5 p5 p 10 p10 p

1 D1 D

SizeSize

¼ D¼ D ½ D½ D 1 D1 D

ShapeShape ShapeShape

SizeSizeSizeSize

ShapeShape

????

SizeSize

P=PIASTERSD=DINAR

Page 30: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Size attribute is not so effective in some areas of decision tree.

Expert Systems

2.8cm2.4cm

Gold

Bronzy Gold & Silver

Silver

HexagonCircle

2.6cm 2.8cm 3.1cm

2.1cm 2.5cm

2.7cm

ColorColor

ShapeShapeSizeSize

½ D½ D1 P1 P

2.5 p2.5 p5 p5 p 10 p10 p

1 D1 DSizeSize

¼ D¼ D ½ D½ D 1 D1 D

SizeSizeSizeSize

P=PIASTERSD=DINAR

Page 31: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Final decision tree.

Expert Systems

Gold

Bronzy Gold & Silver

Silver

HexagonCircle

2.6cm 2.8cm 3.1cm

2.1cm 2.5cm

2.7cm

ColorColor

ShapeShape SizeSize½ D½ D1 P1 P

2.5 p2.5 p 5 p5 p 10 p10 p

1 D1 DSizeSize

¼ D¼ D ½ D½ D 1 D1 DP=PIASTERS

D=DINAR

Page 32: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Decision Rules:

Based on this tree we can create the following rules:

IF (Color is bronzy) THEN (Coin is 1 Piaster) IF (Color is gold AND silver) THEN (Coin is ½ Dinar) IF (Color is silver) AND (Size is 2.1 cm) THEN (Coin is 2.5

Piasters) IF (Color is gold) AND (Shape is Hexagon) AND (Size is 2.8)

THEN (Coin is 1 Dinar)

And so on.

Expert Systems

Page 33: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Two-Person Games:

A game can be defined as a search problem with the following components:

Initial state which includes initial sequences and who moves first

Operators which define legal sequences a player may make

Terminal state which determines when game or search is over

Payoff function which gives a numeric value for each outcome of a sequence or a move

Expert Systems

Page 34: Introduction to Expert Systems Dr. Salah Gad Foda 2001.

Expert SystemsTic-Tac-Toe game

X

X X XO

OO etc

X

XX

X

X

XO

OO

OOOO

OO X

X

X X

X

X

O

OO

X

XO

etc

Payoff = 1Payoff = 1 Payoff = 0

X