Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

12-10-2013_09-24-50 / [Simon_Kendal,_Malcolm_Creen]_Introduction_to_Know(BookFi.org)

.pdf
Скачиваний:
108
Добавлен:
14.03.2016
Размер:
1.71 Mб
Скачать

Types of Knowledge-Based Systems

63

Activity 17

The table below shows some characteristics of both RBR and CBR. The details about RBR have been entered into the table. Complete the table for CBR, remembering that CBR examples are likely to be the opposite of RBR.

Factor

Rule-based reasoning

Case-based reasoning

 

 

 

Knowledge content –

Rules are small,

 

can the knowledge

independent, explicit

 

be expressed in small

pieces of knowledge.

 

explicit chunks?

 

 

Domain—is the

Yes, rules or heuristics are

 

knowledge domain

known and can be written

 

easy to understand

down.

 

and record?

 

 

Does the knowledge

In order to fire all rule

 

exactly match the

conditions must exactly

 

situation?

match the facts.

 

Feedback 17

Information on CBR is given in the third column.

Factor

Rule-based reasoning

Case-based reasoning

 

 

 

Knowledge

Rules are small,

content—can the

independent, explicit

knowledge be

pieces of knowledge.

expressed in small

 

explicit chunks?

 

Domain—is the

Yes, rules or heuristics

knowledge domain

are known and can be

easy to understand

written down.

and record?

 

Does the knowledge

In order to fire all rule

exactly match the

conditions must exactly

situation?

match the facts.

Cases represent large chunks of knowledge. The link between problem and solution is implicit.

The domain may not be fully understood but it is still possible to identify solutions to problems.

Cases maybe applied even if they only partially match the problem.

64

An Introduction to Knowledge Engineering

Current Research in CBR

The following web addresses contain information on research in CBR:

Artificial Intelligence Applications Institute: University of Edinburgh (makers of the AIAI CBR tool) at: http://www.aiai.ed.ac.uk/technology/casebasedreasoning.html

Norwegian University of Science and Technology: Al and Learning Group at: http://www.idi.ntnu.no/grupper/ai/cbr/

Papers on CBR can be found via Citeseer at: http://citeseer.ist.psu.edu/

Summary

In this section you have been introduced to CBR and learned that information in CBR systems is stored in a KB in the form of cases, rather than rules.

You also learned that the use of CBR systems is appropriate where problems cannot be easily decomposed or where the general principles involved are not completely understood, but where a library of past experience can be generated.

Self-Assessment Questions

Question 1

Describe how CBR can be used in searching the Internet for information.

Question 2

The CBR system shown earlier is used to diagnose printer faults. Imagine a new fault occurs which the CBR system incorrectly diagnoses. Explain what happens next.

Later the fault is correctly diagnoses as ‘No power’ and a solution is provided ‘Check electrical supply’. One of the printers symptoms was ‘Status lights: Off’. Making up the other symptoms and using the format you saw earlier in the chapter construct a diagram to represent the newly solved problem.

Answers to Self-Assessment Questions

Answer 1

Go to the AskJeeves website and ask the search engine a question. Rather than provide a list of sites straight away that may answer your question, Jeeves sometimes asks additional questions to clarify your initial question.

Types of Knowledge-Based Systems

65

This website is using two systems to try and determine the answer you need:

Case-based reasoning—by maintaining a list of frequently asked questions, it may be able to direct you to the appropriate website more quickly by checking this list and the results prepared earlier.

Firing different search rules to determine the important words within your search criteria. For example, a search for motor vehicles in the twentieth century running on motorways provides all sorts of references from buying cars to computer programming. You need to tell Jeeves exactly which area you are interested in to provide better matches.

Answer 2

After an incorrect diagnosis a technician is asked to investigate and solve the problem. When they have done this the new problem and solution, once it is confirmed, is documented as a new case and added to the case base.

Case 3 should look something like this.

 

 

Problem (Symptoms)

 

 

• Problem: Printer does not do anything

 

C

Printer type: Inkjet

 

Ink or toner empty: No

 

A

 

Paper empty: No

 

S

 

State of lights: Off

 

E

 

Printer ready: Unknown

 

 

 

3

Solution

 

 

Diagnosis: No power

 

 

 

 

• Repair: Check electrical supply

 

 

 

 

66

An Introduction to Knowledge Engineering

SECTION 4: GENETIC ALGORITHMS

Introduction

This section provides an introduction to genetic algorithms.

Objectives

By the end of the section you will be able to:

understand how the process of evolution applies to genetic algorithms

evaluate the value of genetic algorithms in specific problem-solving contexts.

What Are Genetic Algorithms?

An algorithm is a sequence of instructions to solve a problem. Although other knowledge-based systems (such as ANNs) are based on algorithms, many of those algorithms tend to be static, that is they do not change over time. While this provides some certainty in how the system will operate, it does mean that such systems may be limited when trying to determine the solution to a problem.

A genetic algorithm is a model of machine learning that derives its behaviour from a metaphor of some of the mechanisms of evolution in nature. This is done by the creation within a machine of a population of individuals represented by chromosomes, in essence a set of character strings that are analogous to the base-4 chromosomes in our own DNA. The individuals in the population then go through a process of simulated ‘evolution’.

Activity 18

This activity will give you a brief video introduction to genetic algorithms.

Watch the Robot Independence video at: http://www.pbs.org/saf/1303/ video/watchonline.html.

You will need to specify the type of media your system can play (either Real Media or Windows Media—the latter is probably your best bet) and your connection speed, 56K (dial-up connection) or 220K (high speed connection, e.g. T-1 or DSL).

Types of Knowledge-Based Systems

67

Activity 19

This activity will give you the opportunity to visualise genetic algorithms.

Visit the site http://www.rennard.org/alife/english/gavintrgb.html.

Follow the link to the Genetic Algorithm Viewer.

Detailed instructions and explanations are available on the site.

Note that the Java applet and source code can be downloaded from the front page.

When a genetic algorithm is implemented it is usually done in a manner that involves the following components:

a genetic representation for potential solutions to the problem

a way to create an initial population of potential solutions

an evaluation function that plays the role of the environment, rating solutions in terms of their ‘fitness’

genetic operators that alter the composition of children

values for various parameters that the genetic algorithm uses.

The actual process is cyclical and repeats until an optimum solution is obtained:

1.Evaluate the fitness of all of the individuals in the population.

2.Create a new population by performing operations such as crossover, fitnessproportionate reproduction and mutation on the individuals whose fitness has just been measured.

3.Discard the old population and iterate using the new population.

One iteration of this loop is referred to as a generation. The first generation (generation 0) of this process operates on a population of randomly generated individuals. From there on, the genetic operations, in concert with the fitness measure, operate to improve the population.

Example of Genetic Algorithms

Let’s say we have a pool of random letters and ‘space’ characters, strung into series of length 37. We are attempting to assemble the following sentence out of this primordial soup of letters and spaces:

jackdaws love my big sphinx of quartz

All we know about this sentence is that it is 37 characters in length, is composed up of the letters a–z and spaces, and that we have a function called fitness(string),

68

An Introduction to Knowledge Engineering

which accepts our test strings and returns a fitness value, i.e., tells us how many of the characters are correct.

First we make a set of 37 character random strings of letters. For this example, we’ll just use a set of four strings. In practice, hundreds or thousands would be applied to the task.

Here are the four random strings, matched up against the actual sequence, as well as their fitness values:

1

jzag uwnapd exmavni asrqmnalo evxarmp

 

 

|

|

|

| | |

|

|

||

 

 

 

 

 

 

 

 

 

fitness = 10

 

jackdaws love

my big sphinx of quartz

 

2

hgfboaiey afdoanvsdgr ayrebnonas od a

 

 

 

|

 

|

 

|

 

fitness = 3

 

jackdaws love

my big sphinx of quartz

 

3

nawegres fiop

cdebdebg hsdon filop uz

 

 

|

||

|

|

|

|

|

fitness = 8

jackdaws

love my big sphinx of quartz

 

4 sde rthui opnm xf zaqsl tehe nsqju io

 

 

|

|

|

fitness = 3

jackdaws

love my big sphinx of quartz

 

When each member of the population is evaluated we can see that strings 1 and 3 have the best fitness score. Strings 2 and 4 can therefore be discarded.

Incidentally, the average fitness for this first population is (10 + 3 + 8 + 3)/ 4 = 6

We then crossover portions of the genetic material from each of the remaining members of the population to generate the next generation. We can generate a new string combining 1 and 3 by taking the first letter from String 1 followed by three letters from String 3 then another from 1 and three from 3 and so on.

Repeating the process but this time taking the first letter from String 3 and the next three letters from String 1 will give us two new strings.

jawe resa fi p cmdebs hsnon o fila mp

nzagguwn apdoexmdvni asromnaio e xar-

(The ‘ ’ character is used here to indicate the presence of a space at the end of the string.)

Types of Knowledge-Based Systems

69

Another way of combining the genes would be to take the first half (approximately since there are only 37 characters in the string) of 1 and combine it with the second half of 3 then vice versa for the second string.

jzag uwnapd exmavniebg hsdon filop uz

nawegres fiop cdebd asrqmnalo evxarmp

After crossing over the genes in this way, we apply, consistent with the analogy of genetics, a small element of mutation. In this case the 11th character of the second new string has been changed to a space and the 3rd character of the fourth has been changed to a ‘c’.

We now have a new population of four strings and can evaluate them against our goal string.

 

jawe resa fi p cmdebs hsnon

o fila mp

 

5

||

|

 

 

 

||

|

fitness = 6

 

jackdaws love

my big sphinx

of

quartz

 

 

nzagguwn a doexmdvni asromnaio

e xar-

 

6

 

| |

 

 

|

|

 

fitness = 4

 

jackdaws love

my big sphinx

of

quartz

 

 

jzag uwnapd exmavniebg hsdon filop uz

 

7

|

|

| | |

|

 

|

fitness = 8

 

jackdaws love my big sphinx

of

quartz

 

 

nacegres fiop cdebd asrqmnalo evxarmp

 

8

||

||

|

|

| |

|

||

fitness = 11

 

jackdaws love my big sphinx

of

quartz

 

The average fitness score for our new population of strings has increased to

(6 + 4 + 8 + 11)/4 = 7.25

This process of selection, crossover and mutation continues until a reasonable solution to our problem has been found.

Though there may be many better ways of solving the small-scale problem of the example, for extremely complex situations where the string is merely a model or representation of something else—such as a series of possible components in a very complex organic molecule—the application of genetic algorithms becomes a very efficient solution strategy.

It must also be emphasised that many of the applications of genetic algorithms are to problems where it is sufficient to reach an adequate solution. For example,

70

An Introduction to Knowledge Engineering

generating one possible examination timetable would be a typical application of genetic algorithms. If you imagine several thousand students all sitting examinations over a 2-week period there would be many billions of possible examination timetables. However, the vast majority of these would involve one or more clashes, where a student would need to take two or more examinations at the same time. Clearly this is impossible. The goal would be too find an examination timetable with no clashes. Further no student would like to sit five examinations in 5 days (nor two in the same day) therefore an ideal timetable would be one where all examinations are evenly spread out. Given the immense difficulty in finding this one ideal timetable (assuming it exits), from among the many billions of possible timetables, we may be willing to accept any of the very good timetable solutions available, i.e., any timetable where there are no clashes and no student has two examinations in 1 day (though they may have three or four in 1 week). This is where genetic algorithms excel. They are very good at finding one of the many hundred of good solutions to such a problem.

Complex problems can be solved using other techniques, but it is in the rapid development of set of good solutions where genetic algorithms are particularly useful.

Other Examples of Genetic Algorithms

You will find examples of actual genetic algorithms on the Internet at:

http://ai.bpa.arizona.edu/ mramsey/ga.html

http://ai.bpa.arizona.edu/ tong/gaoi/

You will even find a genetic algorithm applied to playing jazz solos at:

http://www.it.rit.edu/ jab/GenJam.html

The genetic algorithm playground (a general purpose genetic algorithm toolkit where you can define and run your own optimisation problems) is available for download at:

http://www.aridolan.com/ofiles/ga/gaa/gaa.aspx#Download

Instructions are included.

Processes Within Genetic Algorithms

As already noted, genetic algorithms try to mimic evolution. To do this, they use three basic processes.

Reproduction

Production of new generations of code using parents with higher fitness ratings, that is having a higher probability of finding the answer to problems.

Types of Knowledge-Based Systems

71

Crossover

Changing the code within two strings at a random place and creating two new strings of code by merging the ‘split’ strings. This process is used in nature where genes from parents combine to form a whole new chromosome.

Mutation

Changing one digit in the code on a random basis. For example, changing a 1 to a 0 without the processes of reproduction or crossover. This mimics random changes in genetic code and is especially useful where crossover does not provide an answer.

Use of Genetic Algorithms

Genetic algorithms are used to solve many large problems including:

scheduling

transportation

layout and circuit design.

Two very detailed applications of genetic algorithms are available at:

A Genetic Algorithm Based University Timetabling System http://www.asap.cs.nott.ac.uk/publications/pdf/crimea94.pdf

General Aviation Aircraft (GAA): Analysis of a Product Family Platform using Genetic Algorithm

http://www.personal.psu.edu/users/m/v/mvd119/doc/gapaper 1 .doc

Current Research in Genetic Algorithms

The following web addresses contain information on research in genetic algorithms at:

AIAI, the Artificial Intelligence Applications Institute at the University of Edinburgh

http://www.aaai.org/AITopics/html/genalg.html

Indian Institute of Technology Kanpur Genetic Algorithms Laboratory http://www.iitk.ac.in/kangal/

Heuristics and Artificial Intelligence in Finance and Investment http://www.geocities.com/francorbusetti/

Papers on Genetic Algorithms can be found via Citeseer http://citeseer.ist.psu.edu/

Summary

This section has provided an introduction to genetic algorithms and shown how the process of applying them mimics the biological evolutionary process.

72

An Introduction to Knowledge Engineering

Self-Assessment Question

Question 1

Visit the website http://www.sambee.co.th/MazeSolver/mazega.html.

Write a brief explanation of how the system is working.

Question 2

Given the following problems to solve which of the following technologies would you use:

an expert system

a neural network

a case-based reasoning system

a genetic algorithm.

Problem 1

A brewery want a machine to smell beer to detect if any has gone off before it is canned. To help with this a robotic nose has been developed to smell the beer but which technology should they use for the decision-making component of the system?

Problem 2

A bank wants a system to decide if a loan applicant is likely to default on their loan payments, i.e., fail to pay back the loan. Which technology could be used for this?

Answer to Self-Assessment Question

Answer 1

You will notice that the solver is using the basic tools of genetic algorithms mentioned above. You should also see that the system gets better at solving the maze as more attempts are made. This happens because the better maze-solving routines are retained and the less effective ones eliminated from the system. Eventually, the algorithm is good enough to reach the end of the maze, although this can take a significant number of generations before this happens.

Answer 2

Problem 1

The obvious answer for this problem is a NN. Expert systems work from symbolic reasoning they are not good at dealing with sensory information. A NN, on the other hand, is very good at dealing with sensory data. A range of beers that smell