You are on page 1of 62

Knowledgebased systems

Dr.M.R.NarasingaRao

Dr.M.R.NarasingaRao

Knowledge based Systems


A computer program which solves problems within a
limited and specific field using data on the problem,
knowledge related to the problem and intelligent
decision making capabilities
The nature of the problem, the solution to the
problem is not well defined or not known before
hand
Applications of knowledge based systems
Process control industries
Inference making
Process monitoring
Fault diagnosis and alarm management
Process scheduling and optimization
Dr.M.R.NarasingaRao

Structure of a knowledge
based system
Inference
Engine
( Reasoning
Mechanism)

Knowledgeb
ase
( Rules or
Productions)

Datebase
( Context )

Dr.M.R.NarasingaRao

Knowledge based System

Knowledge based system


able to make perceptions
new inferences using its reasoning
mechanism ( inference engine )
Inferences may form the outputs of
the knowledge based systems

Dr.M.R.NarasingaRao

Knowledge based system


Knowledge base
Knowledge and expertise in the specific domain
( domain specific facts and heuristics )
Represented in various forms ( if-then rules)
Database
Regarded as short term memory
Current status of the problem, inference states,
history of the solutions to date
New information from external sources such as
sensors and human interfaces is stored in the
database.
Context of the decision making process.
Dr.M.R.NarasingaRao

Knowledge based system


Inference Engine
Driver program of the knowledge based system
Depending on the data in the database, the
inference engine applies and operates on the
knowledge in the knowledge source to solve
problems and arrive at conclusions.
Inference mechanisms
Data structure selected for specific form of
knowledge representation determines the nature
of the program created as an inference engine.

Dr.M.R.NarasingaRao

Knowledge base system


Interface
To interact with the overall system
To browse through the knowledge source
To edit the knowledge source
Ex: keyboards, screen displays, sensors,
transducers, outputs from computer programs ,
expert systems etc.
Well developed knowledge based systems
knowledge acquisition facility
explanation feature
I=M[P(D),K]

Dr.M.R.NarasingaRao

Architectures of KBS
Three commonly used architectures
Production systems
Frame based systems
Black board systems
Some commonalities and some distinguishing features
Production systems
Rule based systems
Appropriate and representation and processing of
knowledge in problem solutions in AI
An expert system

Dr.M.R.NarasingaRao

Production Systems

Operation of a rule based system


New data are generated from external world and
stored in appropriate locations in the database
system . This is called a new context
The inference engine tries to match the new data
with the condition part of the rule in the
knowledge base. Rule searching
If the condition part of the rule matches with the
data, the rule is fired
Firing of a rule generates the new facts and this in
turn may form a new context

Dr.M.R.NarasingaRao

Production Systems
Two strategies
Forward Chaining
Backward Chaining
Forward Chaining
data driven search method
The rule base is searched to match an if part of a
rule with the data/context
Direct strategy
Bottom-up approach
Actions: deletion, creation and updation of data
Forward production system
Dr.M.R.NarasingaRao

10

Production Systems

Backward Chaining
A hypothesized conclusion is matched with the
rules in the knowledge base in order to determine
the context , that supports the particular
conclusion.
If enough facts that supports a hypothesis, the
hypothesis is accepted
Diagnosis and theorem proving
Logical explanation has to be attached to each
action
Backward chaining system

Dr.M.R.NarasingaRao

11

Production Systems

Conflict resolution methods


Conflict Set ( Context data , condition part of the rule)
Methods of conflict resolution
First Match
Toughest Match
Privileged Match
Most recent Match
First Match
The very first rule that is satisfied during searching will be
fired
Simple strategy , performance

Dr.M.R.NarasingaRao

12

Production systems
Toughest Match

the rule with the most condition


elements will be fired
Privileged Match
the rule with the highest priority will be
selected
Priority may be assigned based on the
toughness of the match
Significance and consequences of its
acts
Dr.M.R.NarasingaRao

13

Production Systems
Most recent match
The condition part satisfies the most
recent entries of data
Higher priority is given to more
recently arrived data in the database

Dr.M.R.NarasingaRao

14

Frame based Systems

An arrangement for representing and processing


knowledge in AI applications
It is a data structure developed to represent
expectational knowledge
Knowledge of what to expect when entering a given
situation for the first time
Common sense knowledge and general knowledge can
be represented in this way.
New information can be interpreted using old
information in a hierarchical manner.
A frame may contain context knowledge and action
knowledge
A frame that contain action rules are called action
frames
Dr.M.R.NarasingaRao

15

Frame based Systems


The frame that contains action rules are called
action frames
The frames that define object distribution are
called situational frames
A frame may consist of frame label and a set of
slots
Each slot may contain a set of statements or
another frame that is at the next lower level in
the hierarchy than the present level
Knowledge is represented in a hierarchical way.

Dr.M.R.NarasingaRao

16

Blackboard Systems

Cooperative problem solving architecture


Global database called blackboard
Several intelligent modules called knowledge sources
Control unit manages the operation of an entire
system
Blackboard is shared by and visible to the entire
system
Has the flexibility of accommodating different types of
knowledge sources
Different methods of knowledge representation and
processing
Knowledge sources are not arranged in a hierarchical
manner and will cooperate as equal partners in
making a knowledge based decision.
Dr.M.R.NarasingaRao

17

Blackboard Systems

Knowledge sources interact with shared data region


under the supervision of control unit
When the data in the blackboard change, which
corresponds to a change in the context, the knowledge
source would be triggered in an opportunistic manner
and an appropriate decision would be made
This decision could lead to further changes to the
blackboard data and subsequent triggering of other
knowledge source
Data may be changed by external means as well as by
knowledge source actions
External data entering the system go directly to the
blackboard . UI is linked to the blackboard.
The operation of the blackboard based system is
controlled by its control unit.
Dr.M.R.NarasingaRao

18

Blackboard system
When an updating of data occurs in the
blackboard , the control unit will trigger the
appropriate knowledge source , which will result
in execution of some reasoning procedure and
possibly generation of new information.
This architecture is fast and is suitable for real
time control applications.
A black board may consist of more than one layer
, each consisting of a subsystem ( having again a
black board architecture )
Hybrid systems can be developed as well.

Dr.M.R.NarasingaRao

19

Dr.M.R.NarasingaRao

20

Object Oriented
Programming
In a conventional
program written in a procedural

language
Instructions and data structures are integrated together
throughout the program
Even a small change to a data structure could make the
program non-functional clearly indicating an advantage of
the object oriented approach.
A knowledge based system shell is just an empty
knowledge based system without any domain knowledge.
It provides an inference engine and a knowledge
representation structure that can be used as a
programming tool for KBS in different application areas.
The knowledge source can be built incrementally and is
reletively easy to expand

Dr.M.R.NarasingaRao

21

Object Oriented Programming


Each module or object may be developed separately
and appropriately interconnected using OOP to
generate and implement a complex logic system
A frame based architecture with more slots is
amenable to OOP.
In conventional algorithmic programming complex
logic system will result in program codes with huge
numbers of nested-if-then-else loops
This causes the program to become difficult to
understand, and not amenable to maintenance,
debugging or modular development
Object oriented extensions such as C++ and CLOS
to conventional programming languages such as C
and LISP have been developed.
Dr.M.R.NarasingaRao

22

Expert systems
Expert System
Software system with high symbolic and
descriptive information content, which
can simulate the performance of a
human expert in a specific field/domain.
It is a special type of a knowledge
based system
Knowledgebase, database and an
inference engine and a human/machine
interface
Dr.M.R.NarasingaRao

23

Expert System

Dr.M.R.NarasingaRao

24

Expert System

System interface
Knowledge acquisition
Utilization of an expert system
Knowledgebase
Human knowledge and understanding ( Imitating a
human expert)
Inference engine
it is a driver program that traverses the knowledge
base in response to observations and other inputs
from the external world and possibly previous
inferences and results from the expert system it self
and will identify one or more outcomes or conclusions.
Explanation facility
Dr.M.R.NarasingaRao

25

Dr.M.R.NarasingaRao

26

Development of an expert
Forms of knowledgesystem
representation
logic, production systems, semantic scripts,
semantic primitives, frames and symbolic
representations
Testing and evaluating the system
experts and knowledge engineers
Developing an expert system
expert system shell
Software programs and knowledgebase
Satisfies the requirements of the system with
respect to the form of knowledge representation
that is used and the structure of the
knowledgebase
Dr.M.R.NarasingaRao

27

Tasks of knowledge
engineering
Knowledge Engineer

Gathers the expertise about a particular domain from


one/more experts and organizes that knowledge into a
form required by the particular expert system tool
that is to be used.
Acquisition of knowledge that is pertinent from
different sources ( experts, literature, media )
Interpretation and integration of the knowledge( from
various sources and in different forms)
Representation of the knowledge within the
knowledgebased system ( suitable structure,
language, incomplete knowledge, presence of
analytical models, availability of past experience
etc)
Dr.M.R.NarasingaRao

28

Tasks of knowledge
engineering

Processing of knowledge for making inference


( compatible with the knowledgebase, objectives
of the system, speed of decision making,
inference should be consistent with the system
objectives )
System needs and constraints ( accuracy,
implications of incomplete knowledge, cost of
incorrect inference etc)
Economic considerations ( development cost, cost
to the user in comparison to the benefit)

Dr.M.R.NarasingaRao

29

Applications

Education and training


Medical diagnosis and prescription of treatment
Mineral exploration
Interpretation of satellite imagery
Financial advising
Legal consultations
Tax return preparation
System trouble shooting and maintenance
Planning and scheduling
Weather forecasting
Trouble shooting
System control
Dr.M.R.NarasingaRao

30

Applications

Control expert system


Performance goals of the next generation expert system
Automatic generation of code and knowledge
representation
Automatic learning and system enhancement from
experience
Voice recognition
Communication through a natural language
Automated translation of documents into
knowledgebases
Cooperative problem solving architectures
Generic problem solving shells
Multilevel reasoning systems

Dr.M.R.NarasingaRao

31

Knowledge representation and processing


An appropriate representation of knowledge
including intuition and heuristic knowledge is
central to the development of machine
intelligence and of knowledge based systems
Two types of knowledge are needed for a KBS
Knowledge of the problem
Knowledge regarding methods for solving the
problem
Ways of representing knowledge

Logic, semantic networks, frames,


production systems, and fuzzy logic

Dr.M.R.NarasingaRao

32

Semantic networks

Useful for graphical representation and


processing of knowledge
Knowledge objects are represented in a network
Relationships are represented by arcs
Arcs are directed
Knowledge represented by semantic network is
processed using network searching procedures
usually starting with some available data and
ending with a set of conclusions

Dr.M.R.NarasingaRao

33

Semantic networks

Dr.M.R.NarasingaRao

34

Crisp logic
Logic is a useful technique for representing and
processing knowledge
propositions
Connectives
Knowledge is processed through reasoning by the
application of various laws of logic including an
appropriate rule of inference
Crisp and binary
Crisp sets and binary logic are analogous
Isomorphism between crisp sets and binary logic

Dr.M.R.NarasingaRao

35

Crisp sets
It is a collection of elements within a
crisp boundary. Since there cannot
be any elements on the boundary,
this is called a crisp set.
Venn diagram, universal set, null set,
xA, x doesnt belong to A
Operations on sets
Complement, union, intersection,
subset, proper subset
Dr.M.R.NarasingaRao

36

Logic

Conventional logic deals with statements called


propositions
Binary logic
Consider the propositions
Charcoal is white
Snow is cold
Temperature is above 60 ( depends on the actual value
of temparature)
In logic , knowledge is represented by propositions
Many propositions are connected by logical connectives
AND, OR,NOT, EQUALS and IMPLIES
Truth table gives the truth values of a combined
propositions in terms of the individual components

Dr.M.R.NarasingaRao

37

Logic
Disjunction: The disjunction of two
propositions is A V B
This operation in logic corresponds to
the union operation of sets
Conjunction
The conjunction of two propositions A
and B is A B

Dr.M.R.NarasingaRao

38

Logic

Dr.M.R.NarasingaRao

39

Logic
Implication: if A and B are two
propositions, then A implies B means IF
A THEN B. this may be denoted by AB
The two propositions A and B are
equivalent if A B and also B A. This
may be denoted by either A B or A
B.
Note that the statement A B is true
either if both A and B are true or if
both A and B are false.
Dr.M.R.NarasingaRao

40

Correspondence between
sets and logic

Dr.M.R.NarasingaRao

41

Laws of logic

Dr.M.R.NarasingaRao

42

Laws of Logic

Dr.M.R.NarasingaRao

43

Rules of Inference

Dr.M.R.NarasingaRao

44

Propositional calculus and


predicate calculus

Propositional calculus is the branch of logic where


propositions are used in logic calculations
Calculus: approach of calculation
Repositional calculus
Predicate calculus
Predicate statement: Predicate(Argument)
isHigh( x )

Dr.M.R.NarasingaRao

45

Soft computing
Intelligent and knowledgebased systems
Humans can effectively handle incomplete,
imprecise, fuzzy information in making intelligent
decisions
Fuzzylogic, probability theory, neural networks
and genetic algorithms are cooperatively used
knowledge representation and for mimicking the
reasoning and decision making process of a
human
Approximate reasoning

Dr.M.R.NarasingaRao

46

Fuzzy Logic
Useful in representing human knowledge in a specific
domain of application and Reasoning that knowledge to
make useful inferences
Binary logic is crisp and allows for only two states
Binary logic cannot handle fuzzy descriptors
Realistic extension of binary, crisp logic to qualitative,
subjective, and approximate situations which often
exist in problems of intelligent machines
The knowledgebase is represented by if-then rules of
fuzzy descriptors
Ex of fuzzy rule: if the speed is low and the target is
far, then moderately increase the power.
A fuzzy descriptor is described by a membership
function
Dr.M.R.NarasingaRao

47

Fuzzy Logic

The membership function gives a membership grade


between 0 and 1 for each possible value of fuzzy descriptor
A fuzzy set A is represented by a MF
Fz[x A]=A(x):[0,1]
This value gives grade of membership of x in A
0<A(x)<1 implies the membership is not crisp ( i.e.,
fuzzy)
The element x has some possibility of within the Fuzzy set
A.
The element x has some complementary possibility of
outside of A. i.e., the element is on the boundary of the set
A.
A fuzzy rule may be represented as grouping of
membership function
If A1 and B1 then C1; if A2 and B2 then C2.
Dr.M.R.NarasingaRao

48

Fuzzy logic

Approximate Reasoning in fuzzy


inference
FD=FP(D); FI=FK o FD
Application areas of fuzzy logic
smart appliances, supervisory
control of complex processes, expert
systems.

Dr.M.R.NarasingaRao

49

Neural Networks

ANN are massively connected networks and


represent parallel distributed processing
structures
Inspiration for NN
Approximating nonlinear functions
Learning
Neural Networks

neurons, layers and synapses and


Activation function
Output of the neural networks

Dr.M.R.NarasingaRao

50

Operation of a Neural Network

Dr.M.R.NarasingaRao

51

Main classes of NN

feed forward Neural Network

feedback Network
Feed forward Neural Network

MLP

signal flow

no feedback paths

learning is achieved through examples

supervised learning

learning algorithm
Feedback Networks

The output of one or more nodes ( output layer)


are fed back to one/more nodes in a previous layer (
hidden layer/input layer) or even to the same node.
Dr.M.R.NarasingaRao

52

Provides the capability of memory


Hopfield Networks
The input layer and a Hopfield layer
each node in the input layer is connected to only one
node in the output layer
The outputs of the network are fed back to the input nodes
via time delay ( providing memory) and synaptic weights
Nodes in the Hopfield layer use nonlinear activation
functions.
Some classes of NN use unsupervised learning algorithm
Synaptic weights are adjusted based on the input values to
the network not by comparing the network output with the
desired output.
Unsupervised learning is also called self organized learning
Useful for pattern classification and grouping of data

Dr.M.R.NarasingaRao

53

Examples of Unsupervised learning

Hebbian Learning

Competitive learning
Hebbian Learning:
The weight between neuron and an input is
strengthened if the neuron is fired by the input.
Competitive learning
weights are modified to enhance a node having
the largest output
Kohonen network with winner-take-all approach

Dr.M.R.NarasingaRao

54

Genetic algorithms
Genetic algorithms belong to the area of evolutionary
computing
Evolutionary computing
Optimization approach
Search is made to evolve a solution algorithm
Retains the most fit components in a procedure
Analogous to biological evolution through selection,
crossover and mutation
Plays an optimal role in the development of optimal and
self improving intelligent machine
Characteristics
It is based on multiple searching point /solution
candidates

Dr.M.R.NarasingaRao

55

It uses evolutionary operations, such as crossover and


mutation
It is based on probablistic operations
A genetic algorithm works with a population of
individuals, each representing a possible solution to a
given problem. Each individual is assigned a fitness
score according to how good its solution to the
problem is.
The highly fit (in an intellectual sense) Individuals are
given opportunities to reproduce by crossbreeding
with other individuals in the population. This produces
new individuals as offspring, who share some features
taken from each parent.
The least fit members of the population are less likely
to get selected for reproduction and will eventually
die out.
Dr.M.R.NarasingaRao

56

An entirely new population of possible solutions is


produced in this manner, by mating the best
individuals (i.e., individuals with best solutions) from
the current generation. The new generation will
contain a higher proportion of the characteristics
possessed by the fit members of the previous
generation.
By favoring the mating of the individuals who are
more fit (i.e., who can provide better solutions), the
most promising areas of the search space would be
exploited. A GA determines the next set of searching
points using the fitness values of the current
searching points, which are widely distributed
throughout the searching space
It uses the mutation operation to escape from a local
minimum.
Dr.M.R.NarasingaRao

57

Probabilistic Reasoning

Within the area of soft computing


May be viewed analogous to fuzzy logic reasoning
Uncertainty in place of fuzziness
Probability distribution/ density function,
membership functions
Bayesian Approach
Suppose that an observation d is made, and it may
belong to one of several classes ci. The Bayes
relation states: where
P(Ci / d) = P(d/Ci)*P(Ci) / P(d)
P(Ci / d)= given that the observation is d, the
probability that it may belong to class Ci

Dr.M.R.NarasingaRao

58

class ci (the a posteriori conditional probability)


P(d| ci ) = given that the observation belongs to
the class ci, the probability that the observation is
d (the class conditional probability)
P(ci) = the probability that a particular
observation belongs to class ci,
without knowing the observation itself (the a
priori probability)
P(d) = the probability that the observation is d
without any knowledge of the class.

Dr.M.R.NarasingaRao

59

Dr.M.R.NarasingaRao

60

Probablistic Reasoning
Application areas
Forecasting and signal analysis,
signal analysis and
filtering, parameter estimation,
system identification
Summarizing the biological analogies of soft Computing
techniques
Fuzzy techniques: Approximates human knowledge and
reasoning
Neural Networks: simplified representation of neuron
structure of a brain
Genetic algorithms: follows the process of evolution in
biologial species
Probablistic techniques: Analyzes the random future action
of a human.

Dr.M.R.NarasingaRao

61

Dr.M.R.NarasingaRao

62

You might also like