0% found this document useful (0 votes)
2 views

Unit-7 Expert Systems

An expert system is an AI program designed to simulate expert judgment in specific fields, originating in the 1960s with pioneers like Edward Feigenbaum. It consists of three main components: user interface, inference engine, and knowledge base, and employs various knowledge representation methods such as logical representation and semantic networks. Knowledge acquisition is crucial for building these systems, involving the gathering and structuring of domain-specific knowledge from various sources.

Uploaded by

Lok Regmi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Unit-7 Expert Systems

An expert system is an AI program designed to simulate expert judgment in specific fields, originating in the 1960s with pioneers like Edward Feigenbaum. It consists of three main components: user interface, inference engine, and knowledge base, and employs various knowledge representation methods such as logical representation and semantic networks. Knowledge acquisition is crucial for building these systems, involving the gathering and structuring of domain-specific knowledge from various sources.

Uploaded by

Lok Regmi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

7.

Expert System
7.1. Definition and History of Expert System.

An expert system is a computer program that uses artificial


intelligence (AI) to simulate the judgment and behavior of an expert in
a specific field. Expert systems are used to improve productivity and
competitiveness in fields such as forecasting, marketing, and
scheduling.
Expert systems originated in the 1960s, when computers were
starting to be used for more than basic calculations. Computer
scientist Edward Feigenbaum and Joshua Lederberg were pioneers in
the development of expert systems. The first expert systems were
DENDRAL, developed in 1965 by Feigenbaum and Lederberg. MYCIN,
developed at Standard University in the early 1970s, is another iconic
example of an expert system. Expert systems were a breakthrough in
AI research and were widely regarded as the future of AI in the 1980s.

Expert systems are intended to complement, not replace, human


experts. Expert systems often include probability factors in their
conclusions and recommendations. They may also display the
sequence of rules used to reach a conclusion, which can help users
evaluate the credibility of the recommendation. Expert systems can
learn from experience and incorporate heuristic rules, or “rules of
thumb”.

7.2. Architecture of Expert Systems


An expert system mainly consists of three components:
• User Interface
• Inference Engine
• Knowledge Base

1. User Interface
With the help of a user interface, the expert system interacts with
the user, takes queries as an input in a readable format, and passes it
to the inference engine. After getting the response from the inference
engine, it displays the output to the user. In other words, it is an
interface that helps a non-expert user to communicate with the expert
system to find a solution.

2. Inference Engine (Rules of Engine)


The inference engine is known as the brain of the expert system as it is
the main processing unit of the system. It applies inference rules to
the knowledge base to derive a conclusion or deduce new
information. It helps in deriving an error-free solution of queries asked
by the user.
With the help of an inference engine, the system extracts the
knowledge from the knowledge base.
There are two types of inference engine:
Deterministic Inference engine: The conclusions drawn from this type
of inference engine are assumed to be true. It is based on facts and
rules.
Probabilistic Inference engine: This type of inference engine contains
uncertainty in conclusions, and based on the probability.
Inference engine uses the below modes to derive the solutions:
Forward Chaining: it starts from the known facts and rules , and
applies the inference rules to add their conclusion to the known facts.
Backward Chaining: It is a backward reasoning method that starts from
the goal and works backward to prove the known facts.
3. Knowledge Base
The knowledgebase is a type of storage that stores knowledge
acquired from the different experts of the particular domain. It is
considered as big storage of knowledge. The more the knowledge
base, the more precise will be the Expert System.
It is similar to a database that contains information and rules of a
particular domain or subject.
One can also view the knowledge base as collections of objects and
their attributes. Such as a Lion is an object and its attributes are it is a
mammal, it is not a domestic animal, etc.

Components of Knowledge Base


Factual Knowledge: The knowledge which is based on facts and
accepted by knowledge engineers comes under factual knowledge.
Heuristic Knowledge: This knowledge is based on practice, the ability
to guess, evaluation, and experiences.
Knowledge Representation: It is used to formalize the knowledge
stored in the knowledge base using the If-else rules.

Knowledge Acquisitions: It is the process of extracting, organizing, and


structuring the domain knowledge, specifying the rules to acquire the
knowledge from various experts, and store that knowledge into the
knowledge base.
7.3 Knowledge Representation in
Expert System

• Knowledge Representation in AI refers to the way in which artificial


intelligence system store, organize, and utilize knowledge to solve
complex problems. It is a crucial aspect of AI, enabling machines to
mimic human understanding and reasoning.
• It is responsible for representing information about the real world so
that a computer can understand and can utilize this knowledge to
solve the complex real world problems such as diagnosis a medical
condition or communicating with humans in natural language.
• It is also a way which describes how we can represent knowledge in
artificial intelligence. Knowledge representation is not just storing data
into some database, but it also enables an intelligent machine to learn
from that knowledge and experiences so that it can behave
intelligently like a human.
Approaches of knowledge representation in Expert system.

1. Logical Representation.
2. Semantic Networks
3. Frames
4. Production Rules
5. Ontologies

1. Logical Representation
Logical representation involves using formal logic systems like
propositional and predicate logic to represent knowledge in a
structured, precise, and unambiguous way.
Logical representation allows AI systems to perform reasoning by
applying rules of inference to drive conclusions from known facts. It is
commonly used in applications that require rigorous and consistent
decision-making, such as theorem proving and rule-based systems.

Example:
• Fact : patient has fever.
• Rule: IF fever AND rash THEN possibility of measles.

Advantages:
• Precise and unambiguous.
• Facilitates reasoning using inference rules.
Limitations:
• Can become complex for large systems.
2. Semantic Networks
A semantic network is a graphical representation of knowledge where
nodes represent concepts, and edges represent relationships between
those concepts.
Semantic networks are used to model hierarchical relationships (like
class hierarchies in object-oriented programming) and associative
relationships (such as synonymy in natural language processing). They
help AI systems understand the connections between different
concepts and perform tasks like inference, classification, and ontology
mapping.
Example:
Node: Bird
Relationship: can Fly
Node: Robin (a type of Bird)
Advantage:
Visual and easy to understand.
Captures relationships effectively.

3. Frames
Frames are data structures that encapsulate knowledge about objects,
situations, or events in a structured format. Each frame contains
attributes (slots) and their associated values, which can include default
values, constraints, and even procedural knowledge.
Frames are used to represent stereotypical situations or objects,
allowing AI systems to make inferences based on the structure and
relationships within the frames. For example, a frame for a “car” might
include slots for make, model, color, and owner, along with rules for
filling in missing information.

Structure:
Frame: Car
Attribute: Color = Red
Attribute: Model = Sedan
Advantages:
Supports default reasoning and inheritance
Captures structured knowledge well.
Limitations:
May struggle with non-structured knowledge.

4. Production Rules
Production rules are “if-then” statements that express knowledge in
the form of conditions and corresponding actions. They are a key
component of rule-based systems.
Production rules are used in expert systems, where they form the
basis for decision-making and problem-solving. When the condition (if-
part) of a rule is met, the corresponding action (then-part) is executed,
enabling the AI system to derive conclusions, perform tasks, or
generate responses.

Example:
IF condition(s) THEN Actions(s).
IF temperature > 1000F THEN diagnosis =fever.

Advantages:
Intuitive and straightforward.
Easy to update and maintain.
Limitations:
Inefficient for large and complex systems.
5. Ontologies
Ontology is a formal representation of a set of concepts within a
domain and the relationships between them. Ontologies provide a
shared vocabulary and a common understanding of a domain, which
can be used by both humans and AI systems.
Ontologies are widely used in knowledge management, semantic web
technologies, and natural language processing. They enable AI systems
to understand the context of information, perform reasoning across
different domains, and facilitate interoperability between systems. For
example, ontology for the medical domain might define relationships
between diseases, symptoms, and treatment, helping AI systems to
diagnose illnesses or suggest treatment options.

Domain: Healthcare Diagnosis Ontology


1. Classes (Concepts):
• Person: Represents individuals (patients or healthcare
providers).
• Patient: A subclass of Person.
• Doctor: A subclass of Person.
• Disease: Represents medical conditions.
• Symptom: Represents observable effects of diseases.
• Treatment: Represents procedures, medications, or therapies.
• Hospital: Represents healthcare facilities.
2. Relationships:
• hasSymptom: Links a Disease to its Symptoms.
• Diagnoses: Links a Doctor to a Disease.
• Prescribes: Links a Doctor to a Treatment.
• treatedAt: Links a Patient to a Hospital.
• Requires: Links a Disease to a Treatment.
3. Attributes:
• Person:
o Name: the name of the person.
o Age: The age of the person.
• Disease:
o Name: The name of the disease.
o Severity: The severity level (e.g., mild, moderate, severe).
• Symptom:
o Name: The name of the symptom.
• Treatment:
o Type: Medication, surgery, or therapy.

7.4 Inference Mechanisms


7.4.1 Forward Chaining
Forward Chaining is also known as a forward deduction or forward
reasoning method when using an inference engine. Forward chaining
is a form of reasoning which start with atomic sentences in the
knowledge base and applies inference rules (Modus Ponens) in the
forward direction to extract more data until a goal is reached.
The forward-chaining algorithm starts from known facts, triggers all
rules whose premises are satisfied, and add their conclusion to the
known facts. This process repeats until the problem is solved.

Properties of Forward-Chaining:
• It is a down-up approach, as it moves from bottom to top.
• It is a process of making a conclusion based on known facts or
data, by starting from the initial state and reaches the goal state.
• Forward-Chaining approach is also called as data-driven as we
reach to the goal using available data.
• Forward-chaining approach is commonly used in the expert
system, such as CLIPS, business, and production rule systems.

Process of Forward Chaining


1. Initialize with facts:- Start with a known set of facts (the initial
state).
2. Match rules: Find rules whose conditions (if part) match the current
facts.
3. Apply rules: Execute the rules to generate new facts (conclusions).
4. Update knowledge base: Add the new facts to the knowledge base.
5. Repeat: Continue matching and applying rules until:
• The desired goal is achieved.
• No more applicable rules exist.

Example:
Consider a medical diagnosis system:
• Facts: Patient has fever and cough.
• Rules:
1. If the patient has fever and cough, they might have the flu.
2. If the patient has the flu, recommend rest and hydration.

Forward chaining steps:


1. Start with the facts: “fever” and “cough”.
2. Match Rule 1: Infer that the patient might have the flu.
3. Add “flu” to the facts.
4. Match Rule 2: Infer the recommendation for rest and hydration.

Example 2: Forward chaining, demonstrated with a rule-


based system for animal classification:
Scenario:
We want to classify animals based on their characteristics.
Rules:
1. If the animal lays eggs and has feathers, it is a bird.
2. if the animal lays eggs and has scales, it is a reptile.
3. If the animal has hair and gives live birth, it is a mammal.
4. if the animal is a bird and can fly, it is a flying bird.
5. if the animal is a bird and cannot fly, it is a flightless bird.
Facts:
• The animal lays eggs.
• The animal has feathers.
• The animal can fly.

Steps (Forward Chaining):


1. Start with the known facts:
• The animal lays eggs.
• The animal has feathers.
• The animal can fly.
2. Match Rules:
• Rule 1: “If the animal lays eggs and has feathers, it is a bird.”
o Match! The animal is classified as a bird.
• Add new fact:
o “ The animal is a bird” is added to the knowledge base.
• Match Rules with the updated facts:
o Rule 4: “ If the animal is a bird and can fly, it is a flying
bird.”
▪ Match! The animal is classified as a flying bird.
5. Add new fact:
• “ The animal is a flying bird” is added to the knowledge base.
6. No more rules apply.

Final Classification:
• The animal is a flying bird.

7.4.2. Backward Chaining:


Backward-Chaining is also known as a backward deduction or
backward reasoning method when using an inference engine. A
backward chaining algorithm is a form of reasoning, which starts with
the goal and works backward, chaining through rules to find known
facts that support the goal. It is a goal-driven inference technique
often used in rule-based systems and artificial intelligence. Instead of
starting from the known facts, it begins with a specific goal or
hypothesis and works backward to determine if the goal can be
satisfied using the available rules and facts.

Properties of backward chaining:


• It is known as a top-down approach.
• Backward-chaining is based on modus ponens inference rule.
• In backward chaining, the goal is broken into sub-goal or sub-
goals to prove the facts true.
• It is called a goal-driven approach, as a list of goals decides
which rules are selected and used.
• Backward-chaining algorithm is used in game theory, automated
theorem proving tools, inference engines, proof assistants, and
various AI applications.
• The backward-chaining method mostly used a depth-first search
strategy for proof.

Process of Backward Chaining


1. Start with the goal: Identify the desired conclusion.
2. Search for rules: Look for rules that lead to the goal.
3. Check conditions: Verify if the conditions of the rule (the “if” part)
are true.
• If a condition is not known, treat it as a sub-goal and
recursively check for supporting facts or rules.
4. Repeat: Continue working backward until:
• The initial facts confirm the goal.
• The goal cannot be satisfied.
Example:
Let’s use an example to the forward chaining one: animal
classification.
Rules:
1. If the animal lays eggs and has feathers, it is a bird.
2. If the animal lays egg and has scales, it is a reptile.
3. If the animal has hair and gives live birth, it is a mammal.
4. If the animal is a bird and can fly, it is a flying bird.
5. If the animal is a bird and cannot fly, it is a flightless bird.

Facts:
• The animal lays eggs.
• The animal has feathers.
• The animal can fly.

Goal:
Determine if the animal is a flying bird.
Steps (Backward Chaining):
1. Start with the goal: “The animal is a flying bird.”
2. Look for rules that conclude “flying bird”.
• Rule 4: “If the animal is a bird and can fly, it is a flying
bird.”
3. Check the conditions of Rule 4:
• “The animal is a bird” -> subgoal 1.
• “The animal can fly” -> known fact (True).
4. Subgoal 1: Determine if the animal is a bird.
• Look for rules that conclude “bird”.
o Rule 1: “ If the animal lays eggs and has feathers, it is a
bird.”
5. Check the conditions of Rule 1:
• “The animal lays egg” -> known fact (True).
• “The animal has feathers” -> Known fact (True).

6. Subgoal 1 is satisfied. The animal is a bird.


7. Return to Rule 4: Both conditions are satisfied. The animal is a flying
bird.

Final Conclusion:
The animal is a flying bird.

7.5 Knowledge Acquisition and Learning.


Knowledge acquisition refers to the process of gathering, organizing,
and encoding domain-specific knowledge into the knowledge base of
the expert system.
Steps in knowledge Acquisition
1. Identifying Sources:
• Human Experts: interviews, observations, and elicitation
from domain specialists.
• Documents: Textbooks, research papers, technical
manuals, and case studies.
• Databases: Structured datasets and historical records.
2. Extracting knowledge:
• Use of techniques like structured interviews; think-aloud
protocols, and questionnaires to extract expertise.
• Observing human experts performing tasks.
3. Representing knowledge:
• Encoding the acquired knowledge in formats such as rules,
facts, frames, or decision trees.
• Tools like decision tables, concept maps, and ontologies
help organize knowledge.
4. Validating Knowledge:
• Testing the knowledge base for correctness and
consistency with the help of experts.
• Refining the rules or structures to eliminate errors or
redundancies.

7.6. Application of Expert System.

Expert systems are computer programs designed to mimic human


expertise in a specific domain, providing advice, making decisions, or
solving problems. They are widely used in various fields due to their
ability to analyze data, apply reasoning, and draw conclusions based
on a predefined set of rules or knowledge.
1. Medical Diagnosis
Expert systems help doctors diagnose diseases and recommend
treatment plans by analyzing a patient’s symptoms and medical
history.
2. Financial services
Expert systems help with credit scoring, fraud detection, and
investment advice. They analyze financial data and patterns to
make decisions.
3. Technical support
Expert systems help troubleshoot technical issues and provide
solutions. They guide users through problem-solving steps.
4. Manufacturing
Expert systems help optimize production processes, perform
quality control, and manage inventory.
5. Research
Expert systems are used in research to search for oil, explore
space, and more.
6. Planning and Scheduling.
Expert systems are used for planning and scheduling tasks, such
as airline flight scheduling.

You might also like