ICT 619 Intelligent Systems Topic 2 Expert Systems

  • Slides: 41
Download presentation
ICT 619 Intelligent Systems Topic 2: Expert Systems ICT 619 S 2 -05

ICT 619 Intelligent Systems Topic 2: Expert Systems ICT 619 S 2 -05

Expert Systems PART A § Introduction Applications of expert systems § Structure of an

Expert Systems PART A § Introduction Applications of expert systems § Structure of an expert system § An example rule base § Reasoning in a rule-based expert system § Reasoning using forward and backward chaining § Dealing with uncertainty PART B § Frame-based expert systems § Developing expert systems § Advantages and disadvantages of expert systems § Case studies ICT 619 S 2 -05 2

PART B § § § Frame-based expert systems Developing expert systems Advantages and disadvantages

PART B § § § Frame-based expert systems Developing expert systems Advantages and disadvantages of expert systems § Case Studies ICT 619 S 2 -05 3

Frame-based expert systems – what is a frame? (Negnevitsky, 2005) § A frame is

Frame-based expert systems – what is a frame? (Negnevitsky, 2005) § A frame is a data structure with typical knowledge about a particular object or concept. § Frames were first proposed by Marvin Minsky in the 1970 s. § Each frame has its own name and a set of attributes associated with it. Carrier, Name, Flight, Date, … Gate are slots in the frame Boarding pass. ICT 619 S 2 -05 4

Frame-based expert systems – what is a frame? (cont’d) § Frames provide a natural

Frame-based expert systems – what is a frame? (cont’d) § Frames provide a natural way for the structured and concise representation of knowledge. § Frames are an application of object-oriented programming for expert systems. § A knowledge engineer refers to, what is an equivalent of an object in object oriented programming, as a frame ICT 619 S 2 -05 5

Object-oriented Programming § Object-oriented programming is a programming method that uses instances (known as

Object-oriented Programming § Object-oriented programming is a programming method that uses instances (known as objects) of different classes of entities for problem solving § A class in OOP defines an abstraction of entities with a common set of characteristics (attributes) and behaviours § The simplest example of an attribute is a variable type such as a string § Behaviours are represented by procedures applicable to objects of that class. ICT 619 S 2 -05 6

Frames as a knowledge representation technique § The concept of a frame is defined

Frames as a knowledge representation technique § The concept of a frame is defined by a collection of slots. § Each slot describes a particular attribute or operation of the frame. § Slots are used to store values. § A slot may contain a default value or a pointer to another frame, a set of rules or procedure by which the slot value is obtained. ICT 619 S 2 -05 7

Classes and instances § A group of similar objects belong to a class §

Classes and instances § A group of similar objects belong to a class § The word frame may refer to a particular object or instance of a class § To be more precise, a class-frame describes a group of objects with common attributes. § Instance-frame refers to a particular object - Animal, person, car and computer are all class-frames. - Mammal, Jane Doe, Toyota, Dell Inspiron are all instanceframes. § Frame-based systems are characterized by inheritance. § Inheritance is the process by which all characteristics of a classframe are assumed by an instance-frame as well as any subclasses. ICT 619 S 2 -05 8

Computer class ICT 619 S 2 -05 9

Computer class ICT 619 S 2 -05 9

Computer instances ICT 619 S 2 -05 10

Computer instances ICT 619 S 2 -05 10

Methods and Demons § Expert systems are required not only to store the knowledge

Methods and Demons § Expert systems are required not only to store the knowledge but also to validate and manipulate this knowledge. n To add actions to frames, a procedures is associated with a frame attribute that is executed whenever requested. § Frame procedures are known as methods and demons § Demons are limited to IF-THEN statements, methods are more complex. ICT 619 S 2 -05 11

Methods and Demons (cont’d) § Most frame-based expert systems use two types of methods:

Methods and Demons (cont’d) § Most frame-based expert systems use two types of methods: WHEN NEEDED and WHEN CHANGED n A WHEN NEEDED method is executed when information associated with a particular attribute is needed for solving the problem, but the attribute value is undetermined. § A WHEN CHANGED method is executed immediately when the value of its attribute changes. § The following simple example illustrates the use of WHEN CHANGED methods in a class at run-time. ICT 619 S 2 -05 12

An ES to assist a loan officer in evaluating credit requests from small business

An ES to assist a loan officer in evaluating credit requests from small business ventures § A credit request is to be classified into one of three categories, “Give credit”, “Deny credit” or “Consult a superior”. § When a loan officer provides a qualitative rating of the expected yield from the loan, the expert system: 1. Compares the business collateral with the amount of credit requested 2. Evaluates a financial rating based on a weighted sum of 1. 2. 3. 4. the business’s net worth to assets last year’s sales growth gross profit on sales and short-term debt to sales 3. Determines a category for the credit request. ICT 619 S 2 -05 13

Input display for the request selection ICT 619 S 2 -05 14

Input display for the request selection ICT 619 S 2 -05 14

The class Action Data and WHEN CHANGED methods ICT 619 S 2 -05 15

The class Action Data and WHEN CHANGED methods ICT 619 S 2 -05 15

Class Request ICT 619 S 2 -05 16

Class Request ICT 619 S 2 -05 16

Instances of the Class Request ICT 619 S 2 -05 17

Instances of the Class Request ICT 619 S 2 -05 17

Inference in a frame-based system § Most frame-based expert systems allow the use of

Inference in a frame-based system § Most frame-based expert systems allow the use of a set of rules to evaluate information contained in frames. § Similar to a goal-driven rule-based system, the inference engine in a frame-based system also searches for the goal. § But rules in such a system play an auxiliary role. § Frames represent here a major source of knowledge, and both methods and demons are used to add actions to the frames. § Thus, the goal in a frame-based system can be established either in a method or in a demon. ICT 619 S 2 -05 18

Example: Evaluation of credit request § The expert system is expected to begin the

Example: Evaluation of credit request § The expert system is expected to begin the evaluation when the user clicks the Evaluate Credit pushbutton on the input display. § This pushbutton is attached to the attribute Evaluate Credit of the class Credit Evaluation. ICT 619 S 2 -05 19

The Credit Evaluation class, WHEN CHANGED and WHEN NEEDED methods ICT 619 S 2

The Credit Evaluation class, WHEN CHANGED and WHEN NEEDED methods ICT 619 S 2 -05 20

The rule-base ICT 619 S 2 -05 21

The rule-base ICT 619 S 2 -05 21

Example: Evaluation of credit request (cont’d) § The WHEN NEEDED method attached to the

Example: Evaluation of credit request (cont’d) § The WHEN NEEDED method attached to the attribute Evaluation is used to establish its value. § The inference engine executes this method when it needs to determine the value of Evaluation. § If based on the set of rules provided for credit evaluation, the inference engine cannot establish the value of the attribute Evaluation, the attribute Evaluation receives the value Consult a superior. § The task of developing a frame-based ES can be difficult for the knowledge engineer due to the complexity of inheritance. ICT 619 S 2 -05 22

Developing an expert system - issues to be considered § Does the task require

Developing an expert system - issues to be considered § Does the task require knowledge available from human experts? § Are human experts too expensive and scarce? § Is the problem domain well-structured? § Problem domain must be well-defined and formalised. § Amount of knowledge required to solve such problems should be relatively small. § No commonsense reasoning § Can the problem be solved by traditional computing methods? Numerical, statistical or operations research methods, if applicable, are likely to do better than heuristic solution § Are cooperative, articulate and enthusiastic human experts available? § Expert can articulate reasoning process with a high degree of confidence § Expert convinced of the benefit of the ES, and does not feel threatened ICT 619 S 2 -05 23

Developing an expert system - issues (cont’d) § Adequate management support § How big

Developing an expert system - issues (cont’d) § Adequate management support § How big and complex is the problem? § Available technology must be able to handle required knowledge base efficiently § Is development cost justified by returns? § Is the solution found likely to remain valuable for several years to come? § The cost of the human expert needs to be compared with the cost of developing the ES § Cost can be reduced by development tools like ES shells § Will there be adequate infrastructure and management support for ES maintenance in future? ICT 619 S 2 -05 24

Developing an expert system - the people 1. The knowledge group (knowledge engineer +

Developing an expert system - the people 1. The knowledge group (knowledge engineer + the domain expert) 2. The developer group 3. The user group § Knowledge engineer § Usually a system analyst with background in AI § extracts knowledge from domain expert and formalizes it into a knowledge base § decides on the § § knowledge representation scheme strategies for reasoning and searching the knowledge base design of the user interface. hardware and software. ICT 619 S 2 -05 25

Knowledge engineer (cont’d) § May not initially have any experience of the ES problem

Knowledge engineer (cont’d) § May not initially have any experience of the ES problem domain § Sessions with the domain expert are the usual method used for knowledge gathering § Machine learning techniques such as decision trees (subject of a later topic) can also be used § Time taken by knowledge acquisition process – approx. 60 to 70% of overall ES development time ICT 619 S 2 -05 26

The Developer and User groups The developer group § Implements the expert system in

The Developer and User groups The developer group § Implements the expert system in close cooperation with the knowledge group and the user group. § Either programs the system from scratch or makes use of existing software products like an expert system shell The user group Can be a regular user, eg, an employee of the organization § May be an irregular user such as bank customer § Needs and characteristics of both categories of users need to be taken into account, particularly for the user interface design. § The user must feel confident and happy with the system. ICT 619 S 2 -05 27

The expert system development cycle Development strategy § Early prototyping and incremental development §

The expert system development cycle Development strategy § Early prototyping and incremental development § Mistakes found during development lead to correction and addition to the knowledge base Steps usually followed: 1. Knowledge engineer gains familiarity with the problem domain 2. Knowledge engineer and domain expert start knowledge extraction process ICT 619 S 2 -05 28

The expert system development cycle (cont’d) 3. Knowledge engineer decides on representation scheme, search

The expert system development cycle (cont’d) 3. Knowledge engineer decides on representation scheme, search strategy, user interface 4. Prototype built 5. Knowledge engineer and domain expert test prototype, corrects, refines and redesigns if necessary 6. Final version built and evaluated. ES knowledge base must be continuously updated by adding, deleting or changing rules to keep up with new knowledge and changed circumstances ICT 619 S 2 -05 29

Expert system shells § A general expert system development product for the market §

Expert system shells § A general expert system development product for the market § An expert system shell has all components of an expert system except the knowledge-base User Interface: Knowledgebase editor - Menudriven User - GUI Knowledge-base Inference engine Working memory - Natural language Explanation sub-system ICT 619 S 2 -05 30

Expert system shells (cont’d) § Good shells also provide facilities for communication with external

Expert system shells (cont’d) § Good shells also provide facilities for communication with external sources including § Database management systems § Spreadsheets § Graphics packages. § Shell selected must match reasoning process (goal driven or data driven) characterising given problem domain § Other features to be considered § knowledge representation scheme and the knowledge base editor § user interface § explanation capabilities. ICT 619 S 2 -05 31

Testing expert systems Correctness of ES can not be guaranteed due to its heuristic

Testing expert systems Correctness of ES can not be guaranteed due to its heuristic nature Some test strategies § Use of historical data Data on existing cases fed to the system, and the outputs analysed Inconsistency of human decisions taken into account in case of any difference between the data and ES § ES against Expert ES tested against the expert by presenting both with hypothetical or actual cases Expert’s reasoning compared with that of the ES to make sure both arrived at the same conclusion for the same reasons ICT 619 S 2 -05 32

Testing expert systems (cont’d) § Field tests Users in the field use the system

Testing expert systems (cont’d) § Field tests Users in the field use the system for a given period of time Favourable results in the field add to ES validity Serious problems in field tests indicate need for further improvement of the design § Turing test ES and a human expert are subjected to blind user evaluation User’s failure to differentiate between answers produced by the two enables the ES to pass ICT 619 S 2 -05 33

Some limitations of expert systems § Knowledge acquisition remains the major bottleneck in applying

Some limitations of expert systems § Knowledge acquisition remains the major bottleneck in applying ES technology to new domains. § Not adaptive Knowledge engineer responsible for revising and maintaining system. § Evaluating expert system correctness is difficult § Explanation of an outcome in terms of the reasoning process can be time consuming for large amounts of data ICT 619 S 2 -05 34

Some limitations of expert systems (cont’d) § Self-explanatory individual rules, but difficult to relate

Some limitations of expert systems (cont’d) § Self-explanatory individual rules, but difficult to relate to overall strategy due to lack of hierarchy § Maintenance and extension of a rule base can be difficult for a relatively large rule base (beyond 100 rules). § ES are not as compact as neural network and genetic algorithm systems. This makes them harder to embed in other systems, as the inference engine and working memory must be part of the system at run-time. ICT 619 S 2 -05 35

Case Studies Case 1: An Expert System for Pattern Directed Data Mining of Point-Of-Sale

Case Studies Case 1: An Expert System for Pattern Directed Data Mining of Point-Of-Sale Data (see Dhar & Stein pp. 244 -). Objective § Supermarkets need to know how different product categories performed over certain periods of time in particular regions and nationally § Some experts are able to detect significant trends in these data – what is happening in the market place? § A. C. Nielsen wanted to create an expert system with this expertise and make it available to its sales reps ICT 619 S 2 -05 36

Case 1: An Expert System for Pattern Directed Data Mining Requirements and constraints §

Case 1: An Expert System for Pattern Directed Data Mining Requirements and constraints § Enable reps to put together a clear and unambiguous story for their customer § Use vocabulary commonly used by sales reps § Able to work with Nielsen’s databases § Be distributable on low-end PCs to sales reps across the country § Reports able to be produced under five minutes § High explainability to enable reps to construct stories § Six months development time – Nielsen wanted to leap frog rival ICT 619 S 2 -05 37

Case 1: An Expert System for Pattern Directed Data Mining (cont’d) Objectives and constraints

Case 1: An Expert System for Pattern Directed Data Mining (cont’d) Objectives and constraints clear but not so outputs – eg, use of imprecise linguistic terms § Decision: - Produce outputs to focus attention on areas of unusual activity (eg, abnormal shift in sales volume, market share, price) accompanied by associated factors to explain observation Problem domain not complex but universally (across all products, regions, seasons) applicable principles were difficult to identify § Decision: - System to be flexible with parameterizable rules to suit specific circumstances § Market data was of high quality ICT 619 S 2 -05 38

Case 1: An Expert System for Pattern Directed Data Mining (cont’d) Implementation § The

Case 1: An Expert System for Pattern Directed Data Mining (cont’d) Implementation § The ES SPOTLIGHT was implemented using a rule based control engine written in C § Sales database and rule base were 15 segments § Loaded one segment at a time due to memory constraints § Results of running each rule base on each segment of data integrated into final report Results § Completed in 1991, SPOTLIGHT proved highly popular with sales reps and their clients § Demonstrated feasibility of expert systems based on conventional technology - written in C for a PC platform, rather than in an AI language such as LISP for AI workstation § First (? ) successful data mining application of an expert system ICT 619 S 2 -05 39

Case 1: An Expert System for Pattern Directed Data Mining (cont’d) Some limitations §

Case 1: An Expert System for Pattern Directed Data Mining (cont’d) Some limitations § Gave limited analyses, and not interactive as a decision support tool § Provided insight into what was happening in the market place, but not what action to take to follow up § Parameterizing rules was not a good long-term solution to making rules sensitive to market context § Nielsen developed an object-oriented version called Opportunity Explorer (OE) with a Windows-based GUI interface § Rules in OE could be attached to classes of consumer goods, so analysis became automatically sensitive to context ICT 619 S 2 -05 40

REFERENCES § AI Expert, October 1991 – presents applications of expert systems § Dhar,

REFERENCES § AI Expert, October 1991 – presents applications of expert systems § Dhar, V. , & Stein, R. , Seven Methods for Transforming Corporate Data into Business Intelligence. , Prentice Hall 1997, Ch 7 § Giarratano, J. , & Riley, G. Expert Systems Principles and Programming, Thomson Course Technology, 2005. § Negnevitsky, M. Artificial Intelligence A Guide to Intelligent Systems, Addison-Wesley 2005. (Source of slides on frame-based systems used in this presentation ) § Zahedi, F. , Intelligent systems for Business, Wadsworth Publishing, Belmont, California, 1993. ICT 619 S 2 -05 41