Unit 3
Unit 3
PART-A
Expert System
1. Architecture of Expert Systems
2. Roles of Expert Systems
I. Knowledge Acquisition
a. Meta Knowledge
b. Heuristics
3. Typical Expert Systems
a. MYCIN
b. DART
c. XOON
d. Expert Systems Shells
Introduction:-
[Link] is an Expert System?
An expert system is a computer program that is designed to solve complex problems and to
provide decision-making ability like a human expert. It performs this by extracting knowledge
from its knowledge base using the reasoning and inference rules according to the user queries.
The expert system is a part of AI, and the first ES was developed in the year 1970, which was the
first successful approach of artificial intelligence. It solves the most complex issue as an expert
by extracting the knowledge stored in its knowledge base. The system helps in decision making
for compsex problems using both facts and heuristics like a human expert. It is called so
because it contains the expert knowledge of a specific domain and can solve any complex
problem of that particular domain. These systems are designed for a specific domain, such
as medicine, science, etc.
The performance of an expert system is based on the expert's knowledge stored in its knowledge
base. The more knowledge stored in the KB, the more that system improves its performance.
One of the common examples of an ES is a suggestion of spelling errors while typing in the
Google search box.
Below is the block diagram that represents the working of an expert system:
Note: It is important to remember that an expert system is not used to replace the human experts;
instead, it is used to assist the human in making a complex decision. These systems do not have human
capabilities of thinking and work on the basis of the knowledge base of the particular domain.
[Link] are some popular examples of the Expert System:
o DENDRAL: It was an artificial intelligence project that was made as a chemical analysis expert
system. It was used in organic chemistry to detect unknown organic molecules with the help of
their mass spectra and knowledge base of chemistry.
o MYCIN: It was one of the earliest backward chaining expert systems that was designed to find
the bacteria causing infections like bacteraemia and meningitis. It was also used for the
recommendation of antibiotics and the diagnosis of blood clotting diseases.
o PXDES: It is an expert system that is used to determine the type and level of lung cancer. To
determine the disease, it takes a picture from the upper body, which looks like the shadow. This
shadow identifies the type and degree of harm.
o CaDeT: The CaDet expert system is a diagnostic support system that can detect cancer at early
stages.
c. Characteristics of Expert System
o High Performance: The expert system provides high performance for solving any type of
complex problem of a specific domain with high efficiency and accuracy.
o Understandable: It responds in a way that can be easily understandable by the user. It can take
input in human language and provides the output in the same way.
o Reliable: It is much reliable for generating an efficient and accurate output.
o Highly responsive: ES provides the result for any complex query within a very short period of
time.
d. Why Expert System?
Before using any technology, we must have an idea about why to use that technology and hence the
same for the ES. Although we have human experts in every field, then what is the need to develop a
computer-based system. So below are the points that are describing the need of the ES:
1. No memory Limitations: It can store as much data as required and can memorize it at the
time of its application. But for human experts, there are some limitations to memorize all
things at every time.
2. High Efficiency: If the knowledge base is updated with the correct knowledge, then it
provides a highly efficient output, which may not be possible for a human.
3. Expertise in a domain: There are lots of human experts in each domain, and they all have
different skills, different experiences, and different skills, so it is not easy to get a final output
for the query. But if we put the knowledge gained from human experts into the expert system,
then it provides an efficient output by mixing all the facts and knowledge
4. Not affected by emotions: These systems are not affected by human emotions such as
fatigue, anger, depression, anxiety, etc.. Hence the performance remains constant.
5. High security: These systems provide high security to resolve any query.
6. Considers all the facts: To respond to any query, it checks and considers all the available
facts and provides the result accordingly. But it is possible that a human expert may not
consider some facts due to any reason.
7. Regular updates improve the performance: If there is an issue in the result provided by the
expert systems, we can improve the performance of the system by updating the knowledge
base.
e. Capabilities of the Expert System
Below are some capabilities of an Expert System:
o Advising: It is capable of advising the human being for the query of any domain from the
particular ES.
o Provide decision-making capabilities: It provides the capability of decision making in any
domain, such as for making any financial decision, decisions in medical science, etc.
o Demonstrate a device: It is capable of demonstrating any new products such as its features,
specifications, how to use that product, etc.
o Problem-solving: It has problem-solving capabilities.
o Explaining a problem: It is also capable of providing a detailed description of an input problem.
o Interpreting the input: It is capable of interpreting the input given by the user.
o Predicting results: It can be used for the prediction of a result.
o Diagnosis: An ES designed for the medical field is capable of diagnosing a disease without using
multiple components as it already contains various inbuilt medical tools.
The expert system is a part of AI, and the first ES was developed in the year 1970, which was the
first successful approach of artificial intelligence. It solves the most complex issue as an expert
by extracting the knowledge stored in its knowledge base. The system helps in decision making
for compsex problems using both facts and heuristics like a human expert. It is called so
because it contains the expert knowledge of a specific domain and can solve any complex
problem of that particular domain. These systems are designed for a specific domain, such
as medicine, science, etc.
The performance of an expert system is based on the expert's knowledge stored in its
knowledge base. The more knowledge stored in the KB, the more that system improves its
performance. One of the common examples of an ES is a suggestion of spelling errors while
typing in the Google search box.
(or)
(or)
o User Interface
o Inference Engine
o Knowledge Base
[Link] 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.
o Forward Chaining: It starts from the known facts and rules, and applies the inference rules to
add their conclusion to the known facts.
o
▪ Example: Given a set of symptoms, the system applies rules to conclude that the patient has a specific
illness.
o
o Backward Chaining: It is a backward reasoning method that starts from the goal and works
backward to prove the known facts.
o
▪ Example: The system starts with the hypothesis that the patient has the flu and checks whether the
symptoms match.
3. Knowledge Base
o 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.
o It is similar to a database that contains information and rules of a particular domain or subject.
o 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
o Factual Knowledge: The knowledge which is based on facts and accepted by knowledge
engineers comes under factual knowledge.
o 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.
1. Explanation System:
o Definition: This module explains the reasoning process behind the system’s conclusions, helping
users understand how and why a particular solution was suggested.
o Example: If the system recommends a specific antibiotic for a bacterial infection, it can explain
which symptoms and rules led to that recommendation.
2. Knowledge Acquisition Module:
o Definition: This component is responsible for acquiring, organizing, and updating knowledge
from human experts or other sources.
o Example: A healthcare expert might input new medical findings into the system to keep it up-to-
date with the latest treatment methods.
3. Working Memory:
o Definition: A temporary storage area that holds the facts and rules currently being used to solve a
problem.
o Example: When diagnosing a patient, the system temporarily stores the symptoms as facts in the
working memory while reasoning about possible illnesses.
o Firstly, ES should be fed with expert knowledge. In the case of MYCIN, human experts
specialized in the medical field of bacterial infection, provide information about the causes,
symptoms, and other knowledge in that domain.
o The KB of the MYCIN is updated successfully. In order to test it, the doctor provides a new
problem to it. The problem is to identify the presence of the bacteria by inputting the details of a
patient, including the symptoms, current condition, and medical history.
o The ES will need a questionnaire to be filled by the patient to know the general information about
the patient, such as gender, age, etc.
o Now the system has collected all the information, so it will find the solution for the problem by
applying if-then rules using the inference engine and using the facts stored within the KB.
o In the end, it will provide a response to the patient by using the user interface.
Participants in the development of Expert System
1. Expert: The success of an ES much depends on the knowledge provided by human experts.
These experts are those persons who are specialized in that specific domain.
2. Knowledge Engineer: Knowledge engineer is the person who gathers the knowledge from
the domain experts and then codifies that knowledge to the system according to the
formalism.
3. End-User: This is a particular person or a group of people who may not be experts, and
working on the expert system needs the solution or advice for his queries, which are
complex.
2. Inference Engine:
● The inference engine is the "brain" of the expert system. It processes the information
stored in the knowledge base and applies logical rules to deduce new information or
reach conclusions.
● Role: Simulates human reasoning by applying logical operations (such as deduction) to
the knowledge base to draw conclusions, make decisions, or solve problems.
3. User Interface:
● The user interface is the part of the system through which users interact with the expert
system. It allows users to input data, ask questions, and receive responses or
recommendations.
● Role: Facilitates communication between the user and the expert system, ensuring ease
of use and accessibility.
● Many expert systems include an explanation subsystem that can justify and explain how
the system arrived at a particular conclusion or recommendation.
● Role: Enhances the transparency of the expert system by providing explanations to users,
which is crucial for building trust and understanding of the system's decision-making
process.
● This component is responsible for gathering, organizing, and updating the information in
the knowledge base. Knowledge acquisition can come from human experts, databases,
and other information sources.
● Role: Ensures that the knowledge base is accurate, up-to-date, and comprehensive,
allowing the expert system to make well-informed decisions.
6. Working Memory:
● The working memory holds information related to the current problem being addressed,
including user inputs, intermediate results, and conclusions.
● Role: Serves as a temporary storage area for dynamic information that changes with each
session or problem-solving scenario.
● In rule-based expert systems, an agenda is used to prioritize which rules to apply at each
step of problem-solving.
● Role: Manages the order in which rules are processed, allowing the system to handle
complex reasoning tasks more efficiently.
● Some advanced expert systems include components for refining and improving their
knowledge base over time through learning from new data or expert feedback.
● Role: Allows the system to evolve and become more accurate by incorporating new
insights, experiences, or data.
● In some systems, this component collects data from the user or external databases to
supplement its internal knowledge.
● Role: Ensures that the system has all necessary information to provide accurate and
relevant outputs, enhancing decision accuracy.
3. Knowledge Acquisition
Knowledge acquisition process of gathering, structuring, and encoding domain-specific
knowledge into the system’s knowledge base. This knowledge allows the system to make
informed decisions or solve problems like a human expert.
Here’s a detailed explanation of each point in the knowledge acquisition
processwith examples:
1. Identify the Domain: Determine the specific area in which the expert system will operate (e.g.,
medical diagnosis, financial planning).
2. Engage Experts: Collaborate with domain experts to extract relevant knowledge. Knowledge
engineers work closely with experts through interviews, observations, and discussions to gather
insights.
3. Extract Knowledge: Collect detailed information, including facts, rules, heuristics, and
procedures used by experts.
4. Encode Knowledge: Translate the extracted knowledge into a formal representation that the
expert system can process (e.g., production rules, decision trees).
5. Validate Knowledge: Check the encoded knowledge for accuracy, completeness, and
consistency. Often, experts review the knowledge base to ensure it reflects real-world expertise.
6. Implement and Test: Integrate the knowledge into the expert system and test it using real-world
scenarios to evaluate its performance.
7. Refinement and Updating: Based on feedback and new information, refine and update the
knowledge base to improve the system's accuracy and effectiveness.
5. Meta Knowledge
Meta-knowledge in expert systems within artificial intelligence (AI) refers to "knowledge about
knowledge." It encompasses information about how the system’s knowledge should be used,
organized, and controlled to enhance its reasoning processes. While the core knowledge base in
an expert system contains facts, rules, and heuristics specific to a particular domain, meta-
knowledge guides the system on how to use this domain knowledge effectively.
Control knowledge involves strategies and rules that direct how the expert system should apply
its core knowledge. It determines the order in which rules are applied and how to resolve
conflicts.
Example: In a medical diagnosis system like MYCIN, control knowledge helps in deciding
which diagnostic rules to apply based on the patient’s symptoms. If multiple rules could
potentially apply, control knowledge might prioritize rules based on their relevance or
confidence level.
● Scenario: The system identifies a patient with symptoms that could be linked to either a
bacterial infection or a viral infection. Control knowledge guides the system to first apply
rules that consider bacterial infections if there are strong indications (e.g., positive culture
results) and only consider viral infections if bacterial options are ruled out.
2. Heuristic Knowledge
Heuristic knowledge includes “rules of thumb” or practical methods that help the system make
decisions more efficiently. It provides shortcuts or strategies for solving problems based on
general principles or past experiences.
Example: In an expert system for financial planning, heuristic knowledge might include
strategies for handling various investment scenarios. For instance:
This type of meta-knowledge helps the system handle situations where information is incomplete
or uncertain. It includes mechanisms for dealing with ambiguous or conflicting data.
● Scenario: If the system receives conflicting data about a patient’s condition (e.g.,
symptoms suggest one disease, but lab results are inconclusive), it uses meta-knowledge
to weigh the reliability of each piece of evidence. For example, it might apply higher
confidence to lab results over symptoms if the lab results have a higher reliability rating.
4. Knowledge Organization
Knowledge organization refers to how the system structures and manages its knowledge base.
This includes how related concepts are grouped and how information is prioritized.
● Scenario: The system might categorize information into various levels of support
complexity—basic troubleshooting steps, advanced diagnostics, and expert-level
interventions. When a user reports an issue, the system uses its organization knowledge
to direct the query to the appropriate category, thus streamlining the support process.
Example of Meta-Knowledge in Expert Systems:
6. Heuristics
Heuristics in expert systems refer to strategies or rules of thumb that guide the system’s
problem-solving processes. These are not strictly algorithmic but are based on practical,
experience-driven knowledge to simplify decision-making and improve the efficiency of
problem-solving. Heuristics help expert systems make reasonable decisions in complex or
uncertain situations by applying general principles that have proven effective in similar
scenarios.
1. Rule-Based Heuristics
o Description: Simple if-then rules derived from expert knowledge or common
practices.
o Example: In a medical diagnosis system, a heuristic might be: “If the patient has
a high fever and a rash, then check for possible viral infections first.” This rule
simplifies the diagnostic process by prioritizing certain conditions based on
common symptom patterns.
2. Similarity-Based Heuristics
o Description: Using past cases or examples that are similar to the current problem
to guide decision-making.
o Example: In a legal expert system, a heuristic might be: “If the current case
resembles a previously resolved case with a similar contract clause, use the same
interpretation as in the previous case.”
3. Experience-Based Heuristics
o Description: Heuristics derived from the accumulated experience of experts in
the field.
o Example: In financial planning, a heuristic might be: “For clients nearing
retirement, prioritize low-risk investments to preserve capital,” based on
experienced advisors’ observations about client behavior and market trends.
4. Pattern Recognition Heuristics
o Description: Identifying and applying patterns observed in historical data.
o Example: In fraud detection systems, a heuristic might be: “Flag transactions that
are significantly higher than the user’s typical spending patterns,” based on
observed patterns of fraudulent activity.
5. Constraint-Based Heuristics
o Description: Applying constraints or limitations to reduce the search space for
solutions.
o Example: In a scheduling system, a heuristic might be: “Assign tasks to available
time slots that do not exceed the capacity of the resource,” to ensure that
scheduling is feasible given resource constraints.
6. Greedy Heuristics
o Description: Making locally optimal choices at each step with the hope of finding
a globally optimal solution.
o Example: In route planning, a heuristic might be: “Always choose the shortest
available path to the destination,” which simplifies the routing process by
focusing on local optimizations.
Benefits of Heuristics:
● Speed: Heuristics allow expert systems to make quick decisions without exhaustive
analysis.
● Efficiency: They reduce the computational load by focusing on promising areas or
simplifying complex problems.
● Practicality: Heuristics apply practical experience and rules of thumb, making them
effective in real-world scenarios.
(or)
MYCIN Expert System was one of the earliest and most influential artificial intelligence
programs developed for medical diagnosis. It was created in the early 1970s at Stanford
University and primarily focused on diagnosing bacterial infections and recommending
appropriate antibiotic treatments.
1. Knowledge Base:
o The knowledge base of MYCIN contained medical knowledge about bacterial
infections, such as meningitis and bacteremia, and treatments based on antibiotics.
o It was structured as a series of "if-then" rules. For example:
▪ "If the patient has a high fever, stiff neck, and a positive Gram stain, then
consider bacterial meningitis."
2. Inference Engine:
o The system used an inference engine to process the rules in the knowledge base.
MYCIN employed a backward chaining approach, starting with a goal (e.g.,
diagnosing an infection) and working backward to determine which facts and
rules were needed to achieve that goal.
o When presented with patient symptoms, test results, and other information, the
inference engine would apply the relevant rules to suggest a possible diagnosis
and recommend treatment.
3. User Interface:
o MYCIN interacted with users, typically physicians, through a question-and-
answer format. It asked questions to gather relevant information about the
patient’s symptoms and lab test results.
o The input process was designed to be straightforward so that non-experts (doctors
without deep expertise in infectious diseases) could still use the system
effectively.
4. Explanation Facility:
o One of MYCIN’s notable features was its ability to explain its reasoning.
Physicians could ask MYCIN why it reached a certain conclusion, and the system
would explain which rules were applied and how the data led to its diagnosis.
oThis explanation capability helped build trust in the system, as doctors could
understand the rationale behind its recommendations.
5. Knowledge Acquisition:
o MYCIN’s rules were created with the help of medical experts (e.g., infectious
disease specialists). The knowledge was encoded manually by the developers, as
automated learning was not as advanced at the time.
● A physician inputs information about a patient's symptoms and test results (e.g., fever,
presence of bacteria in blood cultures).
● MYCIN asks further clarifying questions to gather more details, such as the patient's age,
immune status, or specific characteristics of the bacteria.
● Based on the responses, MYCIN applies rules in its knowledge base to suggest a
diagnosis, such as bacterial meningitis, and recommends a course of antibiotics tailored
to the identified infection.
● It also provides an explanation of how it arrived at its conclusion, such as highlighting
specific symptoms and lab results that match the criteria for the diagnosis.
Limitations of MYCIN:
● The expert system has a knowledge base with information about patient intake, treatment times,
available staff, and medical equipment.
● DART is integrated into this system to handle real-time decision-making.
Dynamic Analysis
1. Monitoring: DART continuously monitors patient intake rates, treatment completion times, and
available resources (e.g., beds, staff).
2. Data Inputs: It receives real-time data from patient check-in systems and staff schedules.
Event Trigger
● Suddenly, a mass casualty incident occurs (e.g., a traffic accident), leading to an influx of
patients.
Replanning Process
1. Anomaly Detection: DART detects a spike in patient numbers and assesses that current
resources are insufficient to meet the demand.
2. Replanning:
o Resource Allocation: DART analyzes the availability of additional staff (e.g., on-call
nurses) and equipment (e.g., extra beds in recovery).
o Triage Adjustment: It suggests modifying triage protocols to prioritize critical cases,
ensuring timely treatment for the most severe injuries.
Decision Support
Feedback Loop
Benefits Observed
● The hospital can respond quickly to the surge in patients, minimizing wait times and improving
care quality.
● Staff and resources are utilized more efficiently, reducing stress on the emergency department.
Example:-
Scenario: Configuring a Custom Gaming PC
Customer Request: A customer, Sarah, wants to build a custom gaming PC that meets her
specific requirements, such as high performance for gaming, the latest graphics card, and a
budget of $2,000.
Step-by-Step Process
1. Data Input:
o Sarah's specifications are inputted into the XOON system:
▪ Purpose: Gaming
▪ Budget: $2,000
▪ Preferred Brands: NVIDIA for the graphics card, Intel for the CPU.
▪ Additional Needs: At least 16GB of RAM, RGB lighting, and a 1TB SSD.
2. Configuration Analysis:
o XOON accesses its knowledge base, which includes:
▪ Compatibility information for components (e.g., which CPUs work with which
motherboards).
▪ Performance benchmarks for different parts.
▪ Pricing data to stay within budget.
3. Recommendations:
o XOON generates a list of compatible components based on Sarah’s requirements:
▪ CPU: Intel Core i7-12700K
▪ GPU: NVIDIA GeForce RTX 3070
▪ Motherboard: ASUS ROG Strix Z690-E
▪ RAM: Corsair Vengeance LPX 16GB (2 x 8GB)
▪ Storage: Samsung 970 EVO Plus 1TB NVMe SSD
▪ Case: NZXT H510 (with RGB fans)
▪ Power Supply: EVGA 650W
4. Output and Review:
o XOON provides Sarah with:
▪ A detailed configuration summary.
▪ Estimated total cost: $1,900, which fits within her budget.
▪ Suggestions for optional upgrades, such as additional storage or a higher wattage
power supply for future expansions.
5. Final Adjustments:
o Sarah can review the recommendations and make changes, such as switching the GPU for
a different model or adjusting the RAM size.
o XOON helps ensure that any adjustments remain compatible with the overall system.
6. Order Confirmation:
o Once Sarah approves the configuration, the order is finalized, and XOON generates a
complete order list for procurement.
(defrule flu-diagnosis
(symptom fever)
(symptom cough)
(symptom body-aches)
=>
(assert (diagnosis flu)))
This rule states that if a patient has a fever, cough, and body aches, the system concludes
that the diagnosis is flu.
2. Input Symptoms:
o The system needs to gather input from the user (the doctor). The user interface prompts
the doctor to enter the symptoms they observe in the patient.
3. Inference Engine:
o CLIPS processes the input using its inference engine. For instance, if the doctor inputs
the symptoms:
▪ Fever
▪ Cough
▪ Sore throat
The inference engine will check the rules and match them against the input.
4. Generate Diagnosis:
o Based on the input, the inference engine may find matches for multiple conditions. For
example, it might find rules for both flu and strep throat.
5. Provide Recommendations:
o The system could output the possible diagnoses along with recommendations for further
tests or treatments:
Possible Diagnoses:
- Flu
- Strep Throat
Recommended Actions:
- Consider a rapid strep test.
- Prescribe antiviral medication if flu is confirmed.
6. Feedback Loop:
o The system can allow doctors to provide feedback on the recommendations, helping to
refine the knowledge base over time.
● Rapid Development: Using CLIPS allows for quick creation of rules without needing to code
everything from scratch.
● Ease of Updates: As new medical knowledge becomes available, the knowledge base can be
updated easily by adding new rules.
● User-Friendly Interface: Doctors can interact with the system without needing to understand the
underlying programming.